diff options
author | Daniel Brahneborg <basic@chello.se> | 2002-03-02 23:28:39 +0000 |
---|---|---|
committer | Daniel Brahneborg <basic@chello.se> | 2002-03-02 23:28:39 +0000 |
commit | 9df8909948bb491b1b8c53ff8e1b5ce125304aac (patch) | |
tree | 239befaacb77374dfd9c61ed45d592259bb969b0 /lib/sistypes.cpp | |
parent | 6f49fd782b8935b8caf7cea7bcb6e10644851b13 (diff) | |
download | plptools-9df8909948bb491b1b8c53ff8e1b5ce125304aac.tar.gz plptools-9df8909948bb491b1b8c53ff8e1b5ce125304aac.tar.bz2 plptools-9df8909948bb491b1b8c53ff8e1b5ce125304aac.zip |
Various proto changes.
Diffstat (limited to 'lib/sistypes.cpp')
-rw-r--r-- | lib/sistypes.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/sistypes.cpp b/lib/sistypes.cpp index 74ae5ea..eb23e5e 100644 --- a/lib/sistypes.cpp +++ b/lib/sistypes.cpp @@ -35,20 +35,22 @@ uint16 calcCRC(uchar* data, int len) return crc; } -uint16 read16(uchar* buf, int* ix) +uint16 read16(uchar* p) { - uchar* p = buf + *ix; - *ix += 2; return p[0] | (p[1] << 8); } -uint32 read32(uchar* buf, int* ix) +uint32 read32(uchar* p) { - uchar* p = buf + *ix; - *ix += 4; return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); } +void write16(uchar* p, int val) +{ + p[0] = val & 255; + p[1] = (val >> 8) & 255; +} + LangTableEntry langTable[] = { { 0, "", "Test" }, |