]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix compile errors detected by clang++
authorPawel Worach <pawel.worach@gmail.com>
Fri, 12 Aug 2011 04:32:14 +0000 (22:32 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 12 Aug 2011 04:32:14 +0000 (22:32 -0600)
acinclude/krb5.m4
compat/xalloc.cc
src/ChunkedCodingParser.cc
src/dns_internal.cc
tools/purge/conffile.cc
tools/purge/convert.cc
tools/purge/copyout.cc
tools/purge/purge.cc
tools/purge/signal.cc
tools/purge/socket.cc
tools/purge/squid-tlv.cc

index 19dfd31668d2c845d8cabb39535c64ec70c79d7e..946bea8078f34a140128fe2f598297b7c7db3f77 100644 (file)
@@ -122,7 +122,7 @@ KRB5INT_BEGIN_DECLS
 #endif
 #endif
 #include <krb5.h>
-main()
+int main(int argc, char *argv[])
 {
     krb5_context context;
     krb5_ccache cc;
index e148f22bd951c0f3487092589f61733be7ae148f..db13493c41a93c6fc87bf14919c67b7e6b41d875 100644 (file)
@@ -119,7 +119,7 @@ xmalloc(size_t sz)
     if (p == NULL) {
         if (failure_notify) {
             static char msg[128];
-            snprintf(msg, 128, "xmalloc: Unable to allocate %Zu bytes!\n", sz);
+            snprintf(msg, 128, "xmalloc: Unable to allocate %lu bytes!\n", (unsigned long)sz);
             failure_notify(msg);
         } else {
             perror("malloc");
@@ -167,7 +167,7 @@ xrealloc(void *s, size_t sz)
     if (p == NULL) {
         if (failure_notify) {
             static char msg[128];
-            snprintf(msg, 128, "xrealloc: Unable to reallocate %Zu bytes!\n", sz);
+            snprintf(msg, 128, "xrealloc: Unable to reallocate %lu bytes!\n", (unsigned long)sz);
             failure_notify(msg);
         } else {
             perror("realloc");
index a7feb714f199e944ffc44ceab6ad8e072ffa1fb8..9a1613e8d7e85e8a4a98f34b5f79b0f46fe68c13 100644 (file)
@@ -159,9 +159,11 @@ void ChunkedCodingParser::parseTrailerHeader()
     size_t crlfEnd = 0;
 
     if (findCrlf(crlfBeg, crlfEnd)) {
+#if NOTYET
         if (crlfBeg > 0)
 
             ; //theTrailer.append(theIn->content(), crlfEnd);
+#endif
 
         theIn->consume(crlfEnd);
 
index 994416a3e70859eb393e99fbd224a05fb3d1c4b5..663aa77e9395bd04c6668baf45bba8281cfbc13b 100644 (file)
@@ -676,7 +676,7 @@ idnsStats(StoreEntry * sentry)
     }
 
     if (Config.dns.packet_max > 0)
-        storeAppendPrintf(sentry, "DNS jumbo-grams: %Zd Bytes\n", Config.dns.packet_max);
+        storeAppendPrintf(sentry, "DNS jumbo-grams: %zd Bytes\n", Config.dns.packet_max);
     else
         storeAppendPrintf(sentry, "DNS jumbo-grams: not working\n");
 
index 6848571d1427f004911cd3bbc2b49073824f0fe1..81f0c21ad0706d91342676b903880b421c1e19d9 100644 (file)
@@ -37,7 +37,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 
index 0b587fdff15413ec039fa1dace0f4eb937556895..39013172f119b4805f6f453e84c17b29afd83bc3 100644 (file)
@@ -43,7 +43,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 
index b1525f16f897f02145fd098b6deffd24e4de6aa7..40ad881f741708513fac347ead64b1bdd22e12c1 100644 (file)
@@ -38,7 +38,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 
index 82359572284f8db211626937067f564b60c37e46..c6beb6f882809fa83bc63df401a495776f3a4a03 100644 (file)
@@ -93,7 +93,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 
@@ -292,7 +292,9 @@ log_extended( const char* fn, int code, long size, const SquidMetaList* meta )
                   (unsigned long)temp.timestamp, (unsigned long)temp.lastref,
                   (unsigned long)temp.expires, (unsigned long)temp.lastmod, temp.flags, temp.refcount );
     } else {
-        snprintf( timeb, sizeof(timeb), "%08lx %08lx %08lx %08lx %04x %5hu ", (unsigned long)-1, (unsigned long)-1, (unsigned long)-1, (unsigned long)-1, 0, 0 );
+        unsigned long ul = -1;  // Match type of StoreMetaTLV fields
+        unsigned short hu = 0;  // Match type of StoreMetaTLV refcount fields
+        snprintf( timeb, sizeof(timeb), "%08lx %08lx %08lx %08lx %04x %5d ", ul, ul, ul, ul, 0, hu);
     }
 
     // make sure that there is just one printf()
index 774ea60a5053b2e5b239658666a2f91c2c759d5a..258106c421c7a0d38222514ac8810d3f9be64ef8 100644 (file)
@@ -45,7 +45,7 @@
 //
 //
 
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 
index 07f90e336162ac5d3634bdf9e1fa104e4dbc7777..ce1b4dd879a87964180b0aa508334972753c00c0 100644 (file)
@@ -46,7 +46,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif
 
index 29a53d116890f5211ea07ccc3eb695fb2276c78c..9232e81cdc55e1ae848a52b4467d6659538da046 100644 (file)
@@ -35,7 +35,7 @@
 // Initial revision
 //
 //
-#if defined(__GNUC__) || defined(__GNUG__)
+#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
 #pragma implementation
 #endif