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().
This commit is contained in:
Daniel Elstner 2015-10-02 20:09:46 +02:00
parent 5eff221e8c
commit 2c38a41a60
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);