Removed -Wno-parentheses from posix build and fixed warnings (bug 5745, r=psychonic).
1.1 --- a/extensions/sdkhooks/AMBuilder Thu Jul 18 15:50:50 2013 -0400
1.2 +++ b/extensions/sdkhooks/AMBuilder Thu Jul 18 15:50:57 2013 -0400
1.3 @@ -10,7 +10,6 @@
1.4 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache[sdk['sdk']], 'game', 'shared'))
1.5
1.6 if compiler.cc.name == 'gcc' or compiler.cc.name == 'clang':
1.7 - compiler['CFLAGS'].append('-Wno-parentheses')
1.8 compiler['CXXFLAGS'].append('-Wno-invalid-offsetof')
1.9
1.10 name = 'sdkhooks.ext.' + sdk['ext']
2.1 --- a/extensions/sdktools/AMBuilder Thu Jul 18 15:50:50 2013 -0400
2.2 +++ b/extensions/sdktools/AMBuilder Thu Jul 18 15:50:57 2013 -0400
2.3 @@ -11,7 +11,6 @@
2.4 compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86'))
2.5
2.6 if compiler.cc.name == 'gcc' or compiler.cc.name == 'clang':
2.7 - compiler['CFLAGS'].append('-Wno-parentheses')
2.8 compiler['CXXFLAGS'].append('-Wno-invalid-offsetof')
2.9
2.10 if i != 'ep1':
3.1 --- a/extensions/sdktools/asm/asm.c Thu Jul 18 15:50:50 2013 -0400
3.2 +++ b/extensions/sdktools/asm/asm.c Thu Jul 18 15:50:57 2013 -0400
3.3 @@ -157,9 +157,9 @@
3.4 else if(!twoByte)
3.5 {
3.6 if((opcode & 0xC4) == 0x00 ||
3.7 - (opcode & 0xF4) == 0x60 && ((opcode & 0x0A) == 0x02 || (opcode & 0x09) == 0x09) ||
3.8 + ((opcode & 0xF4) == 0x60 && ((opcode & 0x0A) == 0x02 || (opcode & 0x09) == 0x09)) ||
3.9 (opcode & 0xF0) == 0x80 ||
3.10 - (opcode & 0xF8) == 0xC0 && (opcode & 0x0E) != 0x02 ||
3.11 + ((opcode & 0xF8) == 0xC0 && (opcode & 0x0E) != 0x02) ||
3.12 (opcode & 0xFC) == 0xD0 ||
3.13 (opcode & 0xF6) == 0xF6)
3.14 {
3.15 @@ -170,11 +170,11 @@
3.16 }
3.17 else
3.18 {
3.19 - if((opcode & 0xF0) == 0x00 && (opcode & 0x0F) >= 0x04 && (opcode & 0x0D) != 0x0D ||
3.20 + if(((opcode & 0xF0) == 0x00 && (opcode & 0x0F) >= 0x04 && (opcode & 0x0D) != 0x0D) ||
3.21 (opcode & 0xF0) == 0x30 ||
3.22 opcode == 0x77 ||
3.23 (opcode & 0xF0) == 0x80 ||
3.24 - (opcode & 0xF0) == 0xA0 && (opcode & 0x07) <= 0x02 ||
3.25 + ((opcode & 0xF0) == 0xA0 && (opcode & 0x07) <= 0x02) ||
3.26 (opcode & 0xF8) == 0xC8)
3.27 {
3.28 // No mod R/M byte
3.29 @@ -250,7 +250,7 @@
3.30 (opcode & 0xFE) == 0xD4 || // AAD/AAM
3.31 (opcode & 0xF8) == 0xE0 || // LOOP/JCXZ
3.32 opcode == 0xEB ||
3.33 - opcode == 0xF6 && (modRM & 0x30) == 0x00) // TEST
3.34 + (opcode == 0xF6 && (modRM & 0x30) == 0x00)) // TEST
3.35 {
3.36 if (dest)
3.37 *dest++ = *func++;
3.38 @@ -275,7 +275,7 @@
3.39 (opcode & 0xFC) == 0xA0 ||
3.40 (opcode & 0xEE) == 0xA8 ||
3.41 opcode == 0xC7 ||
3.42 - opcode == 0xF7 && (modRM & 0x30) == 0x00)
3.43 + (opcode == 0xF7 && (modRM & 0x30) == 0x00))
3.44 {
3.45 if (dest) {
3.46 //Fix CALL/JMP offset
4.1 --- a/extensions/tf2/AMBuilder Thu Jul 18 15:50:50 2013 -0400
4.2 +++ b/extensions/tf2/AMBuilder Thu Jul 18 15:50:57 2013 -0400
4.3 @@ -3,8 +3,6 @@
4.4 if 'ep2v' in SM.sdkInfo:
4.5 sdk = SM.sdkInfo['ep2v']
4.6 compiler = SM.DefaultHL2Compiler('extensions/tf2', 'ep2v')
4.7 - if compiler.cc.name == 'gcc' or compiler.cc.name == 'clang':
4.8 - compiler['CFLAGS'].append('-Wno-parentheses')
4.9
4.10 name = 'game.tf2.ext.' + sdk['ext']
4.11 extension = AMBuild.AddJob(name)
5.1 --- a/extensions/tf2/asm/asm.c Thu Jul 18 15:50:50 2013 -0400
5.2 +++ b/extensions/tf2/asm/asm.c Thu Jul 18 15:50:57 2013 -0400
5.3 @@ -157,9 +157,9 @@
5.4 else if(!twoByte)
5.5 {
5.6 if((opcode & 0xC4) == 0x00 ||
5.7 - (opcode & 0xF4) == 0x60 && ((opcode & 0x0A) == 0x02 || (opcode & 0x09) == 0x09) ||
5.8 + ((opcode & 0xF4) == 0x60 && ((opcode & 0x0A) == 0x02 || (opcode & 0x09) == 0x09)) ||
5.9 (opcode & 0xF0) == 0x80 ||
5.10 - (opcode & 0xF8) == 0xC0 && (opcode & 0x0E) != 0x02 ||
5.11 + ((opcode & 0xF8) == 0xC0 && (opcode & 0x0E) != 0x02) ||
5.12 (opcode & 0xFC) == 0xD0 ||
5.13 (opcode & 0xF6) == 0xF6)
5.14 {
5.15 @@ -170,11 +170,11 @@
5.16 }
5.17 else
5.18 {
5.19 - if((opcode & 0xF0) == 0x00 && (opcode & 0x0F) >= 0x04 && (opcode & 0x0D) != 0x0D ||
5.20 + if(((opcode & 0xF0) == 0x00 && (opcode & 0x0F) >= 0x04 && (opcode & 0x0D) != 0x0D) ||
5.21 (opcode & 0xF0) == 0x30 ||
5.22 opcode == 0x77 ||
5.23 (opcode & 0xF0) == 0x80 ||
5.24 - (opcode & 0xF0) == 0xA0 && (opcode & 0x07) <= 0x02 ||
5.25 + ((opcode & 0xF0) == 0xA0 && (opcode & 0x07) <= 0x02) ||
5.26 (opcode & 0xF8) == 0xC8)
5.27 {
5.28 // No mod R/M byte
5.29 @@ -250,7 +250,7 @@
5.30 (opcode & 0xFE) == 0xD4 || // AAD/AAM
5.31 (opcode & 0xF8) == 0xE0 || // LOOP/JCXZ
5.32 opcode == 0xEB ||
5.33 - opcode == 0xF6 && (modRM & 0x30) == 0x00) // TEST
5.34 + (opcode == 0xF6 && (modRM & 0x30) == 0x00)) // TEST
5.35 {
5.36 if (dest)
5.37 *dest++ = *func++;
5.38 @@ -275,7 +275,7 @@
5.39 (opcode & 0xFC) == 0xA0 ||
5.40 (opcode & 0xEE) == 0xA8 ||
5.41 opcode == 0xC7 ||
5.42 - opcode == 0xF7 && (modRM & 0x30) == 0x00)
5.43 + (opcode == 0xF7 && (modRM & 0x30) == 0x00))
5.44 {
5.45 if (dest) {
5.46 //Fix CALL/JMP offset
6.1 --- a/sourcepawn/compiler/AMBuilder Thu Jul 18 15:50:50 2013 -0400
6.2 +++ b/sourcepawn/compiler/AMBuilder Thu Jul 18 15:50:57 2013 -0400
6.3 @@ -8,7 +8,7 @@
6.4 compiler['CINCLUDES'].append(os.path.join(AMBuild.outputFolder, 'includes'))
6.5
6.6 if compiler.cc.name == 'gcc' or compiler.cc.name == 'clang':
6.7 - compiler['CFLAGS'].extend(['-Wno-parentheses', '-Wno-format'])
6.8 + compiler['CFLAGS'].append('-Wno-format')
6.9 if AMBuild.target['platform'] == 'linux':
6.10 compiler['POSTLINKFLAGS'].extend(['-lgcc', '-lm'])
6.11 elif compiler.cc.name == 'msvc':
7.1 --- a/sourcepawn/compiler/sc1.c Thu Jul 18 15:50:50 2013 -0400
7.2 +++ b/sourcepawn/compiler/sc1.c Thu Jul 18 15:50:57 2013 -0400
7.3 @@ -479,7 +479,7 @@
7.4 } /* if */
7.5 if (pc_amxram>0 && (glb_declared+pc_stksize)*sizeof(cell)>=(unsigned long)pc_amxram)
7.6 flag_exceed=1;
7.7 - if (!norun && (sc_debug & sSYMBOLIC)!=0 || verbosity>=2 || flag_exceed) {
7.8 + if ((!norun && (sc_debug & sSYMBOLIC)!=0) || verbosity>=2 || flag_exceed) {
7.9 pc_printf("Header size: %8ld bytes\n", (long)hdrsize);
7.10 pc_printf("Code size: %8ld bytes\n", (long)code_idx);
7.11 pc_printf("Data size: %8ld bytes\n", (long)glb_declared*sizeof(cell));
7.12 @@ -1871,8 +1871,8 @@
7.13 {
7.14 error(23);
7.15 } else {
7.16 - if (arg->tag == pc_addtag("Float") && tok == tNUMBER ||
7.17 - arg->tag == 0 && tok == tRATIONAL)
7.18 + if ((arg->tag == pc_addtag("Float") && tok == tNUMBER) ||
7.19 + (arg->tag == 0 && tok == tRATIONAL))
7.20 {
7.21 error(213);
7.22 }
7.23 @@ -2069,8 +2069,8 @@
7.24 * c) found a state variable in the automaton that we were looking for
7.25 */
7.26 assert(sym==NULL
7.27 - || sym->states==NULL && sc_curstates==0
7.28 - || sym->states!=NULL && sym->next!=NULL && sym->states->next->index==sc_curstates);
7.29 + || (sym->states==NULL && sc_curstates==0)
7.30 + || (sym->states!=NULL && sym->next!=NULL && sym->states->next->index==sc_curstates));
7.31 /* a state variable may only have a single id in its list (so either this
7.32 * variable has no states, or it has a single list)
7.33 */
7.34 @@ -2212,8 +2212,8 @@
7.35 if (sc_curstates>0)
7.36 attachstatelist(sym,sc_curstates);
7.37 } else { /* if declared but not yet defined, adjust the variable's address */
7.38 - assert(sym->states==NULL && sc_curstates==0
7.39 - || sym->states->next!=NULL && sym->states->next->index==sc_curstates && sym->states->next->next==NULL);
7.40 + assert((sym->states==NULL && sc_curstates==0)
7.41 + || (sym->states->next!=NULL && sym->states->next->index==sc_curstates && sym->states->next->next==NULL));
7.42 sym->addr=address;
7.43 sym->codeaddr=code_idx;
7.44 sym->usage|=uDEFINE;
7.45 @@ -2290,7 +2290,7 @@
7.46 * of a global variable or to that of a local variable at a lower
7.47 * level might indicate a bug.
7.48 */
7.49 - if ((sym=findloc(name))!=NULL && sym->compound!=nestlevel || findglb(name,sGLOBAL)!=NULL)
7.50 + if (((sym=findloc(name))!=NULL && sym->compound!=nestlevel) || findglb(name,sGLOBAL)!=NULL)
7.51 error(219,name); /* variable shadows another symbol */
7.52 if (matchtoken('[')) {
7.53 int _index;
7.54 @@ -3407,7 +3407,7 @@
7.55 } else {
7.56 error(10);
7.57 }
7.58 - } while (l == '&' || l == tLABEL || l == tCONST || l != tELLIPS && matchtoken(','));
7.59 + } while (l == '&' || l == tLABEL || l == tCONST || (l != tELLIPS && matchtoken(',')));
7.60 needtoken(')');
7.61 for (i=0; i<func.argcount; i++)
7.62 {
7.63 @@ -3847,7 +3847,7 @@
7.64 error(62); /* number or placement of the operands does not fit the operator */
7.65 } /* switch */
7.66
7.67 - if (tags[0]==0 && (opertok!='=' && tags[1]==0 || opertok=='=' && resulttag==0))
7.68 + if (tags[0]==0 && ((opertok!='=' && tags[1]==0) || (opertok=='=' && resulttag==0)))
7.69 error(64); /* cannot change predefined operators */
7.70
7.71 /* change the operator name */
7.72 @@ -4035,7 +4035,7 @@
7.73 tok=lex(&val,&str);
7.74 fpublic=(tok==tPUBLIC) || (tok==tSYMBOL && str[0]==PUBLIC_CHAR);
7.75 if (fnative) {
7.76 - if (fpublic || tok==tSTOCK || tok==tSTATIC || tok==tSYMBOL && *str==PUBLIC_CHAR)
7.77 + if (fpublic || tok==tSTOCK || tok==tSTATIC || (tok==tSYMBOL && *str==PUBLIC_CHAR))
7.78 error(42); /* invalid combination of class specifiers */
7.79 } else {
7.80 if (tok==tPUBLIC || tok==tSTOCK || tok==tSTATIC)
7.81 @@ -4159,7 +4159,7 @@
7.82 tag= (firsttag>=0) ? firsttag : pc_addtag(NULL);
7.83 tok=lex(&val,&str);
7.84 assert(!fpublic);
7.85 - if (tok==tNATIVE || tok==tPUBLIC && stock)
7.86 + if (tok==tNATIVE || (tok==tPUBLIC && stock))
7.87 error(42); /* invalid combination of class specifiers */
7.88 if (tok==tOPERATOR) {
7.89 opertok=operatorname(symbolname);
7.90 @@ -4489,8 +4489,8 @@
7.91 /* may need to free default array argument and the tag list */
7.92 if (arg.ident==iREFARRAY && arg.hasdefault)
7.93 free(arg.defvalue.array.data);
7.94 - else if (arg.ident==iVARIABLE
7.95 - && ((arg.hasdefault & uSIZEOF)!=0 || (arg.hasdefault & uTAGOF)!=0) || (arg.hasdefault & uCOUNTOF)!=0)
7.96 + else if ((arg.ident==iVARIABLE
7.97 + && ((arg.hasdefault & uSIZEOF)!=0 || (arg.hasdefault & uTAGOF)!=0)) || (arg.hasdefault & uCOUNTOF)!=0)
7.98 free(arg.defvalue.size.symname);
7.99 free(arg.tags);
7.100 } /* if */
7.101 @@ -4529,7 +4529,7 @@
7.102 error(10); /* illegal function or declaration */
7.103 } /* switch */
7.104 } while (tok=='&' || tok==tLABEL || tok==tCONST
7.105 - || tok!=tELLIPS && matchtoken(',')); /* more? */
7.106 + || (tok!=tELLIPS && matchtoken(','))); /* more? */
7.107 /* if the next token is not ",", it should be ")" */
7.108 needtoken(')');
7.109 } /* if */
7.110 @@ -4770,7 +4770,7 @@
7.111 assert(inner_length!=NULL);
7.112
7.113 /* both NULL or both non-NULL */
7.114 - assert(xmlvalue!=NULL && xmlparam!=NULL || xmlvalue==NULL && xmlparam==NULL);
7.115 + assert((xmlvalue!=NULL && xmlparam!=NULL) || (xmlvalue==NULL && xmlparam==NULL));
7.116
7.117 xmltag_len=strlen(xmltag);
7.118 xmlparam_len= (xmlparam!=NULL) ? strlen(xmlparam) : 0;
7.119 @@ -6419,7 +6419,7 @@
7.120 if ((rettype & uRETVALUE)!=0) {
7.121 int retarray=(ident==iARRAY || ident==iREFARRAY);
7.122 /* there was an earlier "return" statement in this function */
7.123 - if (sub==NULL && retarray || sub!=NULL && !retarray)
7.124 + if ((sub==NULL && retarray) || (sub!=NULL && !retarray))
7.125 error(79); /* mixing "return array;" and "return value;" */
7.126 if (retarray && (curfunc->usage & uPUBLIC)!=0)
7.127 error(90,curfunc->name); /* public function may not return array */
7.128 @@ -6632,7 +6632,7 @@
7.129 assert(state!=NULL);
7.130 ldconst(state->value,sPRI);
7.131 assert(automaton!=NULL);
7.132 - assert(automaton->index==0 && automaton->name[0]=='\0' || automaton->index>0);
7.133 + assert((automaton->index==0 && automaton->name[0]=='\0') || automaton->index>0);
7.134 storereg(automaton->value,sPRI);
7.135
7.136 /* find the optional entry() function for the state */
8.1 --- a/sourcepawn/compiler/sc2.c Thu Jul 18 15:50:50 2013 -0400
8.2 +++ b/sourcepawn/compiler/sc2.c Thu Jul 18 15:50:57 2013 -0400
8.3 @@ -416,7 +416,7 @@
8.4 #if !defined SC_LIGHT
8.5 /* collect the comment characters in a string */
8.6 if (icomment==2) {
8.7 - if (skipstar && (*line!='\0' && *line<=' ' || *line=='*')) {
8.8 + if (skipstar && ((*line!='\0' && *line<=' ') || *line=='*')) {
8.9 /* ignore leading whitespace and '*' characters */
8.10 } else if (commentidx<COMMENT_LIMIT+COMMENT_MARGIN-1) {
8.11 comment[commentidx++]=(char)((*line!='\n') ? *line : ' ');
8.12 @@ -1232,7 +1232,7 @@
8.13 sym=findloc(str);
8.14 if (sym==NULL)
8.15 sym=findglb(str,sSTATEVAR);
8.16 - if (sym==NULL || sym->ident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0) {
8.17 + if (sym==NULL || (sym->ident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0)) {
8.18 error(17,str); /* undefined symbol */
8.19 } else {
8.20 outval(sym->addr,FALSE);
8.21 @@ -1668,7 +1668,7 @@
8.22 if (strncmp((char*)start,"defined",7)==0 && !isalpha((char)*(start+7))) {
8.23 start+=7; /* skip "defined" */
8.24 /* skip white space & parantheses */
8.25 - while (*start<=' ' && *start!='\0' || *start=='(')
8.26 + while ((*start<=' ' && *start!='\0') || *start=='(')
8.27 start++;
8.28 /* skip the symbol behind it */
8.29 while (alphanum(*start))
8.30 @@ -1974,7 +1974,7 @@
8.31 error(220);
8.32 } /* if */
8.33 } /* if */
8.34 - } else if (*lptr=='\"' || *lptr==sc_ctrlchar && *(lptr+1)=='\"')
8.35 + } else if (*lptr=='\"' || (*lptr==sc_ctrlchar && *(lptr+1)=='\"'))
8.36 { /* unpacked string literal */
8.37 _lextok=tSTRING;
8.38 stringflags= (*lptr==sc_ctrlchar) ? RAWMODE : 0;
8.39 @@ -1988,9 +1988,9 @@
8.40 lptr+=1; /* skip final quote */
8.41 else
8.42 error(37); /* invalid (non-terminated) string */
8.43 - } else if (*lptr=='!' && *(lptr+1)=='\"'
8.44 - || *lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"'
8.45 - || *lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"')
8.46 + } else if ((*lptr=='!' && *(lptr+1)=='\"')
8.47 + || (*lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"')
8.48 + || (*lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"'))
8.49 { /* packed string literal */
8.50 _lextok=tSTRING;
8.51 stringflags= (*lptr==sc_ctrlchar || *(lptr+1)==sc_ctrlchar) ? RAWMODE : 0;
8.52 @@ -2081,7 +2081,7 @@
8.53 int tok;
8.54
8.55 tok=lex(&val,&str);
8.56 - if (tok==token || token==tTERM && (tok==';' || tok==tENDEXPR)) {
8.57 + if (tok==token || (token==tTERM && (tok==';' || tok==tENDEXPR))) {
8.58 return 1;
8.59 } else if (!sc_needsemicolon && token==tTERM && (_lexnewline || !freading)) {
8.60 /* Push "tok" back, because it is the token following the implicit statement
8.61 @@ -2555,8 +2555,8 @@
8.62 {
8.63 assert(sym->states==NULL || sym->states->next!=NULL); /* first element of the state list is the "root" */
8.64 if (sym->ident==iFUNCTN
8.65 - || automaton<0 && sym->states==NULL
8.66 - || automaton>=0 && sym->states!=NULL && state_getfsa(sym->states->next->index)==automaton)
8.67 + || (automaton<0 && sym->states==NULL)
8.68 + || (automaton>=0 && sym->states!=NULL && state_getfsa(sym->states->next->index)==automaton))
8.69 {
8.70 if (cmptag==NULL)
8.71 return sym; /* return first match */
8.72 @@ -2785,8 +2785,8 @@
8.73 * the symbol without states if no symbol with states exists).
8.74 */
8.75 assert(vclass!=sGLOBAL || (sym=findglb(name,sGLOBAL))==NULL || (sym->usage & uDEFINE)==0
8.76 - || sym->ident==iFUNCTN && sym==curfunc
8.77 - || sym->states==NULL && sc_curstates>0);
8.78 + || (sym->ident==iFUNCTN && sym==curfunc)
8.79 + || (sym->states==NULL && sc_curstates>0));
8.80
8.81 if (ident==iARRAY || ident==iREFARRAY) {
8.82 symbol *parent=NULL,*top;
9.1 --- a/sourcepawn/compiler/sc3.c Thu Jul 18 15:50:50 2013 -0400
9.2 +++ b/sourcepawn/compiler/sc3.c Thu Jul 18 15:50:57 2013 -0400
9.3 @@ -1211,7 +1211,7 @@
9.4 } /* if */
9.5 if (lval3.sym->dim.array.level!=level)
9.6 return error(47); /* array dimensions must match */
9.7 - else if (ltlength<val || exactmatch && ltlength>val || val==0)
9.8 + else if (ltlength<val || (exactmatch && ltlength>val) || val==0)
9.9 return error(47); /* array sizes must match */
9.10 else if (lval3.ident!=iARRAYCELL && !matchtag(lval3.sym->x.tags.index,idxtag,TRUE))
9.11 error(229,(lval2.sym!=NULL) ? lval2.sym->name : lval3.sym->name); /* index tag mismatch */
9.12 @@ -1706,7 +1706,7 @@
9.13 constvalue *state;
9.14 if (sc_getstateid(&automaton,&state)) {
9.15 assert(automaton!=NULL);
9.16 - assert(automaton->index==0 && automaton->name[0]=='\0' || automaton->index>0);
9.17 + assert((automaton->index==0 && automaton->name[0]=='\0') || automaton->index>0);
9.18 loadreg(automaton->value,sALT);
9.19 assert(state!=NULL);
9.20 ldconst(state->value,sPRI);
9.21 @@ -1871,7 +1871,7 @@
9.22 } /* if */
9.23 if (close==']' && !(sym->tag == pc_tag_string && sym->dim.array.level == 0)) {
9.24 /* normal array index */
9.25 - if (lval2.constval<0 || sym->dim.array.length!=0 && sym->dim.array.length<=lval2.constval)
9.26 + if (lval2.constval<0 || (sym->dim.array.length!=0 && sym->dim.array.length<=lval2.constval))
9.27 error(32,sym->name); /* array index out of bounds */
9.28 if (lval2.constval!=0) {
9.29 /* don't add offsets for zero subscripts */
9.30 @@ -1888,8 +1888,8 @@
9.31 } /* if */
9.32 } else {
9.33 /* character index */
9.34 - if (lval2.constval<0 || sym->dim.array.length!=0
9.35 - && sym->dim.array.length*((8*sizeof(cell))/sCHARBITS)<=(ucell)lval2.constval)
9.36 + if (lval2.constval<0 || (sym->dim.array.length!=0
9.37 + && sym->dim.array.length*((8*sizeof(cell))/sCHARBITS)<=(ucell)lval2.constval))
9.38 error(32,sym->name); /* array index out of bounds */
9.39 if (lval2.constval!=0) {
9.40 /* don't add offsets for zero subscripts */
9.41 @@ -2504,8 +2504,8 @@
9.42 * function argument; a literal string may be smaller than
9.43 * the function argument.
9.44 */
9.45 - if (lval.constval>0 && arg[argidx].dim[0]!=lval.constval
9.46 - || lval.constval<0 && arg[argidx].dim[0] < -lval.constval)
9.47 + if ((lval.constval>0 && arg[argidx].dim[0]!=lval.constval)
9.48 + || (lval.constval<0 && arg[argidx].dim[0] < -lval.constval))
9.49 error(47); /* array sizes must match */
9.50 } /* if */
9.51 } /* if */
10.1 --- a/sourcepawn/compiler/sc4.c Thu Jul 18 15:50:50 2013 -0400
10.2 +++ b/sourcepawn/compiler/sc4.c Thu Jul 18 15:50:57 2013 -0400
10.3 @@ -249,7 +249,7 @@
10.4 stgwrite("\t; line ");
10.5 outval(fline,TRUE);
10.6 } /* if */
10.7 - if ((sc_debug & sSYMBOLIC)!=0 || chkbounds && (sc_debug & sCHKBOUNDS)!=0) {
10.8 + if ((sc_debug & sSYMBOLIC)!=0 || (chkbounds && (sc_debug & sCHKBOUNDS)!=0)) {
10.9 /* generate a "break" (start statement) opcode rather than a "line" opcode
10.10 * because earlier versions of Small/Pawn have an incompatible version of the
10.11 * line opcode
10.12 @@ -781,7 +781,7 @@
10.13 stgwrite(sym->name);
10.14 } /* if */
10.15 if (sc_asmfile
10.16 - && (label!=NULL || !isalpha(sym->name[0]) && sym->name[0]!='_' && sym->name[0]!=sc_ctrlchar))
10.17 + && (label!=NULL || (!isalpha(sym->name[0]) && sym->name[0]!='_' && sym->name[0]!=sc_ctrlchar)))
10.18 {
10.19 stgwrite("\t; ");
10.20 stgwrite(symname);
11.1 --- a/sourcepawn/compiler/sc5.c Thu Jul 18 15:50:50 2013 -0400
11.2 +++ b/sourcepawn/compiler/sc5.c Thu Jul 18 15:50:57 2013 -0400
11.3 @@ -135,7 +135,7 @@
11.4 } /* if */
11.5 va_end(argptr);
11.6
11.7 - if (number>=120 && number<200 || errnum>25){
11.8 + if ((number>=120 && number<200) || errnum>25){
11.9 if (strlen(errfname)==0) {
11.10 va_start(argptr,number);
11.11 pc_error(0,"\nCompilation aborted.",NULL,0,0,argptr);
12.1 --- a/sourcepawn/compiler/sc6.c Thu Jul 18 15:50:50 2013 -0400
12.2 +++ b/sourcepawn/compiler/sc6.c Thu Jul 18 15:50:57 2013 -0400
12.3 @@ -998,7 +998,7 @@
12.4 instr=skipwhitespace(line);
12.5 /* ignore empty lines and labels (labels have a special syntax, so these
12.6 * must be parsed separately) */
12.7 - if (*instr=='\0' || tolower(*instr)=='l' && *(instr+1)=='.')
12.8 + if (*instr=='\0' || (tolower(*instr)=='l' && *(instr+1)=='.'))
12.9 continue;
12.10 /* get to the end of the instruction (make use of the '\n' that fgets()
12.11 * added at the end of the line; this way we will *always* drop on a
12.12 @@ -1149,7 +1149,7 @@
12.13
12.14 /* automaton table */
12.15 for (constptr=sc_automaton_tab.next; constptr!=NULL; constptr=constptr->next) {
12.16 - assert(constptr->index==0 && strlen(constptr->name)==0 || strlen(constptr->name)>0);
12.17 + assert((constptr->index==0 && strlen(constptr->name)==0) || strlen(constptr->name)>0);
12.18 dbghdr.automatons++;
12.19 dbghdr.size+=sizeof(AMX_DBG_MACHINE)+strlen(constptr->name);
12.20 } /* for */
12.21 @@ -1288,7 +1288,7 @@
12.22
12.23 /* automaton table */
12.24 for (constptr=sc_automaton_tab.next; constptr!=NULL; constptr=constptr->next) {
12.25 - assert(constptr->index==0 && strlen(constptr->name)==0 || strlen(constptr->name)>0);
12.26 + assert((constptr->index==0 && strlen(constptr->name)==0) || strlen(constptr->name)>0);
12.27 id1=(int16_t)constptr->index;
12.28 address=(ucell)constptr->value;
12.29 #if BYTE_ORDER==BIG_ENDIAN
13.1 --- a/sourcepawn/compiler/sc7.c Thu Jul 18 15:50:50 2013 -0400
13.2 +++ b/sourcepawn/compiler/sc7.c Thu Jul 18 15:50:57 2013 -0400
13.3 @@ -532,7 +532,7 @@
13.4 assert(*(start+1)=='\0');
13.5 start+=2; /* skip '\n' and '\0' */
13.6 if (*(pattern+1)!='\0')
13.7 - while (start<end && *start=='\t' || *start==' ')
13.8 + while ((start<end && *start=='\t') || *start==' ')
13.9 start++; /* skip leading white space of next instruction */
13.10 break;
13.11 default:
13.12 @@ -690,7 +690,7 @@
13.13 seq++;
13.14 } /* if */
13.15 } /* while */
13.16 - assert(sequences[seq].find==NULL || *sequences[seq].find=='\0' && pc_optimize==sOPTIMIZE_NOMACRO);
13.17 + assert(sequences[seq].find==NULL || (*sequences[seq].find=='\0' && pc_optimize==sOPTIMIZE_NOMACRO));
13.18 start += strlen(start) + 1; /* to next string */
13.19 } /* while (start<end) */
13.20 } while (matches>0);
14.1 --- a/sourcepawn/compiler/sci18n.c Thu Jul 18 15:50:50 2013 -0400
14.2 +++ b/sourcepawn/compiler/sci18n.c Thu Jul 18 15:50:57 2013 -0400
14.3 @@ -217,8 +217,8 @@
14.4 /* clear the tables */
14.5 for (index=0; index<ELEMENTS(bytetable); index++)
14.6 bytetable[index]=INVALID; /* special code meaning "not found" */
14.7 - assert(wordtablesize==0 && wordtabletop==0 && wordtable==NULL
14.8 - || wordtablesize>0 && wordtable!=NULL);
14.9 + assert((wordtablesize==0 && wordtabletop==0 && wordtable==NULL)
14.10 + || (wordtablesize>0 && wordtable!=NULL));
14.11 if (wordtable!=NULL) {
14.12 free(wordtable);
14.13 wordtable=NULL;
14.14 @@ -339,7 +339,7 @@
14.15 /* the code positions 0xd800--0xdfff and 0xfffe & 0xffff do not
14.16 * exist in UCS-4 (and hence, they do not exist in Unicode)
14.17 */
14.18 - if (result>=0xd800 && result<=0xdfff || result==0xfffe || result==0xffff)
14.19 + if ((result>=0xd800 && result<=0xdfff) || result==0xfffe || result==0xffff)
14.20 return -1;
14.21 } /* if */
14.22 break;
15.1 --- a/sourcepawn/compiler/sclist.c Thu Jul 18 15:50:50 2013 -0400
15.2 +++ b/sourcepawn/compiler/sclist.c Thu Jul 18 15:50:57 2013 -0400
15.3 @@ -267,7 +267,7 @@
15.4 static void adjustindex(char c)
15.5 {
15.6 stringpair *cur;
15.7 - assert(c>='A' && c<='Z' || c>='a' && c<='z' || c=='_' || c==PUBLIC_CHAR);
15.8 + assert((c>='A' && c<='Z') || (c>='a' && c<='z') || c=='_' || c==PUBLIC_CHAR);
15.9 assert(PUBLIC_CHAR<'A' && 'A'<'_' && '_'<'z');
15.10
15.11 for (cur=substpair.next; cur!=NULL && cur->first[0]!=c; cur=cur->next)
15.12 @@ -311,7 +311,7 @@
15.13 stringpair *item;
15.14 assert(name!=NULL);
15.15 assert(length>0);
15.16 - assert(*name>='A' && *name<='Z' || *name>='a' && *name<='z' || *name=='_' || *name==PUBLIC_CHAR);
15.17 + assert((*name>='A' && *name<='Z') || (*name>='a' && *name<='z') || *name=='_' || *name==PUBLIC_CHAR);
15.18 item=substindex[(int)*name-PUBLIC_CHAR];
15.19 if (item!=NULL)
15.20 item=find_stringpair(item,name,length);
15.21 @@ -340,7 +340,7 @@
15.22 stringpair *item;
15.23 assert(name!=NULL);
15.24 assert(length>0);
15.25 - assert(*name>='A' && *name<='Z' || *name>='a' && *name<='z' || *name=='_' || *name==PUBLIC_CHAR);
15.26 + assert((*name>='A' && *name<='Z') || (*name>='a' && *name<='z') || *name=='_' || *name==PUBLIC_CHAR);
15.27 item=substindex[(int)*name-PUBLIC_CHAR];
15.28 if (item!=NULL)
15.29 item=find_stringpair(item,name,length);