diff options
author | Chris Kuethe <ckuethe@users.berlios.de> | 2010-12-25 23:53:27 -0600 |
---|---|---|
committer | Chris Kuethe <ckuethe@users.berlios.de> | 2010-12-25 23:53:27 -0600 |
commit | 1ebbebbbf0b83b6904d17db2590af295ec674601 (patch) | |
tree | 8519116321ec3deb3e2e9f09dbaf862de19a7656 /driver_proto.c | |
parent | c7e9d8622b4b3a6fa9f87a6b0d955d99245d73cf (diff) | |
download | gpsd-1ebbebbbf0b83b6904d17db2590af295ec674601.tar.gz |
sizeof(long) is not portable
More Commits from the Caribbean.
The geostar driver operates on 4-byte words, so change increments to 4 bytes.
Add a note to the prototype driver and the hacking guide to indicate that the
sizeof(<std int type>) should be avoided for extracting fixed size blocks from
a packet.
Diffstat (limited to 'driver_proto.c')
-rw-r--r-- | driver_proto.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/driver_proto.c b/driver_proto.c index d3d8982c..33470304 100644 --- a/driver_proto.c +++ b/driver_proto.c @@ -12,7 +12,9 @@ * messages that gpsd needs. Some protocols transmit error estimates * separately from the navigation solution; if developing a driver for * such a protocol you will need to add a decoder function for that - * message. + * message. Be extra careful when using sizeof(<type>) to extract part + * of packets (ie. don't do it). This idiom creates portability problems + * between 32 and 64 bit systems. * * For anyone hacking this driver skeleton: "_PROTO_" and "_proto_" are now * reserved tokens. We suggest that they only ever be used as prefixes, |