diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-05-17 21:28:08 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-05-17 21:28:08 +0200 |
commit | 2b75425070662b869c15673623df44e30ce43ebe (patch) | |
tree | f0dbb5e840e2747be5966952cb2e3554d034ae72 /robot/bin.c | |
parent | 365dcc18fbd98645585cdbe009f537ecdaa90c1a (diff) |
code format
Diffstat (limited to 'robot/bin.c')
-rw-r--r-- | robot/bin.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/robot/bin.c b/robot/bin.c index 4261b50..4242edc 100644 --- a/robot/bin.c +++ b/robot/bin.c @@ -15,14 +15,14 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshift-count-overflow" uint32_t w2_bin_hton32(uint32_t h32) { - if(g_w2_endianness == W2_ENDIAN_BIG) return h32; - return ((h32 & _BYTE_0) << _SHIFT_3B) | ((h32 & _BYTE_1) << _SHIFT_1B) - | ((h32 & _BYTE_2) >> _SHIFT_1B) | ((h32 & _BYTE_3) >> _SHIFT_3B); + if (g_w2_endianness == W2_ENDIAN_BIG) return h32; + return ((h32 & _BYTE_0) << _SHIFT_3B) | ((h32 & _BYTE_1) << _SHIFT_1B) | + ((h32 & _BYTE_2) >> _SHIFT_1B) | ((h32 & _BYTE_3) >> _SHIFT_3B); } #pragma GCC diagnostic pop uint16_t w2_bin_hton16(uint16_t h16) { - if(g_w2_endianness == W2_ENDIAN_BIG) return h16; + if (g_w2_endianness == W2_ENDIAN_BIG) return h16; return ((h16 & _BYTE_0) << _SHIFT_1B) | ((h16 & _BYTE_1) >> _SHIFT_1B); } |