29ac3bf8cad6b3b2f475a00215101cf5c8e88a3c markd Sun Mar 6 22:40:00 2011 -0800 used inline function and memset for zeroing memory to give optimizer a chance diff --git src/inc/common.h src/inc/common.h index 66316c9..770764a 100644 --- src/inc/common.h +++ src/inc/common.h @@ -305,32 +305,35 @@ #if defined(__GNUC__) __attribute__((format(printf, 2, 3))) #endif ; void verboseDot(); /* Write I'm alive dot (at verbosity level 1) */ int verboseLevel(); /* Get verbosity level. */ void verboseSetLevel(int verbosity); /* Set verbosity level in log. 0 for no logging, * higher number for increasing verbosity. */ -void zeroBytes(void *vpt, int count); +INLINE void zeroBytes(void *vpt, int count) /* fill a specified area of memory with zeroes */ +{ +memset(vpt, '\0', count); +} #define ZeroVar(v) zeroBytes(v, sizeof(*v)) void reverseBytes(char *bytes, long length); /* Reverse the order of the bytes. */ void reverseInts(int *a, int length); /* Reverse the order of the integer array. */ void reverseUnsigned(unsigned *a, int length); /* Reverse the order of the unsigned array. */ void reverseDoubles(double *a, int length); /* Reverse the order of the double array. */