2 * Written by Manuel Bouyer <bouyer@netbsd.org>.
9 #if defined(LIBC_SCCS) && !defined(lint)
10 static char *rcsid = "$NetBSD: bswap32.c,v 1.1 1997/10/09 15:42:33 bouyer Exp $";
11 static char *rcsid = "$NetBSD: bswap64.c,v 1.1 1997/10/09 15:42:33 bouyer Exp $";
14 #include <sys/types.h>
23 return ((x << 24) & 0xff000000 ) |
24 ((x << 8) & 0x00ff0000 ) |
25 ((x >> 8) & 0x0000ff00 ) |
26 ((x >> 24) & 0x000000ff );
33 u_int32_t *p = (u_int32_t*)&x;