logo       

zagor: apps dbtree.c,1.10,1.11: msg#00219

systems.archos.rockbox.cvs

Subject: zagor: apps dbtree.c,1.10,1.11

Update of /cvsroot/rockbox/apps
In directory labb:/tmp/cvs-serv549

Modified Files:
dbtree.c
Log Message:
Replaced htonl() with a more portable byteswap macro.

Index: dbtree.c
===================================================================
RCS file: /cvsroot/rockbox/apps/dbtree.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- dbtree.c 27 Jan 2005 22:21:07 -0000 1.10
+++ dbtree.c 28 Jan 2005 23:04:19 -0000 1.11
@@ -43,9 +43,11 @@
#include "lang.h"
#include "keyboard.h"

-#ifdef LITTLE_ENDIAN
-#include <netinet/in.h>
-#define BE32(_x_) htonl(_x_)
+#if defined(LITTLE_ENDIAN) || defined(_X86_)
+#define BE32(_x_) (((_x_ & 0xff000000) >> 24) | \
+ ((_x_ & 0x00ff0000) >> 8) | \
+ ((_x_ & 0x0000ff00) << 8) | \
+ ((_x_ & 0x000000ff) << 24))
#else
#define BE32(_x_) _x_
#endif

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox-cvs



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise