summaryrefslogtreecommitdiff
path: root/src/libstddjb/uint16_bswap.c
blob: 6ab96edd325d18d67d16ace3ef5398f467566a4c (plain)
1
2
3
4
5
6
7
8
9
/* ISC license. */

#include <stdint.h>
#include <skalibs/uint16.h>

uint16_t uint16_bswap (uint16_t a)
{
  return (a & 0x00ffu) << 8 | (a & 0xff00u) >> 8 ;
}