From 37438ca202a9a1f4e782f1d1803686fc6b65e918 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 12 Nov 2008 23:25:26 +0000 Subject: Move static function prototypes from nbench1.h to appropriate files git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@14 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- stringsort.c | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) (limited to 'stringsort.c') diff --git a/stringsort.c b/stringsort.c index 5d7c67d..7670dea 100644 --- a/stringsort.c +++ b/stringsort.c @@ -1,21 +1,45 @@ -#include -/*#include +#include #include -#include -#include -#include */ +#include +#include +#include + #include "nmglobal.h" #include "nbench1.h" -#ifdef DEBUG -static int numsort_status=0; -static int stringsort_status=0; -#endif /******************** ** STRING HEAPSORT ** ********************/ +static unsigned long DoStringSortIteration(unsigned char *arraybase, + unsigned int numarrays, + unsigned long arraysize); +static unsigned long *LoadStringArray(unsigned char *strarray, + unsigned int numarrays, + unsigned long *strings, + unsigned long arraysize); +static void stradjust(unsigned long *optrarray, + unsigned char *strarray, + unsigned long nstrings, + unsigned long i, + unsigned char l); +static void StrHeapSort(unsigned long *optrarray, + unsigned char *strarray, + unsigned long numstrings, + unsigned long bottom, + unsigned long top); +static int str_is_less(unsigned long *optrarray, + unsigned char *strarray, + unsigned long numstrings, + unsigned long a, + unsigned long b); +static void strsift(unsigned long *optrarray, + unsigned char *strarray, + unsigned long numstrings, + unsigned long i, + unsigned long j); + /***************** ** DoStringSort ** ****************** @@ -504,18 +528,18 @@ slen=strncmp((char *)(strarray+*(optrarray+a)), if(slen==0) { /* - ** They match. Return true if the length of a + ** They match. Return TRUE if the length of a ** is greater than the length of b. */ if(*(strarray+*(optrarray+a)) > *(strarray+*(optrarray+b))) - return(TRUE); - return(FALSE); + return TRUE; + return FALSE; } -if(slen<0) return(TRUE); /* a is strictly less than b */ +if(slen<0) return TRUE; /* a is strictly less than b */ -return(FALSE); /* Only other possibility */ +return FALSE; /* Only other possibility */ } /************ -- cgit v1.2.3