MCPcopy Create free account
hub / github.com/Kitware/VTK / swap_words

Function swap_words

ThirdParty/libproj/vtklibproj/src/grids.cpp:60–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

openMethod · 0.85
valueAtMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected