summaryrefslogtreecommitdiff
path: root/nuttx/lib/lib_htonl.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-23 19:25:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-23 19:25:39 +0000
commit789f463db7fc2a1613374fb8ea45cdba6cc77136 (patch)
tree0c84443eb3f566978a47274ece15cd5ce03973a9 /nuttx/lib/lib_htonl.c
parent403a4936c8fc3756003a28328c18c770bc914b6d (diff)
downloadpx4-nuttx-789f463db7fc2a1613374fb8ea45cdba6cc77136.tar.gz
px4-nuttx-789f463db7fc2a1613374fb8ea45cdba6cc77136.tar.bz2
px4-nuttx-789f463db7fc2a1613374fb8ea45cdba6cc77136.zip
Verified recvfrom()nuttx-3.2
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@402 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/lib_htonl.c')
-rw-r--r--nuttx/lib/lib_htonl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nuttx/lib/lib_htonl.c b/nuttx/lib/lib_htonl.c
index 1cc5b6bcf..0f6cbf224 100644
--- a/nuttx/lib/lib_htonl.c
+++ b/nuttx/lib/lib_htonl.c
@@ -53,7 +53,10 @@ uint32 htonl(uint32 hl)
#ifdef CONFIG_ENDIAN_BIG
return hl;
#else
- return (uint32)htons((uint16)((hl) << 16)) | (uint32)htons((uint16)((hl) & 0xffff));
+ return (( (hl) >> 24) |
+ (((hl) >> 8) & 0x0000ff00) |
+ (((hl) << 8) & 0x00ff0000) |
+ ( (hl) << 24));
#endif
}