Skip to content

Commit

Permalink
Merge #11138: Compat: Simplify bswap_16 implementation
Browse files Browse the repository at this point in the history
e40fa98 Simplify bswap_16 implementation (danra)

Pull request description:

  Simplify bswap_16 implementation on platforms which don't already have it defined.
  This has no effect on the generated assembly; it just simplifies the source code.

Tree-SHA512: 1c6ac1d187a2751da75256d12b6b890160d15246dd2c2b6a56748ec43482e3a5a3323be2910f07b42d3dc243a568c7412c26eaa036efec764436e988abd1c3f1
  • Loading branch information
laanwj committed Aug 28, 2017
2 parents c7229ac + e40fa98 commit 2982511
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compat/byteswap.h
Expand Up @@ -35,7 +35,7 @@
#if HAVE_DECL_BSWAP_16 == 0
inline uint16_t bswap_16(uint16_t x)
{
return (x >> 8) | ((x & 0x00ff) << 8);
return (x >> 8) | (x << 8);
}
#endif // HAVE_DECL_BSWAP16

Expand Down

0 comments on commit 2982511

Please sign in to comment.