diff options
author | Daniel Brahneborg <basic@chello.se> | 2002-03-04 14:31:16 +0000 |
---|---|---|
committer | Daniel Brahneborg <basic@chello.se> | 2002-03-04 14:31:16 +0000 |
commit | dbfc3ee2b91ed26eb00e85a32c715995f4fce41b (patch) | |
tree | 82605dba9b7a1d14c3e952af32bef2852d60703b /lib/sistypes.cpp | |
parent | b68ab4b0002aa0c59fdbbfee3076e35aeac44d68 (diff) | |
download | plptools-dbfc3ee2b91ed26eb00e85a32c715995f4fce41b.tar.gz plptools-dbfc3ee2b91ed26eb00e85a32c715995f4fce41b.tar.bz2 plptools-dbfc3ee2b91ed26eb00e85a32c715995f4fce41b.zip |
Use plp standard types.
Fix copyright include.
Diffstat (limited to 'lib/sistypes.cpp')
-rw-r--r-- | lib/sistypes.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sistypes.cpp b/lib/sistypes.cpp index 2dd8b61..2777b20 100644 --- a/lib/sistypes.cpp +++ b/lib/sistypes.cpp @@ -40,33 +40,33 @@ void createCRCTable() } } -uint16 updateCrc(uint16 crc, uchar value) +uint16_t updateCrc(uint16_t crc, uint8_t value) { return (crc << 8) ^ s_crcTable[((crc >> 8) ^ value) & 0xff]; } -uint16 calcCRC(uchar* data, int len) +uint16_t calcCRC(uint8_t* data, int len) { - uint16 crc = 0; + uint16_t crc = 0; for (int i = 0; i < len; ++i) { - uchar value = data[i]; + uint8_t value = data[i]; crc = (crc << 8) ^ s_crcTable[((crc >> 8) ^ value) & 0xff]; } return crc; } -uint16 read16(uchar* p) +uint16_t read16(uint8_t* p) { return p[0] | (p[1] << 8); } -uint32 read32(uchar* p) +uint32_t read32(uint8_t* p) { return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); } -void write16(uchar* p, int val) +void write16(uint8_t* p, int val) { p[0] = val & 255; p[1] = (val >> 8) & 255; |