httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: 1.3.24-dev new warning...
Date Fri, 08 Mar 2002 15:10:50 GMT
At 10:42 PM -0600 3/7/02, William A. Rowe, Jr. wrote:
>C:\clean\apache-1.3\src\modules\proxy\proxy_util.c(565)
>  : warning C4018: '<' : signed/unsigned mismatch
>
>            n = ap_bread(f, buf, MIN(buf_size, len - total_bytes_rcvd));
>
>Whoever is hacking in proxy, feel free to correct.
>
>[The only other emits according to win32 are FD_SET obscurity.]
>

Try this:

Index: src/ap/ap_snprintf.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/ap/ap_snprintf.c,v
retrieving revision 1.49
diff -u -r1.49 ap_snprintf.c
--- src/ap/ap_snprintf.c        21 Jan 2002 21:56:43 -0000      1.49
+++ src/ap/ap_snprintf.c        8 Mar 2002 15:09:31 -0000
@@ -87,22 +87,9 @@
 #ifndef TRUE
 #define TRUE                   1
 #endif
-#ifndef AP_LONGEST_LONG
-#define AP_LONGEST_LONG                long
-#endif
+
 #define NUL                    '\0'
-#define WIDE_INT               long
-#define WIDEST_INT             AP_LONGEST_LONG
 
-typedef WIDE_INT wide_int;
-typedef unsigned WIDE_INT u_wide_int;
-typedef WIDEST_INT widest_int;
-#ifdef __TANDEM
-/* Although Tandem supports "long long" there is no unsigned variant. */
-typedef unsigned long       u_widest_int;
-#else
-typedef unsigned WIDEST_INT u_widest_int;
-#endif
 typedef int bool_int;
 
 #define S_NULL                 "(null)"
Index: src/include/ap.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/ap.h,v
retrieving revision 1.32
diff -u -r1.32 ap.h
--- src/include/ap.h    21 Jan 2002 21:56:43 -0000      1.32
+++ src/include/ap.h    8 Mar 2002 15:09:31 -0000
@@ -141,6 +141,26 @@
     char *endpos;
 } ap_vformatter_buff;
 
+/*
+ * Figure out the widest integer values available, in
+ * both signed and unsigned variety. Most in use by
+ * ap_snprintf() but useful for others as well
+ */
+#ifndef AP_LONGEST_LONG
+#define AP_LONGEST_LONG                long
+#endif
+#define WIDE_INT               long
+#define WIDEST_INT             AP_LONGEST_LONG
+typedef WIDE_INT wide_int;
+typedef unsigned WIDE_INT u_wide_int;
+typedef WIDEST_INT widest_int;
+#ifdef __TANDEM
+/* Although Tandem supports "long long" there is no unsigned variant. */
+typedef unsigned long       u_widest_int;
+#else
+typedef unsigned WIDEST_INT u_widest_int;
+#endif
+
 API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff *),
     ap_vformatter_buff *, const char *fmt, va_list ap);
 
Index: src/modules/proxy/proxy_util.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/proxy/proxy_util.c,v
retrieving revision 1.106
diff -u -r1.106 proxy_util.c
--- src/modules/proxy/proxy_util.c      26 Feb 2002 18:01:28 -0000      1.106
+++ src/modules/proxy/proxy_util.c      8 Mar 2002 15:09:34 -0000
@@ -562,7 +562,8 @@
             n = ap_bread(f, buf, buf_size);
         }
         else {
-            n = ap_bread(f, buf, MIN(buf_size, len - total_bytes_rcvd));
+            n = ap_bread(f, buf,
+             MIN((u_widest_int)buf_size, (u_widest_int)(len - total_bytes_rcvd)));
         }
 
         if (alternate_timeouts)

-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
      "A society that will trade a little liberty for a little order
             will lose both and deserve neither" - T.Jefferson

Mime
View raw message