Ignore:
Timestamp:
Nov 6, 2005, 11:39:38 AM (17 years ago)
Author:
Sam Hocevar
Message:
  • debian patches
Location:
abuse/trunk/src/imlib
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/dprint.cpp

    r2 r4  
    2121        if (dprint_fun)
    2222        {
    23                 char st[1000],a,*sp;
    24                 int y;
     23                char st[1000];
    2524                va_list ap;
    2625
  • abuse/trunk/src/imlib/filesel.cpp

    r2 r4  
    5757      int i=0;
    5858      for (;i<tf;i++)
    59       if (strlen(f[i])>wid) wid=strlen(f[i]);
     59      if ((int)strlen(f[i])>wid) wid=strlen(f[i]);
    6060      for (i=0;i<td;i++)
    61       if (strlen(d[i])+2>wid) wid=strlen(d[i])+2;
     61      if ((int)strlen(d[i])+2>wid) wid=strlen(d[i])+2;
    6262      sx=0;
    6363
     
    103103  int i=0;
    104104  for (;i<tf;i++)
    105     if (strlen(f[i])>wid) wid=strlen(f[i]);
     105    if ((int)strlen(f[i])>wid) wid=strlen(f[i]);
    106106  for (i=0;i<td;i++)
    107     if (strlen(d[i])+2>wid) wid=strlen(d[i])+2;
     107    if ((int)strlen(d[i])+2>wid) wid=strlen(d[i])+2;
    108108  reconfigure(); 
    109109}
  • abuse/trunk/src/imlib/fonts.cpp

    r2 r4  
    3737void JCFont::put_char(image *screen,  int x, int y, char ch, int color)
    3838{
    39   if (let[ch])
     39  if (let[(int)ch])
    4040  {
    4141    if (color>=0)
    42       let[ch]->put_color(screen,x,y,color);
    43     else let[ch]->put_image(screen,x,y);
     42      let[(int)ch]->put_color(screen,x,y,color);
     43    else let[(int)ch]->put_image(screen,x,y);
    4444  }
    4545}
  • abuse/trunk/src/imlib/gifread.cpp

    r2 r4  
    3838  char buf[100],er;
    3939  unsigned char sep;
    40   int ncolors;
     40  unsigned int ncolors;
    4141  FILE *fp;
    4242  image *im;
  • abuse/trunk/src/imlib/include.cpp

    r2 r4  
    66  char tmp_name[200];
    77  strcpy(tmp_name,name);
    8   int j,append=0,i;
     8  unsigned int j;
     9  int append=0,i;
    910  for (j=0;j<strlen(name);j++)
    1011    if (toupper(tmp_name[j])<'A' || toupper(tmp_name[j])>'Z')
  • abuse/trunk/src/imlib/input.cpp

    r2 r4  
    257257      case JK_LEFT : if (cur) { draw_cur(wm->dark_color(),screen,wm); cur--;
    258258                           draw_cur(wm->bright_color(),screen,wm); } break;
    259       case JK_RIGHT : if (cur<strlen(format)-1) { draw_cur(wm->dark_color(),screen,wm); cur++;
     259      case JK_RIGHT : if (cur<(int)strlen(format)-1) { draw_cur(wm->dark_color(),screen,wm); cur++;
    260260                           draw_cur(wm->bright_color(),screen,wm); } break;
    261261      case JK_END : if (cur!=last_spot())
    262262                          { draw_cur(wm->dark_color(),screen,wm); cur=last_spot();
    263                             if (cur==strlen(format)-1) cur--;
     263                            if (cur==(int)strlen(format)-1) cur--;
    264264                           draw_cur(wm->bright_color(),screen,wm); } break;
    265265      case JK_HOME : if (cur)
     
    268268      case JK_BACKSPACE : if (cur)
    269269         { draw_cur(wm->dark_color(),screen,wm); cur--;
    270            for (xx=cur;xx<strlen(format)-1;xx++)
     270           for (xx=cur;xx<(int)strlen(format)-1;xx++)
    271271             data[xx]=data[xx+1];
    272272           data[strlen(format)-1]=' ';
     
    281281             data[xx]=data[xx-1];
    282282           data[cur]=ev.key;
    283            if (cur<strlen(format)-1)
     283           if (cur<(int)strlen(format)-1)
    284284             cur++;
    285285           data[strlen(format)]=0;
     
    335335{
    336336  char num[20];
    337   sprintf(num,"%Lg",Data); 
     337  sprintf(num,"%g",Data); 
    338338  int slen=(strlen(Format)>strlen(num) ? strlen(Format) : strlen(num));
    339339  x=X; y=Y; id=ID;
  • abuse/trunk/src/imlib/jmalloc.cpp

    r2 r4  
    169169  for (;f;f=f->next);               // scan through static big list
    170170
    171   int i,bit;
     171  int i,bit=1;
    172172  for (i=0;i<JM_SMALL_SIZE;i++)
    173173  {
     
    215215    {     
    216216      fprintf(fp,"*** Small Block size = %d ***\n",i);     
    217       unsigned long x=0,bit=1;
     217      unsigned long bit=1;
    218218      char *addr=((char *)(s+1));
    219219      for (int j=0;j<32;j++)
     
    252252    {     
    253253      fprintf(fp,"*** Small Block size = %d ***\n",i);     
    254       unsigned long x=0,bit=1;
     254      unsigned long bit=1;
    255255      char *addr=((char *)(s+1));
    256256      for (int j=0;j<32;j++)
     
    348348    } else
    349349    {
    350       int bit=1,i=0,offset=0;
     350      int bit=1,i=0;
    351351      char *addr=((char *)s)+sizeof(small_block);
    352352      while (1)        // we already know there is a bit free
     
    380380  s->size=-s->size;
    381381
    382   if (s->size-size>sizeof(memory_node)+4)  // is there enough space to split the block?
     382  if (s->size-size>(int)sizeof(memory_node)+4)  // is there enough space to split the block?
    383383  {   
    384384    memory_node *p=(memory_node *)((char *)s+sizeof(memory_node)+size);
     
    431431    } else
    432432    {
    433       int bit=1,i=0,offset=0;
     433      int bit=1,i=0;
    434434      char *addr=((char *)s)+sizeof(small_block);
    435435      while (1)        // we already know there is a bit free
     
    486486  s->size=-s->size;
    487487
    488   if (s->size-size>sizeof(memory_node)+4)  // is there enough space to split the block?
     488  if (s->size-size>(int)sizeof(memory_node)+4)  // is there enough space to split the block?
    489489  {
    490490    memory_node *p=s;    // store this position
     
    882882        char *reportpath;
    883883        reportpath = (char *)jmalloc( strlen( get_save_filename_prefix() ) + strlen( filename ), "reportpath" );
    884         sprintf( reportpath, "%s%s\0", get_save_filename_prefix(), filename );
     884        sprintf( reportpath, "%s%s", get_save_filename_prefix(), filename );
    885885
    886886        FILE *fp = fopen( reportpath, "wb" );
  • abuse/trunk/src/imlib/jwindow.cpp

    r2 r4  
    176176        if (red)
    177177        {
    178           jwindow *j=ev.window,*p;
     178          jwindow *j=ev.window;
    179179/*        screen->add_dirty(j->x,j->y,j->x+j->l-1,j->y+j->h-1);
    180180          for (p=first;p!=j;p=p->next)
     
    283283  jwindow *p,*q;
    284284
    285   int mx,my,but;
    286   image *mouse_pic,*mouse_save;
     285  int mx=0,my=0;
     286  image *mouse_pic=NULL,*mouse_save=NULL;
    287287 
    288288  if (has_mouse())
     
    427427ifield *input_manager::unlink(int id)     // unlinks ID from fields list and return the pointer to it
    428428{
    429   for (ifield *i=first,*last;i;i=i->next)
     429  for (ifield *i=first,*last=NULL;i;i=i->next)
    430430  {
    431431    if (i->id==id)
  • abuse/trunk/src/imlib/keys.cpp

    r2 r4  
    1212void key_name(int key, char *buffer)
    1313{
    14         static char sing[2];
     14        //static char sing[2];
    1515        if( key > 255 && key <= JK_MAX_KEY )
    1616                strcpy(buffer,jk_key_names[key-256]);
  • abuse/trunk/src/imlib/lbmread.cpp

    r2 r4  
    3030    else
    3131    {
    32       long offset=12,ssize;   
     32      long ssize;   
    3333      char stype[4];
    3434      short w=0,h=0,x,y,tcolor,pagew,pageh;
    35       char planes,masking,compr,padl,xa,ya;
     35      char planes,masking,compr=0,padl,xa,ya;
    3636     
    3737      while (ftell(fp)+4<size)
     
    6363          if (im) delete im;  // shouldn't be two BODY's butjust in case...
    6464          im=new image(w,h);
    65           int x,y;
     65          int y;
    6666          if (!compr)
    6767          {
  • abuse/trunk/src/imlib/palette.cpp

    r2 r4  
    482482  brv=0; bri=0;
    483483
    484   for (i=0;i<ncolors;i++)
     484  for (i=0;i<(unsigned int)ncolors;i++)
    485485  { if (all || used(i))
    486486    {
     
    502502  brv=(long)258*(long)258*(long)258; bri=0;
    503503
    504   for (i=0;i<ncolors;i++)
     504  for (i=0;i<(unsigned int)ncolors;i++)
    505505  { if (all || used(i))
    506506    {
  • abuse/trunk/src/imlib/pmenu.cpp

    r2 r4  
    276276 
    277277
    278   int total=0,tx,tw,i=0,x;
     278  int total=0,tw,i=0,x=0;
    279279  for (pmenu_item *pp=top;pp;pp=pp->next,i++)
    280280  { if (pp==p) x=i;
  • abuse/trunk/src/imlib/scroller.cpp

    r2 r4  
    348348{
    349349  screen->bar(x,y,x+l-1,y+h-1,wm->black());
    350   int xa,ya,xo,yo;
     350  int xa,ya,xo=0,yo;
    351351  if (vert) { xa=0; ya=30; yo=x+5; yo=y+5; } else { xa=30; ya=0; xo=x+5; yo=y+5; }
    352352  for (int i=newx,c=0;c<30 && i<100;i++,c++)
     
    391391
    392392  for (i=0;i<t;i++)
    393     if (strlen(List[i])>wid)
     393    if ((int)strlen(List[i])>wid)
    394394      wid=strlen(List[i]);
    395395  cur_sel=sx=start_yoffset;
     
    426426    int found=-1;
    427427    if (key_hist_total<20)
    428       key_hist[key_hist_total++]=ev.key;
     428      key_hist[(int)(key_hist_total++)]=ev.key;
    429429
    430430    for (int i=0;i<t && found==-1;i++)
    431431    {
    432       if (strlen(lis[i].name)>=key_hist_total && memcmp(lis[i].name,key_hist,key_hist_total)==0)
     432      if ((int)strlen(lis[i].name)>=key_hist_total && memcmp(lis[i].name,key_hist,key_hist_total)==0)
    433433        found=i;
    434434    }
     
    480480    int tw=(l+tex->width()-1)/tex->width();
    481481    int th=(h+tex->height()-1)/tex->height();
    482     int dy=y,dx;
     482    int dy=y;
    483483    for (int j=0;j<th;j++,dy+=tex->height())
    484484      for (int i=0,dx=x;i<tw;i++,dx+=tex->width())     
  • abuse/trunk/src/imlib/specs.cpp

    r2 r4  
    151151  if (wbuf_end!=0)
    152152  {
    153     long ret=unbuffered_write(wbuf,wbuf_end);
     153    unsigned long ret=unbuffered_write(wbuf,wbuf_end);
    154154    if (ret!=wbuf_end && no_space_handle_fun)
    155155      no_space_handle_fun();
     
    172172    if (rbuf_start<rbuf_end)
    173173    {
    174       int avail_size=rbuf_end-rbuf_start;
     174      unsigned int avail_size=rbuf_end-rbuf_start;
    175175      int copy_size=avail_size>count ? count : avail_size;
    176176      memcpy(buf,rbuf+rbuf_start,copy_size);
     
    209209      buf=(void *)(((char *)buf)+copy_size);
    210210      if (wbuf_end==wbuf_size)
    211         if (flush_writes()!=wbuf_size)
     211        if ((unsigned int)flush_writes()!=wbuf_size)
    212212          return total_written;
    213213     
     
    217217  } else
    218218  {
    219     long ret=unbuffered_write(buf,count);
     219    unsigned long ret=unbuffered_write(buf,count);
    220220    if (ret!=count && no_space_handle_fun)
    221221      no_space_handle_fun();
     
    234234  else if (whence==SEEK_END) offset=file_size()-offset;
    235235
    236   if (offset<realpos-rbuf_end || offset>=realpos)
     236  if (offset<realpos-(long)rbuf_end || offset>=realpos)
    237237  {
    238238    rbuf_start=rbuf_end=0;
     
    270270#if (defined(__APPLE__) && !defined(__MACH__))
    271271  spec_main_jfile.open_external(filename,"rb",O_BINARY|O_RDONLY);
    272   spec_main_fd = spec_main_jfile.get_fd();
    273   spec_main_sd.startup(&spec_main_jfile);
    274272#else
    275273  spec_main_jfile.open_external(filename,"rb",O_RDONLY);
     274#endif
    276275  spec_main_fd = spec_main_jfile.get_fd();
     276  if (spec_main_fd==-1)
     277    return;
    277278  spec_main_sd.startup(&spec_main_jfile);
    278 #endif
    279279}
    280280
     
    335335    {
    336336      skip_size=1;
    337       int errval = unlink(tmp_name);
     337      //int errval = unlink(tmp_name);
    338338    }
    339339
     
    487487int jFILE::unbuffered_read(void *buf, size_t count)
    488488{
    489         long len;
     489        unsigned long len;
    490490
    491491        if (fd == spec_main_fd)
     
    505505                        len = ::read(fd,(char*)buf,count);
    506506                        ::write(fast_load_fd,(char*)&len,sizeof(len));
    507                         ::write(fast_load_fd,(char*)buf,count);
     507                        ::write(fast_load_fd,(char*)buf,len);
    508508                        break;
    509509                case 2:
     
    525525                len = ::read(fd,(char*)buf,count);
    526526                        ::write(fast_load_fd,(char*)&len,sizeof(len));
    527                         ::write(fast_load_fd,(char*)buf,count);
     527                        ::write(fast_load_fd,(char*)buf,len);
    528528                break;
    529529                case 2:
     
    755755{
    756756  char buf[256];
     757  memset(buf,0,256);
    757758  fp->read(buf,8);
    758759  buf[9]=0;
  • abuse/trunk/src/imlib/targa.cpp

    r2 r4  
    5555  int x,y;
    5656  unsigned char ctrl;
    57   unsigned char bgra[4],*sl,c,lr,lg,lb,ll=0,lc;
     57  unsigned char bgra[4],*sl,c,lr=0,lg=0,lb=0,ll=0,lc=0;
    5858 
    5959 
  • abuse/trunk/src/imlib/xwdread.cpp

    r2 r4  
    140140  X11WDFileHeader *h11P;
    141141  char junk[800];
    142   int i, dummy1, dummy2, dummy3;
     142  unsigned int i;
     143  int dummy1, dummy2, dummy3;
    143144  unsigned  short minred, maxred;
    144145  X11XColor x11col;
Note: See TracChangeset for help on using the changeset viewer.