]> sigrok.org Git - libsigrok.git/commitdiff
baylibre-acme: Fix a compiler warning.
authorUwe Hermann <redacted>
Mon, 16 Feb 2015 00:51:53 +0000 (01:51 +0100)
committerUwe Hermann <redacted>
Mon, 16 Feb 2015 00:57:35 +0000 (01:57 +0100)
Use PRIu64 to avoid the following compiler warning:

    CC       src/hardware/baylibre-acme/gpio.lo
  protocol.c: In function 'bl_acme_set_shunt':
  protocol.c:341:2: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Wformat=]
    g_fprintf(fd, "%llu\n", MOHM_TO_UOHM(shunt));
    ^

src/hardware/baylibre-acme/protocol.c

index 66a22ad4ffe0e93b4f2f0bcd9017dc3c80e0a7f9..e7f1ede1faf04d80133c2e3b49140c732b056484 100644 (file)
@@ -334,7 +334,7 @@ SR_PRIV int bl_acme_set_shunt(const struct sr_channel_group *cg, uint64_t shunt)
        }
 
        g_string_free(path, TRUE);
-       g_fprintf(fd, "%llu\n", MOHM_TO_UOHM(shunt));
+       g_fprintf(fd, "%" PRIu64 "\n", MOHM_TO_UOHM(shunt));
        /*
         * XXX There's no g_fclose() in GLib. This seems to work,
         * but is it safe?