ReactOS 0.4.16-dev-336-gb667d82
Sorter Class Reference

#include <sorter.h>

Inheritance diagram for Sorter:
Collaboration diagram for Sorter:

Public Member Functions

 Sorter (int es)
 
virtual ~Sorter ()
 
void qsort (void *a, int n)
 

Protected Member Functions

virtual int qscmp (char *, char *)
 
virtual void qsexc (char *i, char *j)
 
virtual void qstexc (char *i, char *j, char *k)
 

Private Member Functions

void qs1 (char *, char *)
 

Private Attributes

int es
 

Detailed Description

Definition at line 36 of file sorter.h.

Constructor & Destructor Documentation

◆ Sorter()

Sorter::Sorter ( int  es)

Definition at line 44 of file sorter.cc.

45{
46 es = _es;
47}
int es
Definition: sorter.h:49

◆ ~Sorter()

virtual Sorter::~Sorter ( )
inlinevirtual

Definition at line 39 of file sorter.h.

39{ /* silence warning*/ }

Member Function Documentation

◆ qs1()

void Sorter::qs1 ( char a,
char l 
)
private

Definition at line 77 of file sorter.cc.

78{
79 char *i, *j;
80 char *lp, *hp;
81 int c;
82 unsigned int n;
83
84start:
85 if((n=l-a) <= (unsigned int)es)
86 return;
87 n = es * (n / (2*es));
88 hp = lp = a+n;
89 i = a;
90 j = l-es;
91 while(1) {
92 if(i < lp) {
93 if((c = qscmp(i, lp)) == 0) {
94 qsexc(i, lp -= es);
95 continue;
96 }
97 if(c < 0) {
98 i += es;
99 continue;
100 }
101 }
102
103loop:
104 if(j > hp) {
105 if((c = qscmp(hp, j)) == 0) {
106 qsexc(hp += es, j);
107 goto loop;
108 }
109 if(c > 0) {
110 if(i == lp) {
111 qstexc(i, hp += es, j);
112 i = lp += es;
113 goto loop;
114 }
115 qsexc(i, j);
116 j -= es;
117 i += es;
118 continue;
119 }
120 j -= es;
121 goto loop;
122 }
123
124 if(i == lp) {
125 if(lp-a >= l-hp) {
126 qs1(hp+es, l);
127 l = lp;
128 } else {
129 qs1(a, lp);
130 a = hp+es;
131 }
132 goto start;
133 }
134
135 qstexc(j, lp -= es, i);
136 j = hp -= es;
137 }
138}
r l[0]
Definition: byte_order.h:168
virtual void qstexc(char *i, char *j, char *k)
Definition: sorter.cc:71
void qs1(char *, char *)
Definition: sorter.cc:77
virtual void qsexc(char *i, char *j)
Definition: sorter.cc:64
virtual int qscmp(char *, char *)
Definition: sorter.cc:56
GLuint start
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define a
Definition: ke_i.h:78
#define c
Definition: ke_i.h:80

Referenced by qs1(), and qsort().

◆ qscmp()

int Sorter::qscmp ( char ,
char  
)
protectedvirtual

Reimplemented in ArcSorter, ArcSdirSorter, ArcTdirSorter, and FlistSorter.

Definition at line 56 of file sorter.cc.

57{
58 _glu_dprintf( "Sorter::qscmp: pure virtual called\n" );
59 return 0;
60}

Referenced by qs1().

◆ qsexc()

void Sorter::qsexc ( char i,
char j 
)
protectedvirtual

Reimplemented in ArcSorter, and FlistSorter.

Definition at line 64 of file sorter.cc.

65{
66 _glu_dprintf( "Sorter::qsexc: pure virtual called\n" );
67}

Referenced by qs1().

◆ qsort()

void Sorter::qsort ( void a,
int  n 
)

Definition at line 50 of file sorter.cc.

51{
52 qs1( (char *)a, ((char *)a)+n*es);
53}

Referenced by ArcSorter::qsort(), and FlistSorter::qsort().

◆ qstexc()

void Sorter::qstexc ( char i,
char j,
char k 
)
protectedvirtual

Reimplemented in ArcSorter, and FlistSorter.

Definition at line 71 of file sorter.cc.

72{
73 _glu_dprintf( "Sorter::qstexc: pure virtual called\n" );
74}

Referenced by qs1().

Member Data Documentation

◆ es

int Sorter::es
private

Definition at line 49 of file sorter.h.

Referenced by qs1(), qsort(), and Sorter().


The documentation for this class was generated from the following files: