MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / swapByteOrder

Function swapByteOrder

source/core/StarBytes.hpp:65–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65inline void swapByteOrder(void* ptr, size_t len) {
66 uint8_t* data = static_cast<uint8_t*>(ptr);
67 uint8_t spare;
68 for (size_t i = 0; i < len / 2; ++i) {
69 spare = data[len - 1 - i];
70 data[len - 1 - i] = data[i];
71 data[i] = spare;
72 }
73}
74
75inline void swapByteOrder(void* dest, const void* src, size_t len) {
76 const uint8_t* srcdata = static_cast<const uint8_t*>(src);

Callers 2

toByteOrderFunction · 0.85
fromByteOrderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected