Cube  Diff

Differences From Artifact [f9cb2ee264]:

To Artifact [9fca1834ea]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18








19
20
1
2
3
4
5
6
7
8
9
10
11
12






13
14
15
16
17
18
19
20
21
22












-
-
-
-
-
-
+
+
+
+
+
+
+
+


// implementation of generic tools

#include "tools.h"

///////////////////////// misc tools ///////////////////////

void
endianswap(
    void *memory, int stride, int length) // little indians as storage format
{
	if (*((char *)&stride))
		return;
	loop(w, length) loop(i, stride / 2)
	{
		uchar *p = (uchar *)memory + w * stride;
		uchar t = p[i];
		p[i] = p[stride - i - 1];
		p[stride - i - 1] = t;

	for (int w = 0; w < length; w++) {
		for (int i = 0; i < stride / 2; i++) {
			uchar *p = (uchar *)memory + w * stride;
			uchar t = p[i];
			p[i] = p[stride - i - 1];
			p[stride - i - 1] = t;
		}
	}
}