]> sigrok.org Git - libsigrok.git/commitdiff
session-file: Use 32-bit int for channel count
authorDaniel Elstner <redacted>
Fri, 2 Oct 2015 18:09:46 +0000 (20:09 +0200)
committerDaniel Elstner <redacted>
Fri, 2 Oct 2015 18:09:46 +0000 (20:09 +0200)
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().

src/session_driver.c
src/session_file.c

index f0bff4b9a96df9055b591f375347ef37f047043b..6befa780ece2b88492abc699a2ab8b266a3168c1 100644 (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;
index fdceba1476b3b8c690412fd52a2936064f25fa62..294614a140095942a0b1ad1d6cd52cc3a1a01369 100644 (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);