summaryrefslogtreecommitdiff
path: root/bits.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2008-07-08 07:14:53 +0000
committerEric S. Raymond <esr@thyrsus.com>2008-07-08 07:14:53 +0000
commit1819dabea9232eee3f7d70888da3d804bd403690 (patch)
treecc12e0af72098d8db4a9d711af68ebdfe63e3e3e /bits.h
parentca3b1e3a1d85885548cd124ef76b2f4ae0e8003f (diff)
downloadgpsd-1819dabea9232eee3f7d70888da3d804bd403690.tar.gz
Fix unclean references to the packet output buffer from bits.h.
Diffstat (limited to 'bits.h')
-rw-r--r--bits.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/bits.h b/bits.h
index 8bdae448..5cc98920 100644
--- a/bits.h
+++ b/bits.h
@@ -75,11 +75,11 @@ union long_double {
/* Zodiac protocol description uses 1-origin indexing by little-endian word */
-#define getword(n) ( (session->packet.outbuffer[2*(n)-2]) \
- | (session->packet.outbuffer[2*(n)-1] << 8))
-#define getlong(n) ( (session->packet.outbuffer[2*(n)-2]) \
- | (session->packet.outbuffer[2*(n)-1] << 8) \
- | (session->packet.outbuffer[2*(n)+0] << 16) \
- | (session->packet.outbuffer[2*(n)+1] << 24))
-#define getstring(t, s, e) \
- (void)memcpy(t, session->packet.outbuffer+2*(s)-2, 2*((e)-(s)+1))
+#define getwordz(buf, n) ( (buf[2*(n)-2]) \
+ | (buf[2*(n)-1] << 8))
+#define getlongz(buf, n) ( (buf[2*(n)-2]) \
+ | (buf[2*(n)-1] << 8) \
+ | (buf[2*(n)+0] << 16) \
+ | (buf[2*(n)+1] << 24))
+#define getstringz(to, from, s, e) \
+ (void)memcpy(to, from+2*(s)-2, 2*((e)-(s)+1))