From da81328d7548e13a0f0bd4babf9f1bc5f80a9ffc Mon Sep 17 00:00:00 2001 From: axel Date: Sun, 22 Oct 2006 08:59:00 +1000 Subject: [PATCH] Fix warning messages in fish_tests darcs-hash:20061021225900-ac50b-992edf0914250ae090ef952717ef3a05cb9cfa6e.gz --- fish_tests.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/fish_tests.c b/fish_tests.c index e0a23d6ff..31ea2b049 100644 --- a/fish_tests.c +++ b/fish_tests.c @@ -88,14 +88,6 @@ static void err( wchar_t *blah, ... ) wprintf( L"\n" ); } -/** - Print ok message -*/ -static void ok() -{ - wprintf( L"OK\n" ); -} - /** Compare two pointers */ @@ -120,7 +112,7 @@ static void pq_test( int elements ) for( i=0; i prev ) err( L"Wrong order of elements in priority_queue_t" ); @@ -201,7 +193,7 @@ static int hash_func( void *data ) /* srand( (int)data ); return rand(); */ - int foo = (int)data; + int foo = (int)(long)data; return 127*((foo^0xefc7e214)) ^(foo<<11); } @@ -217,9 +209,9 @@ static int compare_func( void *key1, void *key2 ) /** Hashtable test */ -static int hash_test( int elements ) +static int hash_test( long elements ) { - int i; + long i; int res=1; hash_table_t h; @@ -228,17 +220,17 @@ static int hash_test( int elements ) for( i=1; i< elements+1; i++ ) { - hash_put( &h, (void*)i, (void*)100-i ); + hash_put( &h, (void*)i, (void*)100l-i ); } for( i=1; i< elements+1; i++ ) { - if( (int)hash_get( &h, (void*)i ) != (100-i) ) + if( (long)hash_get( &h, (void*)i ) != (100l-i) ) { err( L"Key %d gave data %d, expected data %d", i, - (int)hash_get( &h, (void*)i ), - 100-i ); + (long)hash_get( &h, (void*)i ), + 100l-i ); res = 0; break; @@ -271,7 +263,7 @@ static int hash_test( int elements ) for( i=1; i