]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lecroy-xstream/protocol.c
Fix various gcc 8 compiler warnings related to ARRAY_SIZE.
[libsigrok.git] / src / hardware / lecroy-xstream / protocol.c
index 0c16129f2b4102808c7edc103040c6243459a2b1..8a2129a71bb28ecd3b5291cba8f1a3e8bcdd8897 100644 (file)
@@ -92,11 +92,11 @@ static const char *trigger_sources[] = {
 
 static const uint64_t timebases[][2] = {
        /* picoseconds */
-       { 20, 1000000000000 },
-       { 50, 1000000000000 },
-       { 100, 1000000000000 },
-       { 200, 1000000000000 },
-       { 500, 1000000000000 },
+       { 20, UINT64_C(1000000000000) },
+       { 50, UINT64_C(1000000000000) },
+       { 100, UINT64_C(1000000000000) },
+       { 200, UINT64_C(1000000000000) },
+       { 500, UINT64_C(1000000000000) },
        /* nanoseconds */
        { 1, 1000000000 },
        { 2, 1000000000 },
@@ -676,8 +676,10 @@ SR_PRIV int lecroy_xstream_receive_data(int fd, int revents, void *cb_data)
        } else {
                /* Update sample rate if needed. */
                if (state->sample_rate == 0)
-                       if (lecroy_xstream_update_sample_rate(sdi, analog.num_samples) != SR_OK)
+                       if (lecroy_xstream_update_sample_rate(sdi, analog.num_samples) != SR_OK) {
+                               g_free(analog.data);
                                return SR_ERR;
+                       }
        }
 
        /*