Author: petdance
Date: Fri May  9 21:24:51 2008
New Revision: 27402

Modified:
   trunk/compilers/imcc/pcc.c
   trunk/include/parrot/string.h

Log:
use STRNEQ instead of strcmp() as a boolean

Modified: trunk/compilers/imcc/pcc.c
==============================================================================
--- trunk/compilers/imcc/pcc.c  (original)
+++ trunk/compilers/imcc/pcc.c  Fri May  9 21:24:51 2008
@@ -339,12 +339,12 @@
         return;
 
     if (unit->last_ins->type != (ITPCCSUB|ITLABEL) &&
-            strcmp(unit->last_ins->opname, "ret") &&
-            strcmp(unit->last_ins->opname, "exit") &&
-            strcmp(unit->last_ins->opname, "end") &&
-            strcmp(unit->last_ins->opname, "branch") &&
+            STRNEQ(unit->last_ins->opname, "ret") &&
+            STRNEQ(unit->last_ins->opname, "exit") &&
+            STRNEQ(unit->last_ins->opname, "end") &&
+            STRNEQ(unit->last_ins->opname, "branch") &&
             /* was adding rets multiple times... */
-            strcmp(unit->last_ins->opname, "returncc")) {
+            STRNEQ(unit->last_ins->opname, "returncc")) {
         Instruction *tmp;
 
         /* check to make sure the sub is ok before we try to use it */
@@ -570,7 +570,7 @@
 
     called_sub = sub->pcc_sub->sub;
 
-    if (strcmp(this_sub->name, called_sub->name))
+    if (STRNEQ(this_sub->name, called_sub->name))
         return 0;
 
     if (sub->pcc_sub->nargs != this_sub->pcc_sub->nargs)

Modified: trunk/include/parrot/string.h
==============================================================================
--- trunk/include/parrot/string.h       (original)
+++ trunk/include/parrot/string.h       Fri May  9 21:24:51 2008
@@ -38,7 +38,8 @@
     void (*set_position)(PARROT_INTERP, struct string_iterator_t *i, UINTVAL 
pos);
 } String_iter;
 
-#define STREQ(x, y) (strcmp((x), (y))==0)
+#define STREQ(x, y)  (strcmp((x), (y))==0)
+#define STRNEQ(x, y) (strcmp((x), (y))!=0)
 
 /* stringinfo parameters */
 

Reply via email to