sr: hantek-dso: Use portable g_ntohs() function.

The ntohs() from <arpa/inet.h> 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.
This commit is contained in:
Uwe Hermann 2012-06-13 18:58:24 +02:00
parent c5841b2809
commit 384c28d9e7
2 changed files with 2 additions and 4 deletions

View File

@ -27,7 +27,6 @@
#include <string.h>
#include <sys/time.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include <glib.h>
#include <libusb.h>
#include "sigrok.h"

View File

@ -26,7 +26,6 @@
#include <string.h>
#include <glib.h>
#include <libusb.h>
#include <arpa/inet.h>
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]);
}
}