[asterisk-commits] tilghman: branch 1.8 r301263 - /branches/1.8/main/strcompat.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 10 16:39:38 CST 2011


Author: tilghman
Date: Mon Jan 10 16:39:31 2011
New Revision: 301263

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=301263
Log:
Little endian machines were not converted properly.

(closes issue #18583)
Reported by: jcovert
Patches: 
      20110110__issue18583.diff.txt uploaded by tilghman (license 14)
Tested by: jcovert

Modified:
    branches/1.8/main/strcompat.c

Modified: branches/1.8/main/strcompat.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/strcompat.c?view=diff&rev=301263&r1=301262&r2=301263
==============================================================================
--- branches/1.8/main/strcompat.c (original)
+++ branches/1.8/main/strcompat.c Mon Jan 10 16:39:31 2011
@@ -367,14 +367,14 @@
 	} number;
 	number.u = net64;
 	return
-		(((uint64_t) number.c[0]) <<  0) |
-		(((uint64_t) number.c[1]) <<  8) |
-		(((uint64_t) number.c[2]) << 16) |
-		(((uint64_t) number.c[3]) << 24) |
-		(((uint64_t) number.c[4]) << 32) |
-		(((uint64_t) number.c[5]) << 40) |
-		(((uint64_t) number.c[6]) << 48) |
-		(((uint64_t) number.c[7]) << 56);
+		(((uint64_t) number.c[0]) << 56) |
+		(((uint64_t) number.c[1]) << 48) |
+		(((uint64_t) number.c[2]) << 40) |
+		(((uint64_t) number.c[3]) << 32) |
+		(((uint64_t) number.c[4]) << 24) |
+		(((uint64_t) number.c[5]) << 16) |
+		(((uint64_t) number.c[6]) <<  8) |
+		(((uint64_t) number.c[7]) <<  0);
 #else
 	#error "Unknown byte order"
 #endif
@@ -393,14 +393,14 @@
 	} number;
 	number.u = host64;
 	return
-		(((uint64_t) number.c[0]) <<  0) |
-		(((uint64_t) number.c[1]) <<  8) |
-		(((uint64_t) number.c[2]) << 16) |
-		(((uint64_t) number.c[3]) << 24) |
-		(((uint64_t) number.c[4]) << 32) |
-		(((uint64_t) number.c[5]) << 40) |
-		(((uint64_t) number.c[6]) << 48) |
-		(((uint64_t) number.c[7]) << 56);
+		(((uint64_t) number.c[0]) << 56) |
+		(((uint64_t) number.c[1]) << 48) |
+		(((uint64_t) number.c[2]) << 40) |
+		(((uint64_t) number.c[3]) << 32) |
+		(((uint64_t) number.c[4]) << 24) |
+		(((uint64_t) number.c[5]) << 16) |
+		(((uint64_t) number.c[6]) <<  8) |
+		(((uint64_t) number.c[7]) <<  0);
 #else
 	#error "Unknown byte order"
 #endif




More information about the asterisk-commits mailing list