Klaus Demo nginx / c17009e
Win32: fixed some warnings reported by Borland C. Most notably, warning W8012 (comparing signed and unsigned values) reported in multiple places where an unsigned value of small type (e.g., u_short) is promoted to an int and compared to an unsigned value. Warning W8072 (suspicious pointer arithmetic) disabled, it is reported when we increment base pointer in ngx_shm_alloc(). Maxim Dounin 3 years ago
5 changed file(s) with 14 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
779779 #endif
780780
781781 if (rn->nsrvs) {
782 for (i = 0; i < rn->nsrvs; i++) {
782 for (i = 0; i < (ngx_uint_t) rn->nsrvs; i++) {
783783 if (rn->u.srvs[i].name.data) {
784784 ngx_resolver_free_locked(r, rn->u.srvs[i].name.data);
785785 }
29582958 ngx_del_timer(ctx->event);
29592959 }
29602960
2961 for (i = 0; i < rn->nsrvs; i++) {
2961 for (i = 0; i < (ngx_uint_t) rn->nsrvs; i++) {
29622962 srvs[i].name.data = ngx_resolver_alloc(r, rn->u.srvs[i].name.len);
29632963 if (srvs[i].name.data == NULL) {
29642964 goto failed;
40764076 #endif
40774077
40784078 if (rn->nsrvs) {
4079 for (i = 0; i < rn->nsrvs; i++) {
4079 for (i = 0; i < (ngx_uint_t) rn->nsrvs; i++) {
40804080 if (rn->u.srvs[i].name.data) {
40814081 ngx_resolver_free_locked(r, rn->u.srvs[i].name.data);
40824082 }
42054205 d = 0;
42064206 }
42074207
4208 if (j == rn->naddrs) {
4208 if (j == (ngx_uint_t) rn->naddrs) {
42094209 j = 0;
42104210 }
4211 } while (++i < rn->naddrs);
4211 } while (++i < (ngx_uint_t) rn->naddrs);
42124212 }
42134213
42144214 #if (NGX_HAVE_INET6)
644644
645645 start = offset - (ngx_int_t) tables->min_match_len + 1;
646646
647 i = ngx_max(tables->index[c], ctx->index);
647 i = ngx_max((ngx_uint_t) tables->index[c], ctx->index);
648648 j = tables->index[c + 1];
649649
650650 while (i != j) {
977977 }
978978
979979 c = match[i].match.data[tables->min_match_len - 1];
980 while (ch <= c) {
980 while (ch <= (ngx_uint_t) c) {
981981 tables->index[ch++] = (u_char) i;
982982 }
983983 }
552552 return NGX_DECLINED;
553553 }
554554
555 if (h->crc32 != c->crc32 || h->header_start != c->header_start) {
555 if (h->crc32 != c->crc32 || (size_t) h->header_start != c->header_start) {
556556 ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
557557 "cache file \"%s\" has md5 collision", c->file.name.data);
558558 return NGX_DECLINED;
14941494 if (h.version != NGX_HTTP_CACHE_VERSION
14951495 || h.last_modified != c->last_modified
14961496 || h.crc32 != c->crc32
1497 || h.header_start != c->header_start
1498 || h.body_start != c->body_start)
1497 || (size_t) h.header_start != c->header_start
1498 || (size_t) h.body_start != c->body_start)
14991499 {
15001500 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
15011501 "http file cache \"%s\" content changed",
279279
280280 p = ngx_cpymem(p, conf->capability.data, conf->capability.len);
281281
282 p = ngx_cpymem(p, "250 STARTTLS" CRLF, sizeof("250 STARTTLS" CRLF) - 1);
282 ngx_memcpy(p, "250 STARTTLS" CRLF, sizeof("250 STARTTLS" CRLF) - 1);
283283
284284 p = conf->starttls_capability.data
285285 + (last - conf->capability.data) + 3;
117117
118118 /* unreferenced formal parameter */
119119 #pragma warn -8057
120
121 /* suspicious pointer arithmetic */
122 #pragma warn -8072
120123
121124 #endif
122125