Author: paultcochrane
Date: Sat Mar 31 05:41:12 2007
New Revision: 17885

Modified:
   trunk/compilers/imcc/imc.h
   trunk/compilers/imcc/imcc.y

Log:
[imcc] Fixed parentheses as per coding standards
Patch courtesy of Shawn M Moore <sartak at gmail dot com>

Modified: trunk/compilers/imcc/imc.h
==============================================================================
--- trunk/compilers/imcc/imc.h  (original)
+++ trunk/compilers/imcc/imc.h  Sat Mar 31 05:41:12 2007
@@ -53,7 +53,7 @@
 
 #define IMCC_TRY(a,e)     do{ e=0; switch (setjmp(a)){ case 0:
 #define IMCC_CATCH(x)     break; case x:
-#define IMCC_END_TRY      } }while(0)
+#define IMCC_END_TRY      } }while (0)
 
 #define IMCC_THROW(a,x)  longjmp(a,x)
 

Modified: trunk/compilers/imcc/imcc.y
==============================================================================
--- trunk/compilers/imcc/imcc.y (original)
+++ trunk/compilers/imcc/imcc.y Sat Mar 31 05:41:12 2007
@@ -202,7 +202,7 @@
 iINDEXFETCH(Interp *interp, IMC_Unit * unit, SymReg * r0, SymReg * r1,
             SymReg * r2)
 {
-    if(r0->set == 'S' && r1->set == 'S' && r2->set == 'I') {
+    if (r0->set == 'S' && r1->set == 'S' && r2->set == 'I') {
         SymReg * r3 = mk_const(interp, str_dup("1"), 'I');
         return MK_I(interp, unit, "substr %s, %s, %s, 1", 4, r0, r1, r2, r3);
     }
@@ -218,7 +218,7 @@
 iINDEXSET(Interp *interp, IMC_Unit * unit,
           SymReg * r0, SymReg * r1, SymReg * r2)
 {
-    if(r0->set == 'S' && r1->set == 'I' && r2->set == 'S') {
+    if (r0->set == 'S' && r1->set == 'I' && r2->set == 'S') {
         SymReg * r3 = mk_const(interp, str_dup("1"), 'I');
         MK_I(interp, unit, "substr %s, %s, %s, %s", 4, r0, r1,r3, r2);
     }
@@ -296,10 +296,10 @@
     Instruction *i, *ins;
     char name[128];
     ins = IMCC_INFO(interp)->cur_unit->instructions;
-    if(!ins || !ins->r[0] || !(ins->r[0]->type & VT_PCC_SUB))
+    if (!ins || !ins->r[0] || !(ins->r[0]->type & VT_PCC_SUB))
         IMCC_fataly(interp, E_SyntaxError,
                     "yield or return directive outside pcc subroutine\n");
-    if(yield)
+    if (yield)
        ins->r[0]->pcc_sub->calls_a_sub = 1 | ITPCCYIELD;
     sprintf(name, yield ? "%cpcc_sub_yield_%d" : "%cpcc_sub_ret_%d",
             IMCC_INTERNAL_CHAR, IMCC_INFO(interp)->cnr++);
@@ -873,7 +873,7 @@
 
 pcc_results:
      /* empty */                       {  $$ = 0; }
-   | pcc_results pcc_result '\n'       {  if($2) 
add_pcc_result(IMCC_INFO(interp)->cur_call, $2); }
+   | pcc_results pcc_result '\n'       {  if ($2) 
add_pcc_result(IMCC_INFO(interp)->cur_call, $2); }
    ;
 
 pcc_result:
@@ -929,10 +929,10 @@
 pcc_returns:
      /* empty */   {  $$ = 0; }
    | pcc_returns '\n'      {
-       if($1) add_pcc_return(IMCC_INFO(interp)->sr_return, $1);
+       if ($1) add_pcc_return(IMCC_INFO(interp)->sr_return, $1);
    }
    | pcc_returns pcc_return '\n'      {
-       if($2) add_pcc_return(IMCC_INFO(interp)->sr_return, $2);
+       if ($2) add_pcc_return(IMCC_INFO(interp)->sr_return, $2);
    }
    ;
 
@@ -1076,7 +1076,7 @@
    | LOCAL           { is_def=1; } type id_list
      {
          IdList* l = $4;
-         while(l) {
+         while (l) {
              IdList* l1;
              if (l->unique_reg)
                  mk_ident_ur(interp, l->id, $3);

Reply via email to