remove gcc4-only warning option

master
leitner 20 years ago
parent 05bf627d01
commit 9405f1271b

@ -18,7 +18,7 @@ CC=gcc
CFLAGS=-pipe -W -Wall -O2 -fomit-frame-pointer CFLAGS=-pipe -W -Wall -O2 -fomit-frame-pointer
#CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall #CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall
CFLAGS += -fstrict-aliasing -Wstrict-aliasing=2 # CFLAGS += -fstrict-aliasing -Wstrict-aliasing=2
# startrip # startrip
ifneq ($(DEBUG),) ifneq ($(DEBUG),)

@ -25,6 +25,6 @@ void* array_get(array* x,uint64 membersize,int64 pos) {
if (__unlikely(pos+1<1)) return 0; if (__unlikely(pos+1<1)) return 0;
if (__unlikely(!umult64(membersize,pos,&wanted))) return 0; if (__unlikely(!umult64(membersize,pos,&wanted))) return 0;
if (__unlikely(wanted >= x->allocated)) return 0; if (__unlikely((int64)wanted >= x->allocated)) return 0;
return x->p+pos*membersize; return x->p+pos*membersize;
} }

@ -17,7 +17,7 @@ int64 io_mmapwritefile(int64 out,int64 in,uint64 off,uint64 bytes,io_write_callb
io_entry* e=array_get(&io_fds,sizeof(io_entry),out); io_entry* e=array_get(&io_fds,sizeof(io_entry),out);
if (e) { if (e) {
const char* c; const char* c;
long left; unsigned long left;
#ifdef __MINGW32__ #ifdef __MINGW32__
if (!e->mh) e->mh=CreateFileMapping(out,0,PAGE_READONLY,0,0,NULL); if (!e->mh) e->mh=CreateFileMapping(out,0,PAGE_READONLY,0,0,NULL);
if (!e->mh) goto readwrite; if (!e->mh) goto readwrite;
@ -66,7 +66,7 @@ int64 io_mmapwritefile(int64 out,int64 in,uint64 off,uint64 bytes,io_write_callb
e->mmapped=0; e->mmapped=0;
return -3; return -3;
} }
return sent?sent:-1; return sent?(int64)sent:-1;
} }
if (m==0) return sent; if (m==0) return sent;
sent+=m; sent+=m;
@ -87,12 +87,12 @@ int64 io_mmapwritefile(int64 out,int64 in,uint64 off,uint64 bytes,io_write_callb
return sent; return sent;
} }
readwrite: readwrite:
if (lseek(in,off,SEEK_SET) != off) if (lseek(in,off,SEEK_SET) != (off_t)off)
return -1; return -1;
while (bytes>0) { while (bytes>0) {
char* tmp=buf; char* tmp=buf;
if ((n=read(in,tmp,(bytes<BUFSIZE)?bytes:BUFSIZE))<=0) if ((n=read(in,tmp,(bytes<BUFSIZE)?bytes:BUFSIZE))<=0)
return (sent?sent:-1); return (sent?(int64)sent:-1);
while (n>0) { while (n>0) {
if ((m=writecb(out,tmp,n))<0) { if ((m=writecb(out,tmp,n))<0) {
if (m==-1) { if (m==-1) {
@ -100,7 +100,7 @@ readwrite:
e->canwrite=0; e->canwrite=0;
e->next_write=-1; e->next_write=-1;
} }
return errno==EAGAIN?(sent?sent:-1):-3; return errno==EAGAIN?(sent?(int64)sent:-1):-3;
} }
goto abort; goto abort;
} }

Loading…
Cancel
Save