Revision 38a61cd6 src/int_coding.h

View differences:

src/int_coding.h
15 15
  memcpy(p, &tmp, 4);
16 16
}
17 17

  
18
static inline void int16_cpy(uint8_t *p, uint16_t v)
19
{
20
  uint16_t tmp;
21

  
22
  tmp = htons(v);
23
  memcpy(p, &tmp, 2);
24
}
25

  
18 26
static inline uint32_t int_rcpy(const uint8_t *p)
19 27
{
20 28
  uint32_t tmp;
......
24 32

  
25 33
  return tmp;
26 34
}
35

  
36
static inline uint16_t int16_rcpy(const uint8_t *p)
37
{
38
  uint16_t tmp;
39

  
40
  memcpy(&tmp, p, 2);
41
  tmp = ntohs(tmp);
42
  return tmp;
43
}
44

  
27 45
#endif	/* INT_CODING */

Also available in: Unified diff