fix compiler warnings

remotes/origin/HEAD
Anoop Saldanha 13 years ago committed by Victor Julien
parent af4e480163
commit a8095bd8d6

@ -363,6 +363,7 @@ static int TmqhOutputFlowSetupCtxTest01(void)
{ {
int retval = 0; int retval = 0;
Tmq *tmq = NULL; Tmq *tmq = NULL;
TmqhFlowCtx *fctx = NULL;
TmqResetQueues(); TmqResetQueues();
@ -385,7 +386,7 @@ static int TmqhOutputFlowSetupCtxTest01(void)
if (ctx == NULL) if (ctx == NULL)
goto end; goto end;
TmqhFlowCtx *fctx = (TmqhFlowCtx *)ctx; fctx = (TmqhFlowCtx *)ctx;
if (fctx->size != 4) if (fctx->size != 4)
goto end; goto end;
@ -414,6 +415,7 @@ static int TmqhOutputFlowSetupCtxTest02(void)
{ {
int retval = 0; int retval = 0;
Tmq *tmq = NULL; Tmq *tmq = NULL;
TmqhFlowCtx *fctx = NULL;
TmqResetQueues(); TmqResetQueues();
@ -436,7 +438,7 @@ static int TmqhOutputFlowSetupCtxTest02(void)
if (ctx == NULL) if (ctx == NULL)
goto end; goto end;
TmqhFlowCtx *fctx = (TmqhFlowCtx *)ctx; fctx = (TmqhFlowCtx *)ctx;
if (fctx->size != 1) if (fctx->size != 1)
goto end; goto end;
@ -458,6 +460,7 @@ end:
static int TmqhOutputFlowSetupCtxTest03(void) static int TmqhOutputFlowSetupCtxTest03(void)
{ {
int retval = 0; int retval = 0;
TmqhFlowCtx *fctx = NULL;
TmqResetQueues(); TmqResetQueues();
@ -467,7 +470,7 @@ static int TmqhOutputFlowSetupCtxTest03(void)
if (ctx == NULL) if (ctx == NULL)
goto end; goto end;
TmqhFlowCtx *fctx = (TmqhFlowCtx *)ctx; fctx = (TmqhFlowCtx *)ctx;
if (fctx->size != 4) if (fctx->size != 4)
goto end; goto end;

@ -290,7 +290,6 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
u.ptr = key; u.ptr = key;
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
const uint8_t *k8;
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
while (length > 12) while (length > 12)
@ -334,7 +333,8 @@ uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
#else /* make valgrind happy */ #else /* make valgrind happy */
k8 = (const uint8_t *)k; const uint8_t *k8 = (const uint8_t *)k;
switch(length) switch(length)
{ {
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
@ -475,7 +475,6 @@ void hashlittle2(
u.ptr = key; u.ptr = key;
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
const uint8_t *k8;
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
while (length > 12) while (length > 12)
@ -519,7 +518,7 @@ void hashlittle2(
#else /* make valgrind happy */ #else /* make valgrind happy */
k8 = (const uint8_t *)k; const uint8_t *k8 = (const uint8_t *)k;
switch(length) switch(length)
{ {
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
@ -652,7 +651,6 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval)
u.ptr = key; u.ptr = key;
if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) { if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
const uint8_t *k8;
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
while (length > 12) while (length > 12)
@ -696,7 +694,7 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval)
#else /* make valgrind happy */ #else /* make valgrind happy */
k8 = (const uint8_t *)k; const uint8_t *k8 = (const uint8_t *)k;
switch(length) /* all the case statements fall through */ switch(length) /* all the case statements fall through */
{ {
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;

Loading…
Cancel
Save