]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: use code instead of static initialization
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 27 Aug 2011 07:46:07 +0000 (01:46 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 27 Aug 2011 07:46:07 +0000 (01:46 -0600)
g++ 4.4.5 on ARM mis-detects an inizializer's variable size. Give it a hint.

src/icmp/testIcmp.cc

index 12b0117fdebe9466dfa9994d3ca60175db1036fe..2532f4e72aaee3e9e3f443aff232a13178231e6c 100644 (file)
@@ -15,7 +15,9 @@ void
 testIcmp::testChecksum()
 {
     stubIcmp icmp;
-    short unsigned int buf[10] = {htons(1),htons(2),htons(3),htons(4),htons(5),htons(6),htons(7),htons(8),htons(9), htons(10)};
+    uint16_t buf[10], tmpval;
+    for (tmpval=0; tmpval < 10; ++tmpval)
+        buf[tmpval]=htons(1+tmpval);
 
     // NULL data
     CPPUNIT_ASSERT_EQUAL((int)htons(0xffff), icmp.testChecksum(NULL,0));