I'm not a particularly good c programmer.
In fact, I've really only got a basic grasp
and don't fully understand pointers. I'm
getting some compile errors:
bash-2.04$ make LINUX=1
d_netfil.c: In function `FiletxTicker':
d_netfil.c:479: invalid initializer
d_netfil.c:488: invalid operands to binary >
d_netfil.c:490: incompatible types in assignment
make: *** [../objs/d_netfil.o] Error 1
The 'offending code' is:
#ifdef __OS2__
fpos_t size64;
#else
fpos_t size64=0;
#endif
transfer[i].currentfile=fopen(f->filename,"rb");
if(!transfer[i].currentfile)
I_Error("File %s not exist",f->filename);
fseek(transfer[i].currentfile,0,SEEK_END);
size=fgetpos(transfer[i].currentfile,&size64);
// WARNING fpos_t 64bit in some OS
#ifndef __OS2__
if(size64>MAXINT)
I_Error("Error : %s is too large\n",f->filename);
f->size=size64;
#else
f->size=size64._pos;
#endif
I'm compiling under i386/Linux.
Any takers?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is due to large file support in newer versions of Linux and glibc. The code needs to be changed to fopen() the file, do an fseek() and then fgetpos(). The fpos_t is supposed to be opaque AFAIK, i.e. you shouldn't make any assumptions about it as it may be a structure.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
all right, flame away...
I'm not a particularly good c programmer.
In fact, I've really only got a basic grasp
and don't fully understand pointers. I'm
getting some compile errors:
bash-2.04$ make LINUX=1
d_netfil.c: In function `FiletxTicker':
d_netfil.c:479: invalid initializer
d_netfil.c:488: invalid operands to binary >
d_netfil.c:490: incompatible types in assignment
make: *** [../objs/d_netfil.o] Error 1
The 'offending code' is:
#ifdef __OS2__
fpos_t size64;
#else
fpos_t size64=0;
#endif
transfer[i].currentfile=fopen(f->filename,"rb");
if(!transfer[i].currentfile)
I_Error("File %s not exist",f->filename);
fseek(transfer[i].currentfile,0,SEEK_END);
size=fgetpos(transfer[i].currentfile,&size64);
// WARNING fpos_t 64bit in some OS
#ifndef __OS2__
if(size64>MAXINT)
I_Error("Error : %s is too large\n",f->filename);
f->size=size64;
#else
f->size=size64._pos;
#endif
I'm compiling under i386/Linux.
Any takers?
This is due to large file support in newer versions of Linux and glibc. The code needs to be changed to fopen() the file, do an fseek() and then fgetpos(). The fpos_t is supposed to be opaque AFAIK, i.e. you shouldn't make any assumptions about it as it may be a structure.
It's fixed now in the cvs repository.