From: notaz Date: Sun, 29 Jun 2008 19:18:51 +0000 (+0000) Subject: gcc 4.2 warning fixes X-Git-Tag: v1.85~459 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d95259bdaaf911218656d8a74b096ff7306034f6;p=picodrive.git gcc 4.2 warning fixes git-svn-id: file:///home/notaz/opt/svn/PicoDrive@501 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/cpu/Cyclone/Main.cpp b/cpu/Cyclone/Main.cpp index 4cfc774..2c87ea0 100644 --- a/cpu/Cyclone/Main.cpp +++ b/cpu/Cyclone/Main.cpp @@ -6,8 +6,8 @@ static FILE *AsmFile=NULL; static int CycloneVer=0x0099; // Version number of library int *CyJump=NULL; // Jump table int ms=USE_MS_SYNTAX; // If non-zero, output in Microsoft ARMASM format -char *Narm[4]={ "b", "h","",""}; // Normal ARM Extensions for operand sizes 0,1,2 -char *Sarm[4]={"sb","sh","",""}; // Sign-extend ARM Extensions for operand sizes 0,1,2 +const char * const Narm[4]={ "b", "h","",""}; // Normal ARM Extensions for operand sizes 0,1,2 +const char * const Sarm[4]={"sb","sh","",""}; // Sign-extend ARM Extensions for operand sizes 0,1,2 int Cycles; // Current cycles for opcode int pc_dirty; // something changed PC during processing int arm_op_count; @@ -83,7 +83,7 @@ static void ChangeTAS(int norm) #endif #if EMULATE_ADDRESS_ERRORS_JUMP || EMULATE_ADDRESS_ERRORS_IO -static void AddressErrorWrapper(char rw, char *dataprg, int iw) +static void AddressErrorWrapper(char rw, const char *dataprg, int iw) { ot("ExceptionAddressError_%c_%s%s\n", rw, dataprg, ms?"":":"); ot(" ldr r1,[r7,#0x44]\n"); @@ -1096,7 +1096,7 @@ static void PrintJumpTable() static int CycloneMake() { int i; - char *name="Cyclone.s"; + const char *name="Cyclone.s"; const char *globl=ms?"export":".global"; // Open the assembly file @@ -1131,6 +1131,10 @@ static int CycloneMake() ot(" %s CycloneDoInterrupt\n",globl); ot(" %s CycloneDoTrace\n",globl); ot(" %s CycloneJumpTab\n",globl); + ot(" %s Op____\n",globl); + ot(" %s Op6001\n",globl); + ot(" %s Op6601\n",globl); + ot(" %s Op6701\n",globl); #endif ot("\n"); ot(ms?"CycloneVer dcd 0x":"CycloneVer: .long 0x"); diff --git a/cpu/Cyclone/OpArith.cpp b/cpu/Cyclone/OpArith.cpp index b20f6cc..c05f5fd 100644 --- a/cpu/Cyclone/OpArith.cpp +++ b/cpu/Cyclone/OpArith.cpp @@ -8,7 +8,7 @@ int OpArith(int op) int type=0,size=0; int sea=0,tea=0; int use=0; - char *shiftstr=""; + const char *shiftstr=""; // Get source and target EA type=(op>>9)&7; if (type==4 || type>=7) return 1; @@ -144,8 +144,8 @@ int OpArithReg(int op) { int use=0; int type=0,size=0,dir=0,rea=0,ea=0; - char *asl=""; - char *strop=0; + const char *asl=""; + const char *strop=0; type=(op>>12)&5; rea =(op>> 9)&7; @@ -534,7 +534,7 @@ int OpAritha(int op) { int use=0; int type=0,size=0,sea=0,dea=0; - char *asr=""; + const char *asr=""; // Suba/Cmpa/Adda/(invalid): type=(op>>13)&3; if (type>=3) return 1; @@ -591,7 +591,7 @@ int OpAddx(int op) { int use=0; int type=0,size=0,dea=0,sea=0,mem=0; - char *asl=""; + const char *asl=""; type=(op>>14)&1; dea =(op>> 9)&7; @@ -668,7 +668,7 @@ int OpCmpEor(int op) { int rea=0,eor=0; int size=0,ea=0,use=0; - char *asl=""; + const char *asl=""; // Get EA and register EA rea=(op>>9)&7; @@ -725,7 +725,7 @@ int OpCmpEor(int op) int OpCmpm(int op) { int size=0,sea=0,dea=0,use=0; - char *asl=""; + const char *asl=""; // get size, get EAs size=(op>>6)&3; if (size>=3) return 1; diff --git a/cpu/Cyclone/OpBranch.cpp b/cpu/Cyclone/OpBranch.cpp index ce5ae70..061fe01 100644 --- a/cpu/Cyclone/OpBranch.cpp +++ b/cpu/Cyclone/OpBranch.cpp @@ -288,7 +288,7 @@ int OpJsr(int op) // --------------------- Opcodes 0x50c8+ --------------------- // ARM version of 68000 condition codes: -static char *Cond[16]= +static const char * const Cond[16]= { "", "", "hi","ls","cc","cs","ne","eq", "vc","vs","pl","mi","ge","lt","gt","le" @@ -402,7 +402,7 @@ int OpBranch(int op) int size=0,use=0,checkpc=0; int offset=0; int cc=0; - char *asr_r11=""; + const char *asr_r11=""; offset=(char)(op&0xff); cc=(op>>8)&15; diff --git a/cpu/Cyclone/OpLogic.cpp b/cpu/Cyclone/OpLogic.cpp index 912d94b..b3e14a9 100644 --- a/cpu/Cyclone/OpLogic.cpp +++ b/cpu/Cyclone/OpLogic.cpp @@ -301,7 +301,7 @@ int OpSet(int op) { int cc=0,ea=0; int size=0,use=0,changed_cycles=0; - char *cond[16]= + static const char * const cond[16]= { "al","", "hi","ls","cc","cs","ne","eq", "vc","vs","pl","mi","ge","lt","gt","le" diff --git a/cpu/Cyclone/app.h b/cpu/Cyclone/app.h index cb36fd7..5e468c7 100644 --- a/cpu/Cyclone/app.h +++ b/cpu/Cyclone/app.h @@ -33,8 +33,8 @@ int EaAn(int ea); // Main.cpp extern int *CyJump; // Jump table extern int ms; // If non-zero, output in Microsoft ARMASM format -extern char *Narm[4]; // Normal ARM Extensions for operand sizes 0,1,2 -extern char *Sarm[4]; // Sign-extend ARM Extensions for operand sizes 0,1,2 +extern const char * const Narm[4]; // Normal ARM Extensions for operand sizes 0,1,2 +extern const char * const Sarm[4]; // Sign-extend ARM Extensions for operand sizes 0,1,2 extern int Cycles; // Current cycles for opcode extern int pc_dirty; // something changed PC during processing extern int arm_op_count; // for stats