File: bitesex.h

package info (click to toggle)
maelstrom 3.0.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,952 kB
  • sloc: cpp: 10,947; sh: 3,406; ansic: 2,781; makefile: 175
file content (19 lines) | stat: -rw-r--r-- 410 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _bitesex_h
#define _bitesex_h

#include "SDL_endian.h"

#define bytesex32(x)	(x = SDL_SwapBE32(x))
#define bytesex16(x)	(x = SDL_SwapBE16(x))

/* Swap bytes from big-endian to this machine's type.
   The input data is assumed to be always in big-endian format.
*/
static inline void
byteswap(Uint16 *array, int nshorts)
{
	for (; nshorts-- > 0; array++)
		bytesex16(*array);
}

#endif /* _bitesex_h */