sourcepawn/compiler/sc2.c
changeset 3951 c3f26df2183f
parent 3446 a24e57e5f704
child 4181 b81d517c5a08
     1.1 --- a/sourcepawn/compiler/sc2.c	Thu Jul 18 15:50:50 2013 -0400
     1.2 +++ b/sourcepawn/compiler/sc2.c	Thu Jul 18 15:50:57 2013 -0400
     1.3 @@ -416,7 +416,7 @@
     1.4          #if !defined SC_LIGHT
     1.5            /* collect the comment characters in a string */
     1.6            if (icomment==2) {
     1.7 -            if (skipstar && (*line!='\0' && *line<=' ' || *line=='*')) {
     1.8 +            if (skipstar && ((*line!='\0' && *line<=' ') || *line=='*')) {
     1.9                /* ignore leading whitespace and '*' characters */
    1.10              } else if (commentidx<COMMENT_LIMIT+COMMENT_MARGIN-1) {
    1.11                comment[commentidx++]=(char)((*line!='\n') ? *line : ' ');
    1.12 @@ -1232,7 +1232,7 @@
    1.13          sym=findloc(str);
    1.14          if (sym==NULL)
    1.15            sym=findglb(str,sSTATEVAR);
    1.16 -        if (sym==NULL || sym->ident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0) {
    1.17 +        if (sym==NULL || (sym->ident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0)) {
    1.18            error(17,str);        /* undefined symbol */
    1.19          } else {
    1.20            outval(sym->addr,FALSE);
    1.21 @@ -1668,7 +1668,7 @@
    1.22  	if (strncmp((char*)start,"defined",7)==0 && !isalpha((char)*(start+7))) {
    1.23        start+=7;         /* skip "defined" */
    1.24        /* skip white space & parantheses */
    1.25 -      while (*start<=' ' && *start!='\0' || *start=='(')
    1.26 +      while ((*start<=' ' && *start!='\0') || *start=='(')
    1.27          start++;
    1.28        /* skip the symbol behind it */
    1.29        while (alphanum(*start))
    1.30 @@ -1974,7 +1974,7 @@
    1.31          error(220);
    1.32        } /* if */
    1.33      } /* if */
    1.34 -  } else if (*lptr=='\"' || *lptr==sc_ctrlchar && *(lptr+1)=='\"')
    1.35 +  } else if (*lptr=='\"' || (*lptr==sc_ctrlchar && *(lptr+1)=='\"'))
    1.36    {                                     /* unpacked string literal */
    1.37      _lextok=tSTRING;
    1.38      stringflags= (*lptr==sc_ctrlchar) ? RAWMODE : 0;
    1.39 @@ -1988,9 +1988,9 @@
    1.40        lptr+=1;          /* skip final quote */
    1.41      else
    1.42        error(37);        /* invalid (non-terminated) string */
    1.43 -  } else if (*lptr=='!' && *(lptr+1)=='\"'
    1.44 -             || *lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"'
    1.45 -             || *lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"')
    1.46 +  } else if ((*lptr=='!' && *(lptr+1)=='\"')
    1.47 +             || (*lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"')
    1.48 +             || (*lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"'))
    1.49    {                                     /* packed string literal */
    1.50      _lextok=tSTRING;
    1.51      stringflags= (*lptr==sc_ctrlchar || *(lptr+1)==sc_ctrlchar) ? RAWMODE : 0;
    1.52 @@ -2081,7 +2081,7 @@
    1.53    int tok;
    1.54  
    1.55    tok=lex(&val,&str);
    1.56 -  if (tok==token || token==tTERM && (tok==';' || tok==tENDEXPR)) {
    1.57 +  if (tok==token || (token==tTERM && (tok==';' || tok==tENDEXPR))) {
    1.58      return 1;
    1.59    } else if (!sc_needsemicolon && token==tTERM && (_lexnewline || !freading)) {
    1.60      /* Push "tok" back, because it is the token following the implicit statement
    1.61 @@ -2555,8 +2555,8 @@
    1.62      {
    1.63        assert(sym->states==NULL || sym->states->next!=NULL); /* first element of the state list is the "root" */
    1.64        if (sym->ident==iFUNCTN
    1.65 -          || automaton<0 && sym->states==NULL
    1.66 -          || automaton>=0 && sym->states!=NULL && state_getfsa(sym->states->next->index)==automaton)
    1.67 +          || (automaton<0 && sym->states==NULL)
    1.68 +          || (automaton>=0 && sym->states!=NULL && state_getfsa(sym->states->next->index)==automaton))
    1.69        {
    1.70          if (cmptag==NULL)
    1.71            return sym;   /* return first match */
    1.72 @@ -2785,8 +2785,8 @@
    1.73     * the symbol without states if no symbol with states exists).
    1.74     */
    1.75    assert(vclass!=sGLOBAL || (sym=findglb(name,sGLOBAL))==NULL || (sym->usage & uDEFINE)==0
    1.76 -         || sym->ident==iFUNCTN && sym==curfunc
    1.77 -         || sym->states==NULL && sc_curstates>0);
    1.78 +         || (sym->ident==iFUNCTN && sym==curfunc)
    1.79 +         || (sym->states==NULL && sc_curstates>0));
    1.80  
    1.81    if (ident==iARRAY || ident==iREFARRAY) {
    1.82      symbol *parent=NULL,*top;