Go to the documentation of this file.
52 #define UT_SORT_FUNCTION_BODY(SORT_FUN, ARR, AUX_ARR, LOW, HIGH, CMP_FUN)\
57 ulint ut_sort_high77;\
59 ut_ad((LOW) < (HIGH));\
63 if ((LOW) == (HIGH) - 1) {\
65 } else if ((LOW) == (HIGH) - 2) {\
66 if (CMP_FUN((ARR)[LOW], (ARR)[(HIGH) - 1]) > 0) {\
67 (AUX_ARR)[LOW] = (ARR)[LOW];\
68 (ARR)[LOW] = (ARR)[(HIGH) - 1];\
69 (ARR)[(HIGH) - 1] = (AUX_ARR)[LOW];\
74 ut_sort_mid77 = ((LOW) + (HIGH)) / 2;\
76 SORT_FUN((ARR), (AUX_ARR), (LOW), ut_sort_mid77);\
77 SORT_FUN((ARR), (AUX_ARR), ut_sort_mid77, (HIGH));\
79 ut_sort_low77 = (LOW);\
80 ut_sort_high77 = ut_sort_mid77;\
82 for (ut_sort_i77 = (LOW); ut_sort_i77 < (HIGH); ut_sort_i77++) {\
84 if (ut_sort_low77 >= ut_sort_mid77) {\
85 (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_high77];\
87 } else if (ut_sort_high77 >= (HIGH)) {\
88 (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_low77];\
90 } else if (CMP_FUN((ARR)[ut_sort_low77],\
91 (ARR)[ut_sort_high77]) > 0) {\
92 (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_high77];\
95 (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_low77];\
100 memcpy((void*) ((ARR) + (LOW)), (AUX_ARR) + (LOW),\
101 ((HIGH) - (LOW)) * sizeof *(ARR));\