HermesCommon  3.0
qsort.cpp File Reference

The QuickSort routine from glibc-2.5 modified for sorting int arrays. More...

#include "qsort.h"
#include <limits.h>
#include <algorithm>
#include <stdlib.h>

Go to the source code of this file.

Classes

class  stack_node< intType >
 

Macros

#define SWAP(a, b)   { int c = *(a); *(a) = *(b); *(b) = c; }
 
#define MAX_THRESH   4
 
#define STACK_SIZE   (CHAR_BIT * sizeof(size_t))
 
#define PUSH(low, high)   ((void) ((top->lo = (low)), (top->hi = (high)), ++top))
 
#define POP(low, high)   ((void) (--top, (low = top->lo), (high = top->hi)))
 
#define STACK_NOT_EMPTY   (stack < top)
 
#define min(x, y)   ((x) < (y) ? (x) : (y))
 

Functions

template<typename intType >
void qsort_int (intType *pbase, size_t total_elems)
 
template void qsort_int (int *pbase, size_t total_elems)
 

Detailed Description

The QuickSort routine from glibc-2.5 modified for sorting int arrays.

Definition in file qsort.cpp.