~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_qsort.cc

  • Committer: Monty Taylor
  • Date: 2009-01-09 19:40:29 UTC
  • mto: (779.1.4 devel)
  • mto: This revision was merged to the branch mainline in revision 784.
  • Revision ID: mordred@inaugust.com-20090109194029-vcic3m30e4uj0smj
General build cleanup - removed cruft, removed depreated checks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
/* The following stack size is enough for UINT32_MAX elements */
72
72
#define STACK_SIZE      (8 * sizeof(unsigned long int))
73
73
#define THRESHOLD_FOR_INSERT_SORT 10
74
 
#if defined(QSORT_TYPE_IS_VOID)
75
 
#define SORT_RETURN return
76
 
#else
77
 
#define SORT_RETURN return 0
78
 
#endif
79
74
 
80
75
/****************************************************************************
81
76
** 'standard' quicksort with the following extensions:
88
83
*****************************************************************************/
89
84
 
90
85
#ifdef QSORT_EXTRA_CMP_ARGUMENT
91
 
RETQSORTTYPE my_qsort2(void *base_ptr, size_t count, size_t size,
 
86
void my_qsort2(void *base_ptr, size_t count, size_t size,
92
87
                       qsort2_cmp cmp, void *cmp_argument)
93
88
#else
94
 
RETQSORTTYPE my_qsort(void *base_ptr, size_t count, size_t size,
 
89
void my_qsort(void *base_ptr, size_t count, size_t size,
95
90
                      qsort_cmp cmp)
96
91
#endif
97
92
{
101
96
  /* Handle the simple case first */
102
97
  /* This will also make the rest of the code simpler */
103
98
  if (count <= 1)
104
 
    SORT_RETURN;
 
99
    return;
105
100
 
106
101
  low  = (char*) base_ptr;
107
102
  high = low+ size * (count - 1);
210
205
    }
211
206
  } while (stack_ptr > stack);
212
207
  free(pivot);
213
 
  SORT_RETURN;
 
208
  return;
214
209
}