From: Daniel Elstner Date: Fri, 2 Oct 2015 18:09:46 +0000 (+0200) Subject: session-file: Use 32-bit int for channel count X-Git-Tag: libsigrok-0.4.0~235 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2c38a41a60b8ebb8137d3b5b14ae652c66af6034;p=libsigrok.git session-file: Use 32-bit int for channel count SR_CONF_NUM_LOGIC_CHANNELS is defined as SR_T_INT32. Create the GVariant with the correct type to avoid a type mismatch error in sr_variant_type_check(). --- diff --git a/src/session_driver.c b/src/session_driver.c index f0bff4b9..6befa780 100644 --- a/src/session_driver.c +++ b/src/session_driver.c @@ -278,7 +278,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd vdev->unitsize = g_variant_get_uint64(data); break; case SR_CONF_NUM_LOGIC_CHANNELS: - vdev->num_channels = g_variant_get_uint64(data); + vdev->num_channels = g_variant_get_int32(data); break; default: return SR_ERR_NA; diff --git a/src/session_file.c b/src/session_file.c index fdceba14..294614a1 100644 --- a/src/session_file.c +++ b/src/session_file.c @@ -266,7 +266,7 @@ SR_API int sr_session_load(struct sr_context *ctx, const char *filename, 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, "%d", k);