]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/api.c
Change type of SR_CONF keys to uint32_t.
[libsigrok.git] / src / hardware / fx2lafw / api.c
index d4643ff760f491e2269602000345f0739c5e6511..a233cbc878d61862bc529c7ecda95ea016b94e46 100644 (file)
@@ -73,11 +73,11 @@ static const struct fx2lafw_profile supported_fx2[] = {
        { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
 };
 
-static const int32_t hwopts[] = {
+static const uint32_t hwopts[] = {
        SR_CONF_CONN,
 };
 
-static const int32_t hwcaps[] = {
+static const uint32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_TRIGGER_MATCH,
        SR_CONF_SAMPLERATE,
@@ -385,7 +385,7 @@ static int cleanup(void)
        return ret;
 }
 
-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 dev_context *devc;
@@ -399,7 +399,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
 
        devc = sdi->priv;
 
-       switch (id) {
+       switch (key) {
        case SR_CONF_CONN:
                if (!sdi->conn)
                        return SR_ERR_ARG;
@@ -424,7 +424,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 dev_context *devc;
@@ -444,8 +444,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 
        ret = SR_OK;
 
-       switch (id)
-       {
+       switch (key) {
                case SR_CONF_SAMPLERATE:
                        arg = g_variant_get_uint64(data);
                        for (i = 0; i < ARRAY_SIZE(samplerates); i++) {
@@ -467,7 +466,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        return ret;
 }
 
-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)
 {
        GVariant *gvar;
@@ -478,12 +477,12 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
-               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t));
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
+                               hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t));
                break;
        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;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));