From: Uwe Hermann Date: Wed, 13 Jun 2012 16:58:24 +0000 (+0200) Subject: sr: hantek-dso: Use portable g_ntohs() function. X-Git-Tag: dsupstream~916 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=384c28d9e74791a753bd25e471d20d970ab2346b sr: hantek-dso: Use portable g_ntohs() function. The ntohs() from is not available on MinGW/Windows. There are ways to work around this, but as we use glib already, using g_ntohs() is the best option anyway. --- diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index c571caf8..1091ea90 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include "sigrok.h" diff --git a/hardware/hantek-dso/dso.c b/hardware/hantek-dso/dso.c index 8c6a6000..73dd8eb3 100644 --- a/hardware/hantek-dso/dso.c +++ b/hardware/hantek-dso/dso.c @@ -26,7 +26,6 @@ #include #include #include -#include extern libusb_context *usb_context; extern GSList *dev_insts; @@ -223,8 +222,8 @@ static int get_channel_offsets(struct context *ctx) */ for (chan = 0; chan < 2; chan++) { for (v = 0; v < 9; v++) { - ctx->channel_levels[chan][v][0] = ntohs(ctx->channel_levels[chan][v][0]); - ctx->channel_levels[chan][v][1] = ntohs(ctx->channel_levels[chan][v][1]); + ctx->channel_levels[chan][v][0] = g_ntohs(ctx->channel_levels[chan][v][0]); + ctx->channel_levels[chan][v][1] = g_ntohs(ctx->channel_levels[chan][v][1]); } }