Author: tjansen Date: Wed Nov 11 14:10:32 2009 New Revision: 1640 Log: pisa_csum_fold should return pisa_csum16 rather than uint16_t. Also added a TODO item. Modified: trunk/libpisa/checksum.h Modified: trunk/libpisa/checksum.h ============================================================================== --- trunk/libpisa/checksum.h Wed Nov 11 12:38:05 2009 (r1639) +++ trunk/libpisa/checksum.h Wed Nov 11 14:10:32 2009 (r1640) @@ -13,6 +13,8 @@ #ifndef PISA_CHECKSUM_H #define PISA_CHECKSUM_H +/* TODO: needs to include a header for uint{16,32}_t to be selfcontained */ + typedef uint16_t pisa_csum16; typedef uint32_t pisa_csum32; @@ -21,7 +23,7 @@ * @param c checksum that will be folded * @return folded checksum (16 bit) */ -static inline uint16_t pisa_csum_fold(pisa_csum32 c) +static inline pisa_csum16 pisa_csum_fold(pisa_csum32 c) { while (c >> 16) c = (c & 0xffff) + (c >> 16);