Changeset 2048

Show
Ignore:
Timestamp:
01/17/2008 10:27:47 AM (6 months ago)
Author:
glen
Message:

- shutup many compiler warnings. #1513

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/fdevent.c

    r1867 r2048  
    341341 
    342342int fdevent_poll(fdevents *ev, int timeout_ms) { 
    343         if (ev->poll == NULL) SEGFAULT("ev->poll is %p", ev->poll); 
     343        if (ev->poll == NULL) SEGFAULT("ev->poll is %p", (void*) (intptr_t) ev->poll); 
    344344        return ev->poll(ev, timeout_ms); 
    345345} 
     
    348348        size_t i; 
    349349 
    350         if (ev->get_revents == NULL) SEGFAULT("ev->get_revents is %p", ev->get_revents); 
     350        if (ev->get_revents == NULL) SEGFAULT("ev->get_revents is %p", (void*) (intptr_t)  ev->get_revents); 
    351351 
    352352        fdevent_revents_reset(revents); 
  • trunk/src/fdevent_select.c

    r1653 r2048  
    5555        /* we should be protected by max-fds, but you never know */ 
    5656#ifndef _WIN32 
    57         u_int i; 
    5857        assert(sock->fd < FD_SETSIZE); 
    5958#endif 
  • trunk/src/http_auth.c

    r1990 r2048  
    488488     * The password first, since that is what is most unknown 
    489489     */ 
    490     MD5_Update(&ctx, pw, strlen(pw)); 
     490    MD5_Update(&ctx, (const unsigned char*) pw, strlen(pw)); 
    491491 
    492492    /* 
    493493     * Then our magic string 
    494494     */ 
    495     MD5_Update(&ctx, APR1_ID, strlen(APR1_ID)); 
     495    MD5_Update(&ctx, (const unsigned char*) APR1_ID, strlen(APR1_ID)); 
    496496 
    497497    /* 
    498498     * Then the raw salt 
    499499     */ 
    500     MD5_Update(&ctx, sp, sl); 
     500    MD5_Update(&ctx, (const unsigned char*) sp, sl); 
    501501 
    502502    /* 
     
    504504     */ 
    505505    MD5_Init(&ctx1); 
    506     MD5_Update(&ctx1, pw, strlen(pw)); 
    507     MD5_Update(&ctx1, sp, sl); 
    508     MD5_Update(&ctx1, pw, strlen(pw)); 
     506    MD5_Update(&ctx1, (const unsigned char*) pw, strlen(pw)); 
     507    MD5_Update(&ctx1, (const unsigned char*) sp, sl); 
     508    MD5_Update(&ctx1, (const unsigned char*) pw, strlen(pw)); 
    509509    MD5_Final(final, &ctx1); 
    510510    for (pl = strlen(pw); pl > 0; pl -= APR_MD5_DIGESTSIZE) { 
     
    526526        } 
    527527        else { 
    528             MD5_Update(&ctx, pw, 1); 
     528            MD5_Update(&ctx, (const unsigned char*) pw, 1); 
    529529        } 
    530530    } 
     
    548548        MD5_Init(&ctx1); 
    549549        if (i & 1) { 
    550             MD5_Update(&ctx1, pw, strlen(pw)); 
     550            MD5_Update(&ctx1, (const unsigned char*) pw, strlen(pw)); 
    551551        } 
    552552        else { 
     
    554554        } 
    555555        if (i % 3) { 
    556             MD5_Update(&ctx1, sp, sl); 
     556            MD5_Update(&ctx1, (const unsigned char*) sp, sl); 
    557557        } 
    558558 
    559559        if (i % 7) { 
    560             MD5_Update(&ctx1, pw, strlen(pw)); 
     560            MD5_Update(&ctx1, (const unsigned char*) pw, strlen(pw)); 
    561561        } 
    562562 
     
    565565        } 
    566566        else { 
    567             MD5_Update(&ctx1, pw, strlen(pw)); 
     567            MD5_Update(&ctx1, (const unsigned char*) pw, strlen(pw)); 
    568568        } 
    569569        MD5_Final(final,&ctx1); 
  • trunk/src/lemon.c

    r1349 r2048  
    1212#include <ctype.h> 
    1313#include <stdlib.h> 
     14#include <unistd.h> 
    1415 
    1516extern void qsort(); 
     
    977978** function won't work if apx->type==REDUCE and apy->type==SHIFT. 
    978979*/ 
    979 static int resolve_conflict(apx,apy,errsym
     980static int resolve_conflict(apx,apy
    980981struct action *apx; 
    981982struct action *apy; 
    982 struct symbol *errsym;   /* The error symbol (if defined.  NULL otherwise) */ 
    983983{ 
    984984  struct symbol *spx, *spy; 
     
    13271327char **argv; 
    13281328{ 
     1329  ( (void) argc ); // UNUSED(argc) 
    13291330  static int version = 0; 
    13301331  static int rpflag = 0; 
     
    16521653    *((int*)op[j].arg) = v; 
    16531654  }else if( op[j].type==OPT_FFLAG ){ 
    1654     (*(void(*)())(op[j].arg))(v); 
     1655    (*(void(*)())((intptr_t)op[j].arg))(v); 
    16551656  }else{ 
    16561657    if( err ){ 
     
    17341735        break; 
    17351736      case OPT_FDBL: 
    1736         (*(void(*)())(op[j].arg))(dv); 
     1737        (*(void(*)())((intptr_t)op[j].arg))(dv); 
    17371738        break; 
    17381739      case OPT_INT: 
     
    17401741        break; 
    17411742      case OPT_FINT: 
    1742         (*(void(*)())(op[j].arg))((int)lv); 
     1743        (*(void(*)())((intptr_t)op[j].arg))((int)lv); 
    17431744        break; 
    17441745      case OPT_STR: 
     
    17461747        break; 
    17471748      case OPT_FSTR: 
    1748         (*(void(*)())(op[j].arg))(sv); 
     1749        (*(void(*)())((intptr_t)op[j].arg))(sv); 
    17491750        break; 
    17501751    } 
  • trunk/src/lempar.c

    r1349 r2048  
    211211const char *ParseTokenName(int tokenType){ 
    212212#ifndef NDEBUG 
    213   if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ 
     213  if( tokenType>0 && ((unsigned int)tokenType)<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ 
    214214    return yyTokenName[tokenType]; 
    215215  }else{ 
     
    336336  } 
    337337  i += iLookAhead; 
    338   if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 
     338  if( i<0 || (unsigned int)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 
    339339#ifdef YYFALLBACK 
    340340    int iFallback;            /* Fallback token */ 
     
    379379  } 
    380380  i += iLookAhead; 
    381   if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 
     381  if( i<0 || (unsigned int)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 
    382382    return yy_default[stateno]; 
    383383  }else{ 
     
    457457#ifndef NDEBUG 
    458458  if( yyTraceFILE && yyruleno>=0 
    459         && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ 
     459        && (unsigned int) yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ 
    460460    fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, 
    461461      yyRuleName[yyruleno]); 
     
    512512  YYMINORTYPE yyminor            /* The minor type of the error token */ 
    513513){ 
     514  ( (void) yymajor ); 
     515  ( (void) yyminor ); 
    514516  ParseARG_FETCH; 
    515517#define TOKEN (yyminor.yy0) 
  • trunk/src/log.c

    r1959 r2048  
    322322                va_end(ap); 
    323323 
    324                 if (l > -1 && l < b->size) { 
     324                if (l > -1 && ((unsigned int) l) < b->size) { 
    325325                        b->used = l + 1; 
    326326 
  • trunk/src/mod_sql_vhost_core.c

    r1885 r2048  
    334334#ifdef HAVE_GLIB_H 
    335335static gboolean cached_vhost_remove_expired(gpointer _key, gpointer _val, gpointer data) { 
    336         buffer *key       = _key; 
     336//      buffer *key       = _key; 
     337        UNUSED(_key); 
    337338        cached_vhost *val = _val; 
    338339        server *srv       = data; 
  • trunk/src/plugin.c

    r1832 r2048  
    299299#else 
    300300#if 1 
    301                 init = (int (*)(plugin *))dlsym(p->lib, srv->tmp_buf->ptr); 
     301                init = (int (*)(plugin *))(intptr_t)dlsym(p->lib, srv->tmp_buf->ptr); 
    302302#else 
    303303                *(void **)(&init) = dlsym(p->lib, srv->tmp_buf->ptr); 
  • trunk/src/server.c

    r2010 r2048  
    114114        case SIGTERM:  
    115115                srv_shutdown = 1;  
    116                 memcpy(&last_sigterm_info, si, sizeof(*si)); 
     116                memcpy((siginfo_t*) &last_sigterm_info, si, sizeof(*si)); 
    117117                break; 
    118118        case SIGINT: 
     
    123123                } 
    124124 
    125                 memcpy(&last_sigterm_info, si, sizeof(*si)); 
     125                memcpy((siginfo_t*) &last_sigterm_info, si, sizeof(*si)); 
    126126 
    127127                break; 
     
    131131        case SIGHUP:  
    132132                handle_sig_hup = 1;  
    133                 memcpy(&last_sighup_info, si, sizeof(*si)); 
     133                memcpy((siginfo_t*) &last_sighup_info, si, sizeof(*si)); 
    134134                break; 
    135135        case SIGCHLD:  
     
    10371037        GThread **stat_cache_threads; 
    10381038        GThread **aio_write_threads = NULL; 
     1039#ifdef USE_LINUX_AIO_SENDFILE 
    10391040        GThread *linux_aio_read_thread_id = NULL; 
     1041#endif 
    10401042        GThread * joblist_queue_thread_id = NULL; 
    10411043        GError *gerr = NULL; 
  • trunk/src/stat_cache.c

    r1964 r2048  
    195195#ifdef HAVE_GLIB_H 
    196196gboolean stat_cache_free_hrfunc(gpointer _key, gpointer _value, gpointer _user_data) { 
     197        UNUSED(_user_data); 
    197198        stat_cache_entry *sce = _value; 
    198199        buffer *b = _key; 
     
    244245        case STAT_CACHE_ENGINE_INOTIFY: 
    245246                return stat_cache_handle_fdevent_inotify(_srv, _fce, revent); 
     247#else 
     248        UNUSED(_fce); 
     249        UNUSED(revent); 
    246250#endif 
    247251        default: 
     
    263267 
    264268static int stat_cache_entry_is_current(server *srv, stat_cache_entry *sce) { 
     269        UNUSED(srv); 
     270        UNUSED(sce); 
    265271        return 1; 
    266272}