]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /* $NetBSD: bswap32.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */\r |
2 | \r | |
3 | /*\r | |
4 | * Written by Manuel Bouyer <bouyer@NetBSD.org>.\r | |
5 | * Public domain.\r | |
6 | */\r | |
7 | \r | |
8 | //#include <sys/cdefs.h>\r | |
9 | //#if defined(LIBC_SCCS) && !defined(lint)\r | |
10 | //__RCSID("$NetBSD: bswap32.c,v 1.1 2005/12/20 19:28:51 christos Exp $");\r | |
11 | //#endif /* LIBC_SCCS and not lint */\r | |
12 | \r | |
13 | //#include <sys/types.h>\r | |
14 | //#include <machine/bswap.h>\r | |
15 | \r | |
16 | #undef bswap32\r | |
17 | \r | |
18 | UINT32\r | |
19 | bswap32(UINT32 x)\r | |
20 | {\r | |
21 | return ((x << 24) & 0xff000000 ) |\r | |
22 | ((x << 8) & 0x00ff0000 ) |\r | |
23 | ((x >> 8) & 0x0000ff00 ) |\r | |
24 | ((x >> 24) & 0x000000ff );\r | |
25 | }\r |