From 9df8909948bb491b1b8c53ff8e1b5ce125304aac Mon Sep 17 00:00:00 2001 From: Daniel Brahneborg Date: Sat, 2 Mar 2002 23:28:39 +0000 Subject: Various proto changes. --- lib/sistypes.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/sistypes.cpp') 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" }, -- cgit v1.2.3