src/ztdendian.h
static inline uint16_t be16(uint16_t x)
{
    union { uint8_t a[2]; uint16_t b; } y = {
        .a = { (uint8_t)(x >> 8), (uint8_t)(x) }
    };
    return y.b;
}
/*
 * Natural to foreign endian helpers using type punning
 *
 * Recent Clang and GCC lift these expressions to bswap
 * instructions. This makes baremetal code easier.
 */
Natural to foreign endian helpers using type punning
Recent Clang and GCC lift these expressions to bswap
instructions. This makes baremetal code easier.
Natural to foreign endian helpers using type punning Recent Clang and GCC lift these expressions to bswap instructions . This makes baremetal code easier .
static inline uint16_t be16(uint16_t x)
{
    union { uint8_t a[2]; uint16_t b; } y = {
        .a = { (uint8_t)(x >> 8), (uint8_t)(x) }
    };
    return y.b;
}
static inline uint16_t be16 ( uint16_t x ) { union { uint8_t a [ 2 ] ; uint16_t b ; } y = { . a = { ( uint8_t ) ( x >> 8 ) , ( uint8_t ) ( x ) } } ; return y . b ; }
Natural to foreign endian helpers using type punning
 Recent Clang and GCC lift these expressions to bswap
 instructions.
Natural to foreign endian helpers using type punning Recent Clang and GCC lift these expressions to bswap instructions .