]> sigrok.org Git - libsigrok.git/blobdiff - src/session_driver.c
Change type of SR_CONF keys to uint32_t.
[libsigrok.git] / src / session_driver.c
index 9120ea14575b4f2e71fbfa3d0fcdfc28100b8467..6a320aa5b3d17908dc401fa75bea5bd1ec0d3853 100644 (file)
@@ -49,7 +49,7 @@ struct session_vdev {
        gboolean finished;
 };
 
-static const int hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_CAPTUREFILE,
        SR_CONF_CAPTURE_UNITSIZE,
        SR_CONF_SAMPLERATE,
@@ -209,14 +209,14 @@ static int dev_close(struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        struct session_vdev *vdev;
 
        (void)cg;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                if (sdi) {
                        vdev = sdi->priv;
@@ -231,7 +231,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        struct session_vdev *vdev;
@@ -240,7 +240,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        vdev = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_SAMPLERATE:
                vdev->samplerate = g_variant_get_uint64(data);
                sr_info("Setting samplerate to %" PRIu64 ".", vdev->samplerate);
@@ -268,7 +268,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return SR_OK;
 }
 
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        (void)sdi;
@@ -276,8 +276,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
                break;
        default:
                return SR_ERR_NA;