Drop main() prototype. Syncs with NetBSD-8
[minix.git] / common / lib / libc / gen / bswap32.c
blobfee64d61ce20eb9240b0abff88b4925a643b585f
1 /* $NetBSD: bswap32.c,v 1.3 2011/07/04 21:20:27 joerg Exp $ */
3 /*
4 * Written by Manuel Bouyer <bouyer@NetBSD.org>.
5 * Public domain.
6 */
8 #include <sys/cdefs.h>
9 #if defined(LIBC_SCCS) && !defined(lint)
10 __RCSID("$NetBSD: bswap32.c,v 1.3 2011/07/04 21:20:27 joerg Exp $");
11 #endif /* LIBC_SCCS and not lint */
13 #include <sys/types.h>
14 #include <machine/bswap.h>
16 #undef bswap32
18 uint32_t
19 bswap32(uint32_t x)
21 return ((x << 24) & 0xff000000 ) |
22 ((x << 8) & 0x00ff0000 ) |
23 ((x >> 8) & 0x0000ff00 ) |
24 ((x >> 24) & 0x000000ff );