summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-09-04 20:48:23 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2013-09-04 20:48:23 +0400
commit74b7a910137a99b5fb073e7c27858c019f96a8cc (patch)
tree00d2621de512d3cbae54c9e7a839e84df4825ba8 /src/http/modules
parent5b3785232303f9c44543b20e1499c756462c53e6 (diff)
downloadnginx-74b7a910137a99b5fb073e7c27858c019f96a8cc.tar.gz
nginx-74b7a910137a99b5fb073e7c27858c019f96a8cc.tar.bz2
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.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_memcached_module.c2
-rw-r--r--src/http/modules/ngx_http_mp4_module.c10
-rw-r--r--src/http/modules/ngx_http_proxy_module.c4
-rw-r--r--src/http/modules/ngx_http_upstream_ip_hash_module.c2
4 files changed, 11 insertions, 7 deletions
diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c
index bfff1bfc2..aaa047e8f 100644
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -520,7 +520,7 @@ ngx_http_memcached_filter(void *data, ssize_t bytes)
return NGX_OK;
}
- last += u->length - NGX_HTTP_MEMCACHED_END;
+ last += (size_t) (u->length - NGX_HTTP_MEMCACHED_END);
if (ngx_strncmp(last, ngx_http_memcached_end, b->last - last) != 0) {
ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c
index 680b65871..c44dc52c9 100644
--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -157,7 +157,11 @@ typedef struct {
#define ngx_mp4_atom_header(mp4) (mp4->buffer_pos - 8)
#define ngx_mp4_atom_data(mp4) mp4->buffer_pos
#define ngx_mp4_atom_data_size(t) (uint64_t) (sizeof(t) - 8)
-#define ngx_mp4_atom_next(mp4, n) mp4->buffer_pos += n; mp4->offset += n
+
+
+#define ngx_mp4_atom_next(mp4, n) \
+ mp4->buffer_pos += (size_t) n; \
+ mp4->offset += n
#define ngx_mp4_set_atom_name(p, n1, n2, n3, n4) \
@@ -956,7 +960,7 @@ ngx_http_mp4_read_ftyp_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 ftyp atom");
if (atom_data_size > 1024
- || ngx_mp4_atom_data(mp4) + atom_data_size > mp4->buffer_end)
+ || ngx_mp4_atom_data(mp4) + (size_t) atom_data_size > mp4->buffer_end)
{
ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
"\"%s\" mp4 ftyp atom is too large:%uL",
@@ -1304,7 +1308,7 @@ ngx_http_mp4_read_trak_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
trak->out[NGX_HTTP_MP4_TRAK_ATOM].buf = atom;
- atom_end = mp4->buffer_pos + atom_data_size;
+ atom_end = mp4->buffer_pos + (size_t) atom_data_size;
atom_file_end = mp4->offset + atom_data_size;
rc = ngx_http_mp4_read_atom(mp4, ngx_http_mp4_trak_atoms, atom_data_size);
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index a22ed0fcb..f5fd83d14 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1712,7 +1712,7 @@ ngx_http_proxy_chunked_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
if (buf->last - buf->pos >= ctx->chunked.size) {
- buf->pos += ctx->chunked.size;
+ buf->pos += (size_t) ctx->chunked.size;
b->last = buf->pos;
ctx->chunked.size = 0;
@@ -1875,7 +1875,7 @@ ngx_http_proxy_non_buffered_chunked_filter(void *data, ssize_t bytes)
b->tag = u->output.tag;
if (buf->last - buf->pos >= ctx->chunked.size) {
- buf->pos += ctx->chunked.size;
+ buf->pos += (size_t) ctx->chunked.size;
b->last = buf->pos;
ctx->chunked.size = 0;
diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c
index 29c74fd54..0e5cf416a 100644
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c
@@ -174,7 +174,7 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
for ( ;; ) {
- for (i = 0; i < iphp->addrlen; i++) {
+ for (i = 0; i < (ngx_uint_t) iphp->addrlen; i++) {
hash = (hash * 113 + iphp->addr[i]) % 6271;
}