Clean up more warnings

This commit is contained in:
Lephenixnoir 2021-07-27 11:34:35 +02:00
parent 91f8dca1cb
commit 271d9d588d
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
6 changed files with 19 additions and 15 deletions

View File

@ -3,7 +3,7 @@ CPP=sh-elf-g++
OBJCOPY=sh-elf-objcopy
MKG3A=mkg3a
RM=rm
CFLAGS=-m4a-nofpu -mb -fgcse-sm -fgcse-las -fgcse-after-reload -Isrc -O3 -fmerge-all-constants -mhitachi -fuse-linker-plugin -Wall -Wextra -Wno-sign-compare -I../../../../include -lgcc -L../../../../lib -I./ -I../../cgdoom -D_FXCG_MINICOMPAT
CFLAGS=-m4a-nofpu -mb -fgcse-sm -fgcse-las -fgcse-after-reload -Isrc -O3 -fmerge-all-constants -mhitachi -fuse-linker-plugin -Wall -Wextra -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -I../../../../include -lgcc -L../../../../lib -I./ -I../../cgdoom -D_FXCG_MINICOMPAT
LDFLAGS=$(CFLAGS) -nostartfiles -T../../../../toolchain/prizm.x -Wl,-static -lfxcg -lgcc -Wl,-Map=$(PROJ_NAME).map
CSOURCES=$(wildcard ../../cgdoom/*.c)
OBJECTS=$(CSOURCES:.c=.o)

View File

@ -478,7 +478,7 @@ void abort(void){
GetKey(&key);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
void main(void){
int main(void){
InitFlashSimu(cgdoom_wad_path); //load wad file to flash simulation on simulator, do nothing on real HW
#ifdef CG_EMULATOR
SaveVRAMBuffer = aSaveVRAMBuffer;
@ -503,23 +503,24 @@ void main(void){
if(size == -1) {
I_Error ("File read error");
return;
return 1;
}
else if(size == -2) {
I_Error ("Page not found");
return;
return 1;
}
else if(size == -3) {
I_Error ("File too fragmented");
return;
return 1;
}
else if(size < 0) {
I_ErrorI ("CreateFileMapping", size, 0, 0, 0);
return;
return 1;
}
#endif
D_DoomMain();
return 1;
}
//todo: wrapper pro (patch_t*), + flash

View File

@ -117,7 +117,7 @@ int toupper_int(int i)
// I_Error
//
static int key = 31;
void I_ErrorI (char *error, int i1,int i2,int i3,int i4)
void I_ErrorI (const char *error, int i1,int i2,int i3,int i4)
{
#ifndef CG_EMULATOR
@ -126,11 +126,11 @@ void I_ErrorI (char *error, int i1,int i2,int i3,int i4)
locate_OS( 1, 1 );
PrintLine( "ERROR:", 21 );
locate_OS( 1, 2 );
PrintLine( (unsigned char *)error, 21 );
locate_OS( 1, 3 );CGDAppendHex32("i1:",i1,8,buf);PrintLine( (unsigned char *)buf, 21 );
locate_OS( 1, 4 );CGDAppendHex32("i2:",i2,8,buf);PrintLine( (unsigned char *)buf, 21 );
locate_OS( 1, 5 );CGDAppendHex32("i3:",i3,8,buf);PrintLine( (unsigned char *)buf, 21 );
locate_OS( 1, 6 );CGDAppendHex32("i4:",i4,8,buf);PrintLine( (unsigned char *)buf, 21 );
PrintLine( error, 21 );
locate_OS( 1, 3 );CGDAppendHex32("i1:",i1,8,buf);PrintLine( buf, 21 );
locate_OS( 1, 4 );CGDAppendHex32("i2:",i2,8,buf);PrintLine( buf, 21 );
locate_OS( 1, 5 );CGDAppendHex32("i3:",i3,8,buf);PrintLine( buf, 21 );
locate_OS( 1, 6 );CGDAppendHex32("i4:",i4,8,buf);PrintLine( buf, 21 );
GetKey( &key );
#else
I_Error (error,i1,i2,i3,i4);
@ -157,7 +157,7 @@ void I_Error (char *error, ...)
locate_OS( 1, 1 );
PrintLine( "ERROR:", 21 );
locate_OS( 1, 2 );
PrintLine( (unsigned char *)error, 21 );
PrintLine( error, 21 );
GetKey( &key );
#endif //#ifdef CG_EMULATOR
//I_Quit();

View File

@ -94,7 +94,7 @@ int toupper_int(int i);
void I_Error (char *error, ...);
//CGD bastl/hack
void I_ErrorI (char *error, int i1,int i2,int i3,int i4);
void I_ErrorI (const char *error, int i1,int i2,int i3,int i4);
//Set by I_Error()
extern boolean fuck;

View File

@ -29,9 +29,12 @@ int CGDstrnicmp (const char*s1,const char*s2,int iLen);
void CGDstrncpy(char *pszBuf,const char *pszText,int iLen);
void CGDAppendNum0_999(const char *pszText,int iNum,int iMinDigits,char *pszBuf);
void CGDAppendHex32(const char *pszText,int iNum, int iDigits,char *pszBuf);
int abs(int x);
void I_ErrorI(const char *str, int i1, int i2, int i3, int i4);
//force compiler error on use following:
#define strcpy 12
#define strnicmp 22

View File

@ -333,7 +333,7 @@ static void* W_CacheLumpNumCommon( int lump, int tag,int iEnableFlash)
int p1 = ((unsigned int)lumpcache[lump] & 0xf0000000) == 0x80000000;
int p2 = ((unsigned int)lumpcache[lump] & 0xf0000000) == 0xa0000000;
if(lumpcache[lump] == NULL || (!p1 && !p2))
I_ErrorI("W_CacheLumpNumCommon", lumpcache[lump], lump, 0, 0);
I_ErrorI("W_CacheLumpNumCommon", (int)lumpcache[lump], lump, 0, 0);
return lumpcache[lump];
}