]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/testo/api.c
windows: Fix various compiler warnings.
[libsigrok.git] / src / hardware / testo / api.c
index da6d171a3ac8c52aedb64c549fb7a395c84eb096..de3faf04334198e4d882d3a46ba25b3e41659bde 100644 (file)
@@ -36,8 +36,9 @@ static const uint32_t devopts[] = {
        SR_CONF_LIMIT_MSEC | SR_CONF_SET,
 };
 
-unsigned char TESTO_x35_REQUEST[] = { 0x12, 0, 0, 0, 1, 1, 0x55, 0xd1, 0xb7 };
-struct testo_model models[] = {
+static const uint8_t TESTO_x35_REQUEST[] = { 0x12, 0, 0, 0, 1, 1, 0x55, 0xd1, 0xb7 };
+
+static const struct testo_model models[] = {
        { "435", 9, TESTO_x35_REQUEST },
 };
 
@@ -294,13 +295,9 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
                devc->limit_msec = g_variant_get_uint64(data);
                now = g_get_monotonic_time() / 1000;
                devc->end_time = now + devc->limit_msec;
-               sr_dbg("Setting time limit to %" PRIu64 "ms.",
-                      devc->limit_msec);
                break;
        case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = g_variant_get_uint64(data);
-               sr_dbg("Setting sample limit to %" PRIu64 ".",
-                      devc->limit_samples);
                break;
        default:
                ret = SR_ERR_NA;
@@ -375,7 +372,7 @@ static void receive_data(struct sr_dev_inst *sdi, unsigned char *data, int len)
 
 }
 
-SR_PRIV void receive_transfer(struct libusb_transfer *transfer)
+SR_PRIV void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
 {
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
@@ -493,7 +490,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        if (testo_request_packet(sdi) != SR_OK)
                return SR_ERR;
 
-       buf = g_try_malloc(MAX_REPLY_SIZE);
+       buf = g_malloc(MAX_REPLY_SIZE);
        transfer = libusb_alloc_transfer(0);
        libusb_fill_bulk_transfer(transfer, usb->devhdl, EP_IN, buf,
                        MAX_REPLY_SIZE, receive_transfer, (void *)sdi, 100);