Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
_Py_bswap16()
  • Loading branch information
vstinner committed Apr 17, 2020
commit 2e22746db0ff2d49563465613e0e748d665bef03
4 changes: 2 additions & 2 deletions Include/internal/pycore_byteswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ _Py_bswap16(uint16_t word)
return _byteswap_ushort(word);
#else
// Portable implementation which doesn't rely on circular bit shift
return ( ((word >> 8) & UINT16_C(0x00FF))
| ((word << 8) & UINT16_C(0xFF00)));
return ( ((word & UINT16_C(0x00FF)) << 8)
| ((word & UINT16_C(0xFF00)) >> 8));
#endif
}

Expand Down