Formatting: force pointers to the left side.

This commit is contained in:
Ben Vanik
2015-06-30 16:16:33 -07:00
parent 90e86d0172
commit d7a5c74bf3
12 changed files with 478 additions and 481 deletions

View File

@@ -61,12 +61,12 @@ inline uint64_t byte_swap(uint64_t value) {
return XENIA_BASE_BYTE_SWAP_64(value);
}
inline float byte_swap(float value) {
uint32_t temp = byte_swap(*reinterpret_cast<uint32_t *>(&value));
return *reinterpret_cast<float *>(&temp);
uint32_t temp = byte_swap(*reinterpret_cast<uint32_t*>(&value));
return *reinterpret_cast<float*>(&temp);
}
inline double byte_swap(double value) {
uint64_t temp = byte_swap(*reinterpret_cast<uint64_t *>(&value));
return *reinterpret_cast<double *>(&temp);
uint64_t temp = byte_swap(*reinterpret_cast<uint64_t*>(&value));
return *reinterpret_cast<double*>(&temp);
}
template <typename T>
inline T byte_swap(T value) {
@@ -80,19 +80,19 @@ inline T byte_swap(T value) {
template <typename T>
struct be {
be() = default;
be(const T &src) : value(xe::byte_swap(src)) {}
be(const be &other) { value = other.value; }
be(const T& src) : value(xe::byte_swap(src)) {}
be(const be& other) { value = other.value; }
operator T() const { return xe::byte_swap(value); }
be<T> &operator+=(int a) {
be<T>& operator+=(int a) {
*this = *this + a;
return *this;
}
be<T> &operator-=(int a) {
be<T>& operator-=(int a) {
*this = *this - a;
return *this;
}
be<T> &operator++() {
be<T>& operator++() {
*this += 1;
return *this;
} // ++a
@@ -100,7 +100,7 @@ struct be {
*this += 1;
return (*this - 1);
} // a++
be<T> &operator--() {
be<T>& operator--() {
*this -= 1;
return *this;
} // --a