]> sigrok.org Git - libsigrok.git/commitdiff
asix-sigma: fix build time warnings
authorMike Frysinger <redacted>
Sat, 14 Jun 2014 02:44:40 +0000 (22:44 -0400)
committerBert Vermeulen <redacted>
Sun, 15 Jun 2014 08:45:39 +0000 (10:45 +0200)
We need to include unistd.h for usleep():
hardware/asix-sigma/asix-sigma.c: In function 'sigma_fpga_init_bitbang':
hardware/asix-sigma/asix-sigma.c:450:3: warning: implicit declaration of function 'usleep'
   usleep(10000);

And we need to tweak the type of chunks_per_read to match dl_lines_total:
hardware/asix-sigma/asix-sigma.c: In function 'download_capture':
hardware/asix-sigma/asix-sigma.c:1161:39: warning: comparison between signed and unsigned integer expressions
   dl_lines_curr = MIN(chunks_per_read, dl_lines_total);

hardware/asix-sigma/asix-sigma.c

index 26792a41aba82b7816ff0875af2f647f5291011e..747d5f0cdee09122e15c7405b7c3980f65609a55 100644 (file)
@@ -27,6 +27,7 @@
 #include <glib/gstdio.h>
 #include <ftdi.h>
 #include <string.h>
+#include <unistd.h>
 #include "libsigrok.h"
 #include "libsigrok-internal.h"
 #include "asix-sigma.h"
@@ -1113,7 +1114,7 @@ static int decode_chunk_ts(struct sigma_dram_line *dram_line,
 static int download_capture(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc = sdi->priv;
-       const int chunks_per_read = 32;
+       const uint32_t chunks_per_read = 32;
        struct sigma_dram_line *dram_line;
        int bufsz;
        uint32_t stoppos, triggerpos;