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

#include <skalibs/uint32.h>
#include <skalibs/bytestr.h>

void uint32_unpack_big (char const *s, uint32 *u)
{
  uint32 r = T8((unsigned char)s[0]) ; r <<= 8 ;
  r += T8((unsigned char)s[1]) ; r <<= 8 ;
  r += T8((unsigned char)s[2]) ; r <<= 8 ;
  r += T8((unsigned char)s[3]) ;
  *u = r ;
}