diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-07-08 00:50:44 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-07-08 00:50:44 +0000 |
commit | 38f1186c1ad2a9481a67923c3a47c74ee5b54a48 (patch) | |
tree | 370a17340cef21fa794379471714d24fc8211bb2 /bits.h | |
parent | a66ab7e852bb78a2f0521b49fc0ff8d3d28d6678 (diff) | |
download | gpsd-38f1186c1ad2a9481a67923c3a47c74ee5b54a48.tar.gz |
USED_SET needs to be a separate mask from SATELLITES_SET...
...because the NMEA driver sets them in different places. Add
satellite-picture parsing to Evermore driver.
Diffstat (limited to 'bits.h')
-rw-r--r-- | bits.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -32,8 +32,8 @@ union long_double { #endif /* SiRF and most other GPS protocols use big-endian (network byte order) */ -#define getsb(buf, off) ((int8_t)buf[GET_ORIGIN+(off)]) -#define getub(buf, off) ((u_int8_t)buf[GET_ORIGIN+(off)]) +#define getsb(buf, off) ((int8_t)buf[(off)-(GET_ORIGIN)]) +#define getub(buf, off) ((u_int8_t)buf[(off)-(GET_ORIGIN)]) #define getsw(buf, off) ((int16_t)(((u_int16_t)getub(buf, off) << 8) | (u_int16_t)getub(buf, off+1))) #define getuw(buf, off) ((u_int16_t)(((u_int16_t)getub(buf, off) << 8) | (u_int16_t)getub(buf, off+1))) #define getsl(buf, off) ((int32_t)(((u_int16_t)getuw(buf, off) << 16) | getuw(buf, off+2))) @@ -43,7 +43,7 @@ union long_double { #define getf(buf, off) (i_f.i = getsl(buf, off), i_f.f) #define getd(buf, off) (l_d.l = getsL(buf, off), l_d.d) -#define putbyte(buf,off,b) {buf[PUT_ORIGIN+(off)] = (unsigned char)(b);} +#define putbyte(buf,off,b) {buf[(off)-(PUT_ORIGIN)] = (unsigned char)(b);} #define putword(buf,off,w) {putbyte(buf,off,(w) >> 8); putbyte(buf,off+1,w);} #define putlong(buf,off,l) {putword(buf,off,(l) >> 16); putword(buf,off+2,l);} |