fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
uint16p.c
Go to the documentation of this file.
1#include "uint_t.h"
2
10void uint16_pack(char s[2],uint16 u)
11{
12 s[0] = u & 255;
13 s[1] = u >> 8;
14}
15
16void uint16_pack_big(char s[2],uint16 u)
17{
18 s[1] = u & 255;
19 s[0] = u >> 8;
20}
21
22void uint16_unpack(char s[2],uint16 *u)
23{
24 uint16 result;
25
26 result = (unsigned char) s[1]; result <<= 8;
27 result += (unsigned char) s[0];
28
29 *u = result;
30}
31
32void uint16_unpack_big(char s[2],uint16 *u)
33{
34 uint16 result;
35
36 result = (unsigned char) s[0]; result <<= 8;
37 result += (unsigned char) s[1];
38
39 *u = result;
40}
void uint16_unpack(char s[2], uint16 *u)
Definition: uint16p.c:22
void uint16_unpack_big(char s[2], uint16 *u)
Definition: uint16p.c:32
void uint16_pack(char s[2], uint16 u)
Definition: uint16p.c:10
void uint16_pack_big(char s[2], uint16 u)
Definition: uint16p.c:16
additional types and pack routines
uint16_t uint16
Definition: uint_t.h:29