summaryrefslogtreecommitdiff
path: root/src/libstddjb/uint16_unpack_big.c
blob: 73b94dae17de0d4e14abc2c73e79d0ee02c101e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

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

void uint16_unpack_big (char const *s, uint16_t *u)
{
  uint16_t r = T8((unsigned char)s[0]) ; r <<= 8 ;
  r += T8((unsigned char)s[1]) ;
  *u = r ;
}