Cube  Diff

Differences From Artifact [fd4e5832e2]:

To Artifact [c2f36ac343]:


21
22
23
24
25
26
27


28
29
30
31
32
33
34
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36







+
+







#include <string.h>
#ifdef __GNUC__
# include <new>
#else
# include <new.h>
#endif

#import <ObjFW/ObjFW.h>

#ifdef NULL
# undef NULL
#endif
#define NULL 0

typedef unsigned char uchar;
typedef unsigned short ushort;
123
124
125
126
127
128
129
130

131
132
133
134
135
136
137
125
126
127
128
129
130
131

132
133
134
135
136
137
138
139







-
+







	T *buf;
	int alen;
	int ulen;

	vector()
	{
		alen = 8;
		buf = (T *)malloc(alen * sizeof(T));
		buf = (T *)OFAllocMemory(alen, sizeof(T));
		ulen = 0;
	}

	~vector()
	{
		setsize(0);
		free(buf);
208
209
210
211
212
213
214
215

216
217
218
219
220
221
222
210
211
212
213
214
215
216

217
218
219
220
221
222
223
224







-
+







		qsort(buf, ulen, sizeof(T),
		    (int(__cdecl *)(const void *, const void *))cf);
	}

	void
	realloc()
	{
		buf = (T *)::realloc(buf, (alen *= 2) * sizeof(T));
		buf = (T *)OFResizeMemory(buf, (alen *= 2), sizeof(T));
	}

	T
	remove(int i)
	{
		T e = buf[i];
		for (int p = i + 1; p < ulen; p++)