-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_endian32.c
43 lines (36 loc) · 1.26 KB
/
ft_endian32.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_endian32.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgillot- <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/03/15 09:11:55 by lgillot- #+# #+# */
/* Updated: 2016/03/15 09:11:59 by lgillot- ### ########.fr */
/* */
/* ************************************************************************** */
#include <ft_endian.h>
#include "ft_endian_priv.h"
static uint32_t invert32(uint32_t x)
{
return ((x >> 24 & 0xff) |
(x << 8 & 0xff0000) |
(x >> 8 & 0xff00) |
(x << 24 & 0xff000000));
}
uint32_t ft_htobe32(uint32_t x)
{
HTOBE(32);
}
uint32_t ft_htole32(uint32_t x)
{
HTOLE(32);
}
uint32_t ft_be32toh(uint32_t x)
{
HTOBE(32);
}
uint32_t ft_le32toh(uint32_t x)
{
HTOLE(32);
}