MCPcopy Create free account
hub / github.com/OSGeo/PROJ / swap_words

Function swap_words

test/unit/test_network.cpp:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 (1 == (reinterpret_cast<const unsigned char *>(&byte_order_test))[0])
62
63static void swap_words(void *dataIn, size_t word_size, size_t word_count)
64
65{
66 unsigned char *data = static_cast<unsigned char *>(dataIn);
67 for (size_t word = 0; word < word_count; word++) {
68 for (size_t i = 0; i < word_size / 2; i++) {
69 unsigned char t;
70
71 t = data[i];
72 data[i] = data[word_size - i - 1];
73 data[word_size - i - 1] = t;
74 }
75
76 data += word_size;
77 }
78}
79
80// ---------------------------------------------------------------------------
81

Callers 1

TESTFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected