extern SR_PRIV struct sr_dev_driver session_driver;
static int session_driver_initialized = 0;
+#if !HAVE_ZIP_DISCARD
+/* Replacement for zip_discard() if it isn't available.
+ */
+SR_PRIV void sr_zip_discard(struct zip *archive)
+{
+ if (zip_unchange_all(archive) < 0 || zip_close(archive) < 0)
+ sr_err("Failed to discard ZIP archive: %s", zip_strerror(archive));
+}
+#endif
+
/** Read metadata entries from a session archive.
* @param[in] archive An open ZIP archive.
* @param[in] entry Stat buffer filled in for the metadata archive member.
break;
}
sr_config_set(sdi, NULL, SR_CONF_NUM_LOGIC_CHANNELS,
- g_variant_new_uint64(total_channels));
+ g_variant_new_int32(total_channels));
for (k = 0; k < total_channels; k++) {
- g_snprintf(channelname, sizeof channelname,
+ g_snprintf(channelname, sizeof(channelname),
"%d", k);
sr_channel_new(sdi, k, SR_CHANNEL_LOGIC,
FALSE, channelname);
}
} else if (!strncmp(keys[j], "probe", 5)) {
- tmp_u64 = g_ascii_strtoull(keys[j]+5, NULL, 10);
+ tmp_u64 = g_ascii_strtoull(keys[j] + 5, NULL, 10);
if (!sdi || tmp_u64 == 0 || tmp_u64 > G_MAXINT) {
ret = SR_ERR_DATA;
break;