diff src/http/ngx_http_request_body.c @ 5359:2fda9065d0f4

Win32: Borland C compatibility fixes. Several false positive warnings silenced, notably W8012 "Comparing signed and unsigned" (due to u_short values promoted to int), and W8072 "Suspicious pointer arithmetic" (due to large type values added to pointers). With this patch, it's now again possible to compile nginx using bcc32, with options we normally compile on win32 minus ipv6 and ssl.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 04 Sep 2013 20:48:23 +0400
parents ea2ba6dbe361
children cbb9a6c7493c
line wrap: on
line diff
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -714,7 +714,7 @@ ngx_http_discard_request_body_filter(ngx
                 size = b->last - b->pos;
 
                 if ((off_t) size > rb->chunked->size) {
-                    b->pos += rb->chunked->size;
+                    b->pos += (size_t) rb->chunked->size;
                     rb->chunked->size = 0;
 
                 } else {
@@ -753,7 +753,7 @@ ngx_http_discard_request_body_filter(ngx
         size = b->last - b->pos;
 
         if ((off_t) size > r->headers_in.content_length_n) {
-            b->pos += r->headers_in.content_length_n;
+            b->pos += (size_t) r->headers_in.content_length_n;
             r->headers_in.content_length_n = 0;
 
         } else {
@@ -866,7 +866,7 @@ ngx_http_request_body_length_filter(ngx_
             rb->rest -= size;
 
         } else {
-            cl->buf->pos += rb->rest;
+            cl->buf->pos += (size_t) rb->rest;
             rb->rest = 0;
             b->last = cl->buf->pos;
             b->last_buf = 1;
@@ -972,7 +972,7 @@ ngx_http_request_body_chunked_filter(ngx
                 size = cl->buf->last - cl->buf->pos;
 
                 if ((off_t) size > rb->chunked->size) {
-                    cl->buf->pos += rb->chunked->size;
+                    cl->buf->pos += (size_t) rb->chunked->size;
                     r->headers_in.content_length_n += rb->chunked->size;
                     rb->chunked->size = 0;