Fixing end_of_file and allocation_size, some wildcard stuff, etc.

This commit is contained in:
Ben Vanik
2015-06-02 22:09:32 -07:00
parent 25a2fbd78e
commit e186fcaf0d
10 changed files with 68 additions and 67 deletions

View File

@@ -68,6 +68,14 @@ inline double byte_swap(double value) {
uint64_t temp = byte_swap(*reinterpret_cast<uint64_t *>(&value));
return *reinterpret_cast<double *>(&temp);
}
template <typename T>
inline T byte_swap(T value) {
if (sizeof(T) == 4) {
return static_cast<T>(byte_swap(static_cast<uint32_t>(value)));
} else {
assert_always("not handled");
}
}
template <typename T>
struct be {