Ticket #55058: byteorder.patch

File byteorder.patch, 1.0 KB (added by grumpybozo (Bill Cole), 7 years ago)

patch for src/lib/byteorder.h to specify type of 64-bit literals

  • src/lib/byteorder.h

    a b static inline uint8_t cpu8_to_le(uint8_t in); 
    9191 */
    9292static inline uint64_t bswap_64(uint64_t in)
    9393{
    94        return ((in & 0xff00000000000000) >> 56) |
    95               ((in & 0x00ff000000000000) >> 40) |
    96               ((in & 0x0000ff0000000000) >> 24) |
    97               ((in & 0x000000ff00000000) >> 8) |
    98               ((in & 0x00000000ff000000) << 8) |
    99               ((in & 0x0000000000ff0000) << 24) |
    100               ((in & 0x000000000000ff00) << 40) |
    101               ((in & 0x00000000000000ff) << 56);
     94       return ((in & 0xff00000000000000ULL) >> 56) |
     95              ((in & 0x00ff000000000000ULL) >> 40) |
     96              ((in & 0x0000ff0000000000ULL) >> 24) |
     97              ((in & 0x000000ff00000000ULL) >> 8) |
     98              ((in & 0x00000000ff000000ULL) << 8) |
     99              ((in & 0x0000000000ff0000ULL) << 24) |
     100              ((in & 0x000000000000ff00ULL) << 40) |
     101              ((in & 0x00000000000000ffULL) << 56);
    102102}
    103103
    104104static inline uint32_t bswap_32(uint32_t in)