]> sigrok.org Git - libsigrok.git/commitdiff
sr: fx2lafw: Use gboolean, cosmetics, fix gcc warning.
authorUwe Hermann <redacted>
Thu, 31 May 2012 20:46:28 +0000 (22:46 +0200)
committerUwe Hermann <redacted>
Thu, 31 May 2012 20:48:40 +0000 (22:48 +0200)
hardware/fx2lafw/command.c
hardware/fx2lafw/command.h
hardware/fx2lafw/fx2lafw.c
hardware/fx2lafw/fx2lafw.h

index 7053ce4289c19c278f7c91804eb52148ecabc16a..9bd634b51a283e63a0cac8e36b7976bc01d9f5d1 100644 (file)
@@ -59,16 +59,15 @@ SR_PRIV int command_get_revid_version(libusb_device_handle *devhdl,
 }
 
 SR_PRIV int command_start_acquisition(libusb_device_handle *devhdl,
-                                     uint64_t samplerate,
-                                     bool samplewide)
+                                     uint64_t samplerate, gboolean samplewide)
 {
        struct cmd_start_acquisition cmd;
        int delay = 0, ret;
 
        /* Compute the sample rate. */
-       if(samplewide && samplerate > MAX_16BIT_SAMPLE_RATE) {
+       if (samplewide && samplerate > MAX_16BIT_SAMPLE_RATE) {
                sr_err("fx2lafw: Unable to sample at %" PRIu64 "Hz "
-                       "when collecting 16-bit samples.", samplerate);
+                      "when collecting 16-bit samples.", samplerate);
                return SR_ERR;
        }
 
index 682ccbaf28aa6d5df8aeedd524022351a361dccd..37f965cc42e7338175adf73665229217f55bc6bd 100644 (file)
@@ -20,8 +20,7 @@
 #ifndef LIBSIGROK_HARDWARE_FX2LAFW_COMMAND_H
 #define LIBSIGROK_HARDWARE_FX2LAFW_COMMAND_H
 
-#include <stdbool.h>
-
+#include <glib.h>
 #include "sigrok.h"
 
 /* Protocol commands */
@@ -58,7 +57,6 @@ SR_PRIV int command_get_fw_version(libusb_device_handle *devhdl,
 SR_PRIV int command_get_revid_version(libusb_device_handle *devhdl,
                                      uint8_t *revid);
 SR_PRIV int command_start_acquisition(libusb_device_handle *devhdl,
-                                     uint64_t samplerate,
-                                     bool samplewide);
+                                     uint64_t samplerate, gboolean samplewide);
 
 #endif
index 2c0c6360164a70f37a59aedd93950a154dec298a..aa8331f182b3d24905b104fbbc769df18a4454a5 100644 (file)
@@ -328,7 +328,7 @@ static int configure_probes(struct context *ctx, GSList *probes)
                        continue;
 
                if (probe->index > 8)
-                       ctx->sample_wide = true;
+                       ctx->sample_wide = TRUE;
 
                probe_bit = 1 << (probe->index - 1);
                if (!(probe->trigger))
@@ -794,7 +794,7 @@ static void receive_transfer(struct libusb_transfer *transfer)
 
        if (ctx->trigger_stage == TRIGGER_FIRED) {
                /* Send the incoming transfer to the session bus. */
-               const trigger_offset_bytes = trigger_offset * sample_width;
+               const int trigger_offset_bytes = trigger_offset * sample_width;
                packet.type = SR_DF_LOGIC;
                packet.payload = &logic;
                logic.length = transfer->actual_length - trigger_offset_bytes;
index c8a1d929380bf1f5fb8ef504a42fbee2e7166884..c6ad3ce11d28afb87fcb4f90e8fffd6d7536e71b 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 #include <glib.h>
-#include <stdbool.h>
 
 #ifndef LIBSIGROK_HARDWARE_FX2LAFW_FX2LAFW_H
 #define LIBSIGROK_HARDWARE_FX2LAFW_FX2LAFW_H
@@ -76,7 +75,7 @@ struct context {
        uint64_t cur_samplerate;
        uint64_t limit_samples;
 
-       bool sample_wide;
+       gboolean sample_wide;
 
        uint16_t trigger_mask[NUM_TRIGGER_STAGES];
        uint16_t trigger_value[NUM_TRIGGER_STAGES];