From c36923b03b343bcdbda55e5167a36e1c63b527a7 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Fri, 27 Dec 2013 17:29:03 +0100 Subject: [PATCH] asix-sigma: fix incorrect pointer cast (non-aligned memory and endiannes issue) This fixes the following warning: asix-sigma.c: In function 'receive_data': asix-sigma.c:1064:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] devc->state.lastts = *(uint16_t *) buf - 1; ^ --- hardware/asix-sigma/asix-sigma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 70a9d773..a7a1d46a 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -1061,7 +1061,7 @@ static int receive_data(int fd, int revents, void *cb_data) /* Find first ts. */ if (devc->state.chunks_downloaded == 0) { - devc->state.lastts = *(uint16_t *) buf - 1; + devc->state.lastts = RL16(buf) - 1; devc->state.lastsample = 0; }