]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/sysclk-lwla/protocol.c
windows: Fix various compiler warnings.
[libsigrok.git] / src / hardware / sysclk-lwla / protocol.c
index 7b8c4885e5608dfd6e7c311953d018229a0b210e..894c8efeb802990a5d409b704043dadf10686d75 100644 (file)
@@ -17,8 +17,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "protocol.h"
 #include <string.h>
+#include "protocol.h"
 
 /* Bit mask for the RLE repeat-count-follows flag. */
 #define RLE_FLAG_LEN_FOLLOWS ((uint64_t)1 << 35)
@@ -134,7 +134,7 @@ static int capture_setup(const struct sr_dev_inst *sdi)
        /* Fill remaining 64-bit words with zeroes. */
        memset(&command[27], 0, 16 * sizeof(uint16_t));
 
-       return lwla_send_command(sdi->conn, command, G_N_ELEMENTS(command));
+       return lwla_send_command(sdi->conn, command, ARRAY_SIZE(command));
 }
 
 /* Issue a register write command as an asynchronous USB transfer.
@@ -604,7 +604,7 @@ static void end_acquisition(struct sr_dev_inst *sdi)
 
 /* USB output transfer completion callback.
  */
-static void receive_transfer_out(struct libusb_transfer *transfer)
+static void LIBUSB_CALL receive_transfer_out(struct libusb_transfer *transfer)
 {
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
@@ -658,7 +658,7 @@ static void receive_transfer_out(struct libusb_transfer *transfer)
 
 /* USB input transfer completion callback.
  */
-static void receive_transfer_in(struct libusb_transfer *transfer)
+static void LIBUSB_CALL receive_transfer_in(struct libusb_transfer *transfer)
 {
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
@@ -894,7 +894,7 @@ SR_PRIV int lwla_setup_acquisition(const struct sr_dev_inst *sdi)
        regvals[6].reg = REG_DIV_BYPASS;
        regvals[6].val = acq->bypass_clockdiv;
 
-       ret = lwla_write_regs(usb, regvals, G_N_ELEMENTS(regvals));
+       ret = lwla_write_regs(usb, regvals, ARRAY_SIZE(regvals));
        if (ret != SR_OK)
                return ret;