]> sigrok.org Git - libsigrok.git/commitdiff
rdtech-tc: use size_t for memory sizes and indices
authorGerhard Sittig <redacted>
Thu, 16 Mar 2023 02:29:54 +0000 (03:29 +0100)
committerGerhard Sittig <redacted>
Thu, 16 Mar 2023 13:29:30 +0000 (14:29 +0100)
src/hardware/rdtech-tc/protocol.c
src/hardware/rdtech-tc/protocol.h

index f4e02a67eaef81c5492aaa1e3a1382d94dc79402..39d52ba5c3ea6935e127f6f48e68a1a992b79f67 100644 (file)
@@ -178,13 +178,13 @@ static void handle_poll_data(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
        uint8_t poll_pkt[TC_POLL_LEN];
-       int i;
+       size_t i;
        GSList *ch;
 
        devc = sdi->priv;
-       sr_spew("Received poll packet (len: %d).", devc->buflen);
+       sr_spew("Received poll packet (len: %zu).", devc->buflen);
        if (devc->buflen != TC_POLL_LEN) {
-               sr_err("Unexpected poll packet length: %i", devc->buflen);
+               sr_err("Unexpected poll packet length: %zu", devc->buflen);
                return;
        }
 
index 9c7056d0bfe97b1d21ba4acc80994be6b5d0db76..4692ec4022f004fe223abba239050041ec21c486 100644 (file)
@@ -38,7 +38,7 @@ struct dev_context {
        const struct binary_analog_channel *channels;
        struct sr_sw_limits limits;
        uint8_t buf[RDTECH_TC_BUFSIZE];
-       int buflen;
+       size_t buflen;
        int64_t cmd_sent_at;
 };