From d1cfc560073dbe5bfcaa412b4fea16d6831e743e Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 24 Jul 2013 22:18:59 +0000 Subject: cleanup - declare qsort comparison routines as such git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1980 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pamsistoaglyph.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'editor/pamsistoaglyph.c') diff --git a/editor/pamsistoaglyph.c b/editor/pamsistoaglyph.c index 9866b7bd..6b093520 100644 --- a/editor/pamsistoaglyph.c +++ b/editor/pamsistoaglyph.c @@ -247,12 +247,19 @@ findRegionEyeSeparation( gray ** const grayArray, +#ifndef LITERAL_FN_DEF_MATCH +static qsort_comparison_fn compareInts; +#endif + static int -compare_ints( const void * const firstP, - const void * const secondP ) { +compareInts(const void * const a, + const void * const b) { + + const int * const firstP = a; + const int * const secondP = b; - int const first = *(int *)firstP; - int const second = *(int *)secondP; + int const first = *firstP; + int const second = *secondP; int retval; @@ -311,7 +318,7 @@ findEyeSeparation( struct pam * const pamP, rowSeparation[numValidRows++] = sep; } if (numValidRows > 0) { - qsort( rowSeparation, numValidRows, sizeof(int), compare_ints ); + qsort(rowSeparation, numValidRows, sizeof(int), compareInts); bestSeparation = rowSeparation[numValidRows/2]; } free( rowSeparation ); -- cgit 1.4.1