MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / SwapFourBytes

Function SwapFourBytes

tools/modeltool/Q3BSP.cpp:60–67  ·  view source on GitHub ↗

byte swapping functions

Source from the content-addressed store, hash-verified

58
59// byte swapping functions
60void SwapFourBytes(unsigned long* dw) {
61 unsigned long tmp;
62 tmp = (*dw & 0x000000FF);
63 tmp = ((*dw & 0x0000FF00) >> 0x08) | (tmp << 0x08);
64 tmp = ((*dw & 0x00FF0000) >> 0x10) | (tmp << 0x08);
65 tmp = ((*dw & 0xFF000000) >> 0x18) | (tmp << 0x08);
66 memcpy(dw, &tmp, sizeof(unsigned long));
67}
68
69void SwapFourBytesGrup(unsigned long* src, int size) {
70 unsigned long* ptr = (unsigned long*)src;

Callers 4

SwapFourBytesGrupFunction · 0.85
initialiseMethod · 0.85
getLumpMethod · 0.85
getLumpSizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected