MCPcopy Create free account
hub / github.com/SimHacker/micropolis / swap_shorts

Function swap_shorts

MicropolisCore/src/MicropolisEngine/src/fileio.cpp:96–105  ·  view source on GitHub ↗

* Swap upper and lower byte of all shorts in the array. * @param buf Array with shorts. * @param len Number of short values in the array. */

Source from the content-addressed store, hash-verified

94 * @param len Number of short values in the array.
95 */
96static void swap_shorts(short *buf, int len)
97{
98 int i;
99
100 /* Flip bytes in each short! */
101 for (i = 0; i < len; i++) {
102 *buf = ((*buf & 0xFF) <<8) | ((*buf &0xFF00) >>8);
103 buf++;
104 }
105}
106
107
108/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected