Ignore:
Timestamp:
Nov 10, 2005, 9:41:13 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • absolute shitloads of 64 bit fixes.
File:
1 edited

Legend:

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

    r2 r17  
    99{
    1010  image *im,*sub;
    11   unsigned short length,y;
    12   unsigned char size,first,width,height,gsize,last;
     11  uint16_t length,y;
     12  uint8_t size,first,width,height,gsize,last;
    1313  FILE *fp;
    1414  fp=fopen(fn,"rb");
    1515  if (!fp) return NULL;
    16   fread(&length,1,2,fp);  length=int_to_local(length);
     16  fread(&length,1,2,fp);  length=uint16_to_local(length);
    1717  fread(&size,1,1,fp);
    1818  fread(&first,1,1,fp);
     
    4545  image *im;
    4646  char x[4],bpp;
    47   unsigned char *sl=NULL,esc,c,n,marker,vmode;
    48   unsigned short w,h,len,bufsize,blocks,sn,esize,edesc;
     47  uint8_t *sl=NULL,esc,c,n,marker,vmode;
     48  uint16_t w,h,len,bufsize,blocks,sn,esize,edesc;
    4949  int xx,yy;
    5050  FILE *fp;
     
    5555  fread(&w,1,2,fp);
    5656  fread(&h,1,2,fp);
    57   w=int_to_local(w);  h=int_to_local(h);
     57  w=uint16_to_local(w);  h=uint16_to_local(h);
    5858  fread(x,1,4,fp);
    5959  fread(&bpp,1,1,fp);
     
    6666  fread(&vmode,1,1,fp);
    6767  fread(&edesc,1,2,fp);
    68   edesc=int_to_local(edesc);
     68  edesc=uint16_to_local(edesc);
    6969  fread(&esize,1,2,fp);
    70   esize=int_to_local(esize);
     70  esize=uint16_to_local(esize);
    7171  if (esize==768 && !pal)
    7272  { pal=new palette(1<<bpp);
     
    7777    fseek(fp,esize,SEEK_CUR);
    7878  fread(&blocks,1,2,fp);
    79   blocks=int_to_local(blocks);
     79  blocks=uint16_to_local(blocks);
    8080
    8181  yy=h; xx=w;
     
    8484  {
    8585    fread(&bufsize,1,2,fp);
    86     bufsize=int_to_local(bufsize);
     86    bufsize=uint16_to_local(bufsize);
    8787    fread(&len,1,2,fp);
    88     len=int_to_local(len);
     88    len=uint16_to_local(len);
    8989    fread(&esc,1,1,fp);
    9090    while (yy>=0 && len)
     
    113113        {
    114114          fread(&sn,1,2,fp);
    115           sn=int_to_local(sn);
     115          sn=uint16_to_local(sn);
    116116          fread(&c,1,1,fp);
    117117          while (sn-- && yy>=0 && len)
Note: See TracChangeset for help on using the changeset viewer.