Changeset 162


Ignore:
Timestamp:
Aug 11, 2009, 10:56:57 PM (12 years ago)
Author:
Sam Hocevar
Message:

Fix numerous compiler warnings.

Location:
abuse/trunk/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/cache.cpp

    r147 r162  
    511511    }
    512512   
    513     uint32_t tsaved=fp->read_uint32();
     513    int tsaved = fp->read_uint32();
    514514
    515515
     
    11931193void CacheList::free_oldest()
    11941194{
    1195   uint32_t i,old_time=last_access;
     1195  int32_t old_time = last_access;
    11961196  CacheItem *ci=list,*oldest=NULL;
    11971197  ful=1;
    11981198
    1199   for (i=0;i<total;i++,ci++)
    1200   {
    1201     if (ci->data && ci->last_access<old_time)
    1202     {
    1203       oldest=ci;
    1204       old_time=ci->last_access;
     1199  for (int i = 0; i < total; i++, ci++)
     1200  {
     1201    if (ci->data && ci->last_access < old_time)
     1202    {
     1203      oldest = ci;
     1204      old_time = ci->last_access;
    12051205    }
    12061206  }
  • abuse/trunk/src/director.cpp

    r124 r162  
    8585    dist=31;
    8686    if (y-y1<dist)
     87    {
    8788      if (y-y1<1) dist=0;
    8889      else dist=y-y1;
     90    }
    8991
    9092    if (y2-y<dist)
     93    {
    9194      if (y2-y<1) dist=0;
    9295      else dist=y2-y;
     96    }
    9397
    9498    int c=cmap[dist];
  • abuse/trunk/src/game.cpp

    r136 r162  
    193193            continue;
    194194
    195         if((unsigned)w >= xres - 1)
     195        if(w >= xres - 1)
    196196            w = xres - 2;
    197         if((unsigned)h >= yres - 1)
     197        if(h >= yres - 1)
    198198            h = yres - 2;
    199199        f->suggest.cx1 = (xres + 1) / 2 - w / 2;
  • abuse/trunk/src/imlib/palette.cpp

    r134 r162  
    261261  else if (ncolors==16)
    262262    for (i=0;i<ncolors;i++)
    263       set(i,255-i&3,255-(i&4)>>2,255-(i&8)>>3);
     263      set(i,255-(i&3),255-(i&4)>>2,255-(i&8)>>3);
    264264  else
    265265    for (i=0;i<ncolors;i++)
    266       set(i,255-i%3,255-(i+1)%3,255-(i+2)%3);
     266      set(i,255-(i%3),255-((i+1)%3),255-((i+2)%3));
    267267}
    268268
  • abuse/trunk/src/imlib/pmenu.cpp

    r131 r162  
    189189    x=cx2-w-parent->x;
    190190  if (h+y+parent->y>cy2)
     191  {
    191192    if (parent->y+parent->h+wm->font()->height()>cy2)
    192193      y=-h;
    193      else y=y-h+wm->font()->height()+5;
     194    else y=y-h+wm->font()->height()+5;
     195  }
    194196
    195197
  • abuse/trunk/src/imlib/specs.cpp

    r129 r162  
    433433  for (s=access_string;*s;s++)
    434434    if (toupper(*s)=='W')
     435    {
    435436      if (access)
    436437        access=O_RDWR;
    437438      else access=O_WRONLY;
     439    }
    438440
    439441  for (s=access_string;*s;s++)
     
    627629{
    628630  double a;
    629   write_uint32((long)(modf(x,&a)*(double)(1<<32-1)));
     631  write_uint32((long)(modf(x,&a)*(double)(1<<31)));
    630632  write_uint32((long)a);
    631633}
     
    636638  a=read_uint32();
    637639  b=read_uint32();
    638   return (double)b+a/(double)(1<<32-1);
     640  return (double)b+a/(double)(1<<31);
    639641}
    640642
  • abuse/trunk/src/imlib/video.hpp

    r57 r162  
    2424
    2525extern unsigned char current_background;
    26 extern unsigned int xres,yres;
     26extern int xres,yres;
    2727extern int xoff,yoff;
    2828extern image *screen;
  • abuse/trunk/src/lisp/lisp.cpp

    r133 r162  
    31153115void lisp_init(long perm_size, long tmp_size)
    31163116{
    3117   int i;
     3117  unsigned int i;
    31183118  lsym_root=NULL;
    31193119  total_user_functions=0;
  • abuse/trunk/src/loadgame.cpp

    r124 r162  
    9494  int w=cache.img(save_buts[0])->width();
    9595  int mx=last_demo_mx-w/2;
    96   if((unsigned)(mx + w + 10) > xres) mx = xres - w - 10;
    97   if( mx < 0) mx = 0;
     96  if(mx + w + 10 > xres) mx = xres - w - 10;
     97  if(mx < 0) mx = 0;
    9898
    9999  Jwindow *l_win=create_num_window(mx,MAX_SAVE_GAMES,NULL);
  • abuse/trunk/src/net/tcpip.cpp

    r150 r162  
    2828FILE *log_file=NULL;
    2929extern int net_start();
    30 void net_log(char *st, void *buf, long size)
     30
     31static void net_log(char const *st, void *buf, long size)
    3132{
    3233   
     
    4041
    4142
    42     fprintf(log_file,"%s%d - ",st,size);
     43    fprintf(log_file,"%s%ld - ",st,size);
    4344    int i;
    4445    for (i=0;i<size;i++)
     
    5051
    5152    for (i=0;i<size;i++)
    52     fprintf(log_file,"%02x, ",*((unsigned char *)buf+i),*((unsigned char *)buf+i));
     53    fprintf(log_file,"%02x, ",*((unsigned char *)buf+i));
    5354    fprintf(log_file,"\n");
    5455    fflush(log_file);
     
    193194        }
    194195        tmp[i] = num;
    195         if (*np == ':' & !force_port)
     196        if (*np == ':' && !force_port)
    196197        {
    197198            int x;
  • abuse/trunk/src/objects.cpp

    r129 r162  
    13711371      set_state(run_jump);
    13721372    if (xvel()!=0)
     1373    {
    13731374      if (direction>0)
    13741375        set_xvel(get_ability(type(),jump_top_speed));
    13751376      else
    13761377        set_xvel(-get_ability(type(),jump_top_speed));
     1378    }
    13771379    set_xacel(0);
    13781380
  • abuse/trunk/src/sdlport/setup.cpp

    r149 r162  
    4343keys_struct keys;
    4444
    45 extern unsigned int xres, yres;
     45extern int xres, yres;
    4646static unsigned int scale;
    4747
  • abuse/trunk/src/sdlport/video.cpp

    r142 r162  
    4343unsigned char current_background;
    4444int win_xscale, win_yscale, mouse_xscale, mouse_yscale;
    45 unsigned int xres, yres;
     45int xres, yres;
    4646
    4747extern palette *lastl;
     
    238238    Uint16 dinset;
    239239
    240     if((unsigned)y > yres || (unsigned)x > xres)
     240    if(y > yres || x > xres)
    241241        return;
    242242
     
    250250    }
    251251    srcrect.x = x1;
    252     if((unsigned)(x + (x2 - x1)) >= xres)
     252    if(x + (x2 - x1) >= xres)
    253253        xe = xres - x + x1 - 1;
    254254    else
     
    261261    }
    262262    srcrect.y = y1;
    263     if((unsigned)(y + (y2 - y1)) >= yres)
     263    if(y + (y2 - y1) >= yres)
    264264        ye = yres - y + y1 - 1;
    265265    else
Note: See TracChangeset for help on using the changeset viewer.