diff options
| author | Rasmus Lerdorf <rasmus@php.net> | 2001-06-06 13:06:12 +0000 |
|---|---|---|
| committer | Rasmus Lerdorf <rasmus@php.net> | 2001-06-06 13:06:12 +0000 |
| commit | 81e2cf03ac62c29c6bb365c31b9229aa3b4deff8 (patch) | |
| tree | a0680a82219899445723cc36b058d9c4d263e17f /main/mergesort.c | |
| parent | 3bfd50f4f1dedb756c4e45566e2f8e172ab435ec (diff) | |
| download | php-git-81e2cf03ac62c29c6bb365c31b9229aa3b4deff8.tar.gz | |
Fix folding and clean up some extensions
Diffstat (limited to 'main/mergesort.c')
| -rw-r--r-- | main/mergesort.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/main/mergesort.c b/main/mergesort.c index b73b67773b..73c65c5100 100644 --- a/main/mergesort.c +++ b/main/mergesort.c @@ -97,7 +97,7 @@ static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const voi ((u_char *)0 + \ (((u_char *)p + PSIZE - 1 - (u_char *) 0) & ~(PSIZE - 1))) -/* +/* {{{ php_mergesort * Arguments are as for qsort. */ int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const void *, const void *)) @@ -233,6 +233,7 @@ COPY: b = t; free(list2); return (0); } +/* }}} */ #define swap(a, b) { \ s = b; \ @@ -253,7 +254,7 @@ COPY: b = t; } while(bot < s); \ } -/* +/* {{{ setup * Optional hybrid natural/pairwise first pass. Eats up list1 in runs of * increasing order, list2 in a corresponding linked list. Checks for runs * when THRESHOLD/2 pairs compare with same sense. (Only used when NATURAL @@ -324,8 +325,9 @@ static void setup(u_char *list1, u_char *list2, size_t n, size_t size, int (*cmp } #endif /* NATURAL */ } +/* }}} */ -/* +/* {{{ insertionsort * This is to avoid out-of-bounds addresses in sorting the * last 4 elements. */ @@ -342,11 +344,13 @@ static void insertionsort(u_char *a, size_t n, size_t size, int (*cmp)(const voi swap(u, t); } } +/* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: - * vim: sw=4 ts=4 tw=78 fdm=marker + * vim600: sw=4 ts=4 tw=78 fdm=marker + * vim<600: sw=4 ts=4 tw=78 */ |
