Changeset 4 for abuse/trunk/src/imlib
- Timestamp:
- Nov 6, 2005, 11:39:38 AM (17 years ago)
- Location:
- abuse/trunk/src/imlib
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/imlib/dprint.cpp
r2 r4 21 21 if (dprint_fun) 22 22 { 23 char st[1000],a,*sp; 24 int y; 23 char st[1000]; 25 24 va_list ap; 26 25 -
abuse/trunk/src/imlib/filesel.cpp
r2 r4 57 57 int i=0; 58 58 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]); 60 60 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; 62 62 sx=0; 63 63 … … 103 103 int i=0; 104 104 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]); 106 106 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; 108 108 reconfigure(); 109 109 } -
abuse/trunk/src/imlib/fonts.cpp
r2 r4 37 37 void JCFont::put_char(image *screen, int x, int y, char ch, int color) 38 38 { 39 if (let[ ch])39 if (let[(int)ch]) 40 40 { 41 41 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); 44 44 } 45 45 } -
abuse/trunk/src/imlib/gifread.cpp
r2 r4 38 38 char buf[100],er; 39 39 unsigned char sep; 40 int ncolors;40 unsigned int ncolors; 41 41 FILE *fp; 42 42 image *im; -
abuse/trunk/src/imlib/include.cpp
r2 r4 6 6 char tmp_name[200]; 7 7 strcpy(tmp_name,name); 8 int j,append=0,i; 8 unsigned int j; 9 int append=0,i; 9 10 for (j=0;j<strlen(name);j++) 10 11 if (toupper(tmp_name[j])<'A' || toupper(tmp_name[j])>'Z') -
abuse/trunk/src/imlib/input.cpp
r2 r4 257 257 case JK_LEFT : if (cur) { draw_cur(wm->dark_color(),screen,wm); cur--; 258 258 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++; 260 260 draw_cur(wm->bright_color(),screen,wm); } break; 261 261 case JK_END : if (cur!=last_spot()) 262 262 { 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--; 264 264 draw_cur(wm->bright_color(),screen,wm); } break; 265 265 case JK_HOME : if (cur) … … 268 268 case JK_BACKSPACE : if (cur) 269 269 { 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++) 271 271 data[xx]=data[xx+1]; 272 272 data[strlen(format)-1]=' '; … … 281 281 data[xx]=data[xx-1]; 282 282 data[cur]=ev.key; 283 if (cur< strlen(format)-1)283 if (cur<(int)strlen(format)-1) 284 284 cur++; 285 285 data[strlen(format)]=0; … … 335 335 { 336 336 char num[20]; 337 sprintf(num,"% Lg",Data);337 sprintf(num,"%g",Data); 338 338 int slen=(strlen(Format)>strlen(num) ? strlen(Format) : strlen(num)); 339 339 x=X; y=Y; id=ID; -
abuse/trunk/src/imlib/jmalloc.cpp
r2 r4 169 169 for (;f;f=f->next); // scan through static big list 170 170 171 int i,bit ;171 int i,bit=1; 172 172 for (i=0;i<JM_SMALL_SIZE;i++) 173 173 { … … 215 215 { 216 216 fprintf(fp,"*** Small Block size = %d ***\n",i); 217 unsigned long x=0,bit=1;217 unsigned long bit=1; 218 218 char *addr=((char *)(s+1)); 219 219 for (int j=0;j<32;j++) … … 252 252 { 253 253 fprintf(fp,"*** Small Block size = %d ***\n",i); 254 unsigned long x=0,bit=1;254 unsigned long bit=1; 255 255 char *addr=((char *)(s+1)); 256 256 for (int j=0;j<32;j++) … … 348 348 } else 349 349 { 350 int bit=1,i=0 ,offset=0;350 int bit=1,i=0; 351 351 char *addr=((char *)s)+sizeof(small_block); 352 352 while (1) // we already know there is a bit free … … 380 380 s->size=-s->size; 381 381 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? 383 383 { 384 384 memory_node *p=(memory_node *)((char *)s+sizeof(memory_node)+size); … … 431 431 } else 432 432 { 433 int bit=1,i=0 ,offset=0;433 int bit=1,i=0; 434 434 char *addr=((char *)s)+sizeof(small_block); 435 435 while (1) // we already know there is a bit free … … 486 486 s->size=-s->size; 487 487 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? 489 489 { 490 490 memory_node *p=s; // store this position … … 882 882 char *reportpath; 883 883 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 ); 885 885 886 886 FILE *fp = fopen( reportpath, "wb" ); -
abuse/trunk/src/imlib/jwindow.cpp
r2 r4 176 176 if (red) 177 177 { 178 jwindow *j=ev.window ,*p;178 jwindow *j=ev.window; 179 179 /* screen->add_dirty(j->x,j->y,j->x+j->l-1,j->y+j->h-1); 180 180 for (p=first;p!=j;p=p->next) … … 283 283 jwindow *p,*q; 284 284 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; 287 287 288 288 if (has_mouse()) … … 427 427 ifield *input_manager::unlink(int id) // unlinks ID from fields list and return the pointer to it 428 428 { 429 for (ifield *i=first,*last ;i;i=i->next)429 for (ifield *i=first,*last=NULL;i;i=i->next) 430 430 { 431 431 if (i->id==id) -
abuse/trunk/src/imlib/keys.cpp
r2 r4 12 12 void key_name(int key, char *buffer) 13 13 { 14 static char sing[2];14 //static char sing[2]; 15 15 if( key > 255 && key <= JK_MAX_KEY ) 16 16 strcpy(buffer,jk_key_names[key-256]); -
abuse/trunk/src/imlib/lbmread.cpp
r2 r4 30 30 else 31 31 { 32 long offset=12,ssize;32 long ssize; 33 33 char stype[4]; 34 34 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; 36 36 37 37 while (ftell(fp)+4<size) … … 63 63 if (im) delete im; // shouldn't be two BODY's butjust in case... 64 64 im=new image(w,h); 65 int x,y;65 int y; 66 66 if (!compr) 67 67 { -
abuse/trunk/src/imlib/palette.cpp
r2 r4 482 482 brv=0; bri=0; 483 483 484 for (i=0;i< ncolors;i++)484 for (i=0;i<(unsigned int)ncolors;i++) 485 485 { if (all || used(i)) 486 486 { … … 502 502 brv=(long)258*(long)258*(long)258; bri=0; 503 503 504 for (i=0;i< ncolors;i++)504 for (i=0;i<(unsigned int)ncolors;i++) 505 505 { if (all || used(i)) 506 506 { -
abuse/trunk/src/imlib/pmenu.cpp
r2 r4 276 276 277 277 278 int total=0,t x,tw,i=0,x;278 int total=0,tw,i=0,x=0; 279 279 for (pmenu_item *pp=top;pp;pp=pp->next,i++) 280 280 { if (pp==p) x=i; -
abuse/trunk/src/imlib/scroller.cpp
r2 r4 348 348 { 349 349 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; 351 351 if (vert) { xa=0; ya=30; yo=x+5; yo=y+5; } else { xa=30; ya=0; xo=x+5; yo=y+5; } 352 352 for (int i=newx,c=0;c<30 && i<100;i++,c++) … … 391 391 392 392 for (i=0;i<t;i++) 393 if ( strlen(List[i])>wid)393 if ((int)strlen(List[i])>wid) 394 394 wid=strlen(List[i]); 395 395 cur_sel=sx=start_yoffset; … … 426 426 int found=-1; 427 427 if (key_hist_total<20) 428 key_hist[ key_hist_total++]=ev.key;428 key_hist[(int)(key_hist_total++)]=ev.key; 429 429 430 430 for (int i=0;i<t && found==-1;i++) 431 431 { 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) 433 433 found=i; 434 434 } … … 480 480 int tw=(l+tex->width()-1)/tex->width(); 481 481 int th=(h+tex->height()-1)/tex->height(); 482 int dy=y ,dx;482 int dy=y; 483 483 for (int j=0;j<th;j++,dy+=tex->height()) 484 484 for (int i=0,dx=x;i<tw;i++,dx+=tex->width()) -
abuse/trunk/src/imlib/specs.cpp
r2 r4 151 151 if (wbuf_end!=0) 152 152 { 153 long ret=unbuffered_write(wbuf,wbuf_end);153 unsigned long ret=unbuffered_write(wbuf,wbuf_end); 154 154 if (ret!=wbuf_end && no_space_handle_fun) 155 155 no_space_handle_fun(); … … 172 172 if (rbuf_start<rbuf_end) 173 173 { 174 int avail_size=rbuf_end-rbuf_start;174 unsigned int avail_size=rbuf_end-rbuf_start; 175 175 int copy_size=avail_size>count ? count : avail_size; 176 176 memcpy(buf,rbuf+rbuf_start,copy_size); … … 209 209 buf=(void *)(((char *)buf)+copy_size); 210 210 if (wbuf_end==wbuf_size) 211 if ( flush_writes()!=wbuf_size)211 if ((unsigned int)flush_writes()!=wbuf_size) 212 212 return total_written; 213 213 … … 217 217 } else 218 218 { 219 long ret=unbuffered_write(buf,count);219 unsigned long ret=unbuffered_write(buf,count); 220 220 if (ret!=count && no_space_handle_fun) 221 221 no_space_handle_fun(); … … 234 234 else if (whence==SEEK_END) offset=file_size()-offset; 235 235 236 if (offset<realpos- rbuf_end || offset>=realpos)236 if (offset<realpos-(long)rbuf_end || offset>=realpos) 237 237 { 238 238 rbuf_start=rbuf_end=0; … … 270 270 #if (defined(__APPLE__) && !defined(__MACH__)) 271 271 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);274 272 #else 275 273 spec_main_jfile.open_external(filename,"rb",O_RDONLY); 274 #endif 276 275 spec_main_fd = spec_main_jfile.get_fd(); 276 if (spec_main_fd==-1) 277 return; 277 278 spec_main_sd.startup(&spec_main_jfile); 278 #endif279 279 } 280 280 … … 335 335 { 336 336 skip_size=1; 337 int errval = unlink(tmp_name);337 //int errval = unlink(tmp_name); 338 338 } 339 339 … … 487 487 int jFILE::unbuffered_read(void *buf, size_t count) 488 488 { 489 long len;489 unsigned long len; 490 490 491 491 if (fd == spec_main_fd) … … 505 505 len = ::read(fd,(char*)buf,count); 506 506 ::write(fast_load_fd,(char*)&len,sizeof(len)); 507 ::write(fast_load_fd,(char*)buf, count);507 ::write(fast_load_fd,(char*)buf,len); 508 508 break; 509 509 case 2: … … 525 525 len = ::read(fd,(char*)buf,count); 526 526 ::write(fast_load_fd,(char*)&len,sizeof(len)); 527 ::write(fast_load_fd,(char*)buf, count);527 ::write(fast_load_fd,(char*)buf,len); 528 528 break; 529 529 case 2: … … 755 755 { 756 756 char buf[256]; 757 memset(buf,0,256); 757 758 fp->read(buf,8); 758 759 buf[9]=0; -
abuse/trunk/src/imlib/targa.cpp
r2 r4 55 55 int x,y; 56 56 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; 58 58 59 59 -
abuse/trunk/src/imlib/xwdread.cpp
r2 r4 140 140 X11WDFileHeader *h11P; 141 141 char junk[800]; 142 int i, dummy1, dummy2, dummy3; 142 unsigned int i; 143 int dummy1, dummy2, dummy3; 143 144 unsigned short minred, maxred; 144 145 X11XColor x11col;
Note: See TracChangeset
for help on using the changeset viewer.