nginx-0.4.14

Igor Sysoev is at rambler-co.ru
Mon Nov 27 23:04:37 MSK 2006


On Mon, 27 Nov 2006, Max Tsvetkov wrote:

>> Изменения в nginx 0.4.14
>> 27.11.2006
> не собирается :(
> 0.4.13 - собирается
>
> gcc -c -O -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter
> -Wno-unused-function -Wunused-variable -Wunused-value -Werror -g  -I
> src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
>        -o objs/src/core/ngx_slab.o \
>        src/core/ngx_slab.c
> cc1: warnings being treated as errors
> src/core/ngx_slab.c: In function 'ngx_slab_alloc':
> src/core/ngx_slab.c:285: warning: left shift count >= width of type
> src/core/ngx_slab.c:290: warning: left shift count >= width of type
> src/core/ngx_slab.c:372: warning: left shift count >= width of type
> make[1]: *** [objs/src/core/ngx_slab.o] Ошибка 1
> make[1]: Leaving directory `/usr/src/nginx-0.4.14'
> make: *** [build] Ошибка 2
>
> uname -a
> Linux ----.ru 2.6.12-12mdksmp #1 SMP Fri Sep 9 17:20:34 CEST 2005 x86_64
> Intel(R) Pentium(R) D CPU 2.80GHz unknown GNU/Linux
>
> ./configure --prefix=/opt/nginx --with-http_stub_status_module
> --with-http_realip_module

Патч для 64-битных платформ.


Игорь Сысоев
http://sysoev.ru
-------------- next part --------------
Index: src/core/ngx_slab.c
===================================================================
--- src/core/ngx_slab.c	(revision 194)
+++ src/core/ngx_slab.c	(working copy)
@@ -149,8 +149,8 @@
 ngx_slab_alloc(ngx_slab_pool_t *pool, size_t size)
 {
     size_t            s;
-    uintptr_t         p, mask, *bitmap;
-    ngx_uint_t        i, n, m, slot, shift, map;
+    uintptr_t         p, n, m, mask, *bitmap;
+    ngx_uint_t        i, slot, shift, map;
     ngx_slab_page_t  *page, *prev, *slots;
 
     ngx_shmtx_lock(&pool->mutex);
@@ -287,7 +287,7 @@
             do {
                 if ((page->slab & NGX_SLAB_MAP_MASK) != mask) {
 
-                    for (m = 1 << NGX_SLAB_MAP_SHIFT, i = 0;
+                    for (m = (uintptr_t) 1 << NGX_SLAB_MAP_SHIFT, i = 0;
                          m & mask;
                          m <<= 1, i++)
                     {
@@ -369,7 +369,7 @@
 
         } else { /* size < ngx_pagesize */
 
-            page->slab = (1 << NGX_SLAB_MAP_SHIFT) | shift;
+            page->slab = ((uintptr_t) 1 << NGX_SLAB_MAP_SHIFT) | shift;
             page->next = &slots[slot];
             page->prev = (uintptr_t) &slots[slot] | NGX_SLAB_BIG;
 


More information about the nginx-ru mailing list