ReactOS  0.4.14-dev-49-gfb4591c
util.c
Go to the documentation of this file.
1 
2 
3 #if !defined(_MSC_VER) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
4 #include <stdlib.h>
5 #include <intrin.h>
6 
7 void
8 byteReverse(unsigned char *buf, unsigned longs)
9 {
10  unsigned int t;
11 
12  do
13  {
14 #if 0
15  t = (unsigned int)((unsigned)buf[3] << 8 | buf[2]) << 16 |
16  ((unsigned)buf[1] << 8 | buf[0]);
17 #else
18  t = _byteswap_ulong(*(unsigned int *)buf);
19 #endif
20  *(unsigned int *)buf = t;
21  buf += 4;
22  } while (--longs);
23 }
24 
25 #endif // !defined(_MSC_VER) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
26 
static int
Definition: util.c:37
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLdouble GLdouble t
Definition: gl.h:2047
void byteReverse(unsigned char *buf, unsigned longs)
Definition: util.c:8
_Check_return_ unsigned long __cdecl _byteswap_ulong(_In_ unsigned long)