[svn:parrot] r37099 - in trunk: compilers/pirc/src languages/regex/pmc src src/call src/io src/ops src/pmc src/string

Util at svn.parrot.org Util at svn.parrot.org
Tue Mar 3 18:23:13 UTC 2009


Author: Util
Date: Tue Mar  3 18:23:12 2009
New Revision: 37099
URL: https://trac.parrot.org/parrot/changeset/37099

Log:
[cage] (TT #397) PDD07 enforcement for Parrot_str_not_equal(foo,bar)==0

Modified:
   trunk/compilers/pirc/src/bcgen.c
   trunk/languages/regex/pmc/matchrange.pmc
   trunk/src/call/pcc.c
   trunk/src/dynext.c
   trunk/src/exceptions.c
   trunk/src/hll.c
   trunk/src/io/filehandle.c
   trunk/src/library.c
   trunk/src/multidispatch.c
   trunk/src/oo.c
   trunk/src/ops/cmp.ops
   trunk/src/packfile.c
   trunk/src/pmc/class.pmc
   trunk/src/pmc/codestring.pmc
   trunk/src/pmc/complex.pmc
   trunk/src/pmc/cpointer.pmc
   trunk/src/pmc/default.pmc
   trunk/src/pmc/eventhandler.pmc
   trunk/src/pmc/exception.pmc
   trunk/src/pmc/filehandle.pmc
   trunk/src/pmc/namespace.pmc
   trunk/src/pmc/parrotinterpreter.pmc
   trunk/src/pmc/pmcproxy.pmc
   trunk/src/pmc/role.pmc
   trunk/src/pmc/scalar.pmc
   trunk/src/pmc/scheduler.pmc
   trunk/src/pmc/stringhandle.pmc
   trunk/src/pmc/sub.pmc
   trunk/src/scheduler.c
   trunk/src/string/charset.c
   trunk/src/string/encoding.c
   trunk/src/sub.c

Modified: trunk/compilers/pirc/src/bcgen.c
==============================================================================
--- trunk/compilers/pirc/src/bcgen.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/compilers/pirc/src/bcgen.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -191,7 +191,7 @@
     while (index < count) {
         constant = bc->interp->code->const_table->constants[index];
         if (constant->type == PFC_STRING) {
-            if (Parrot_str_not_equal(bc->interp, constant->u.string, parrotstr) == 0) {
+            if (Parrot_str_equal(bc->interp, constant->u.string, parrotstr)) {
 #if DEBUGBC
                 fprintf(stderr, "found string %s at index %d\n", str, index);
 #endif
@@ -269,7 +269,7 @@
 
         if (constant->type == PFC_KEY) {
             STRING *s2 = key_set_to_string(bc->interp, constant->u.key);
-            if (Parrot_str_not_equal(bc->interp, s1, s2) == 0) {
+            if (Parrot_str_equal(bc->interp, s1, s2)) {
 #if DEBUGBC
                 fprintf(stderr, "found equal key (%d)\n", index);
 #endif

Modified: trunk/languages/regex/pmc/matchrange.pmc
==============================================================================
--- trunk/languages/regex/pmc/matchrange.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/languages/regex/pmc/matchrange.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -57,10 +57,10 @@
     STRING *start = Parrot_str_new(interp, "start", 5);
     STRING *end;
 
-    if (0 == Parrot_str_not_equal(interp, key, start))
+    if (Parrot_str_equal(interp, key, start))
         return &RANGE_START(self);
     end = Parrot_str_new(interp, "end", 3);
-    if (0 == Parrot_str_not_equal(interp, key, end))
+    if (Parrot_str_equal(interp, key, end))
         return &RANGE_END(self);
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_KEY_NOT_FOUND,
         "MatchRange: key is neither 'start' nor 'end'");

Modified: trunk/src/call/pcc.c
==============================================================================
--- trunk/src/call/pcc.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/call/pcc.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -1305,7 +1305,7 @@
                 ? st->dest.ctx->constants[idx]->u.string
                 : CTX_REG_STR(st->dest.ctx, idx);
 
-        if (st->name == param || Parrot_str_not_equal(interp, st->name, param) == 0) {
+        if (st->name == param || Parrot_str_equal(interp, st->name, param)) {
             ++i;
             st->dest.sig = VTABLE_get_integer_keyed_int(interp,
                     st->dest.u.op.signature, i);

Modified: trunk/src/dynext.c
==============================================================================
--- trunk/src/dynext.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/dynext.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -516,7 +516,7 @@
     STRING * const type =
         VTABLE_get_string(s, VTABLE_getprop(s, lib_pmc, type_str));
 
-    if (!Parrot_str_not_equal(s, type, ops)) {
+    if (Parrot_str_equal(s, type, ops)) {
         /* we can't clone oplibs in the normal way, since they're actually
          * shared between interpreters dynop_register modifies the (statically
          * allocated) op_lib_t structure from core_ops.c, for example.

Modified: trunk/src/exceptions.c
==============================================================================
--- trunk/src/exceptions.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/exceptions.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -123,7 +123,7 @@
         }
     }
 
-    if (Parrot_str_not_equal(interp, message, CONST_STRING(interp, "")) == 1) {
+    if (Parrot_str_not_equal(interp, message, CONST_STRING(interp, ""))) {
         Parrot_io_eprintf(interp, "%S\n", message);
 
         /* caution against output swap (with PDB_backtrace) */
@@ -206,7 +206,7 @@
         const INTVAL   severity    = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "severity"));
         if (severity < EXCEPT_error) {
             PMC * const resume = VTABLE_get_attr_str(interp, exception, CONST_STRING(interp, "resume"));
-            if (Parrot_str_not_equal(interp, message, CONST_STRING(interp, "")) == 1) {
+            if (Parrot_str_not_equal(interp, message, CONST_STRING(interp, ""))) {
                 Parrot_io_eprintf(interp, "%S\n", message);
             }
             else {

Modified: trunk/src/hll.c
==============================================================================
--- trunk/src/hll.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/hll.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -238,7 +238,7 @@
 
         if (!PMC_IS_NULL(lib_name)) {
             const STRING * const name = VTABLE_get_string(interp, lib_name);
-            if (Parrot_str_not_equal(interp, name, hll_lib) == 0)
+            if (Parrot_str_equal(interp, name, hll_lib))
                 break;
         }
     }

Modified: trunk/src/io/filehandle.c
==============================================================================
--- trunk/src/io/filehandle.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/io/filehandle.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -653,7 +653,7 @@
     if (STRING_IS_NULL(handle_struct->encoding))
         return 0;
 
-    if (Parrot_str_not_equal(interp, value, handle_struct->encoding) == 0)
+    if (Parrot_str_equal(interp, value, handle_struct->encoding))
         return 1;
 
     return 0;

Modified: trunk/src/library.c
==============================================================================
--- trunk/src/library.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/library.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -535,7 +535,7 @@
         if (Parrot_str_byte_length(interp, test_path) > 4) {
             STRING *orig_ext = Parrot_str_substr(interp, test_path, -4, 4, NULL, 0);
             /* First try substituting .pbc for the .pir extension */
-            if (Parrot_str_not_equal(interp, orig_ext, pir_extension) == 0) {
+            if (Parrot_str_equal(interp, orig_ext, pir_extension)) {
                 STRING * const without_ext = Parrot_str_chopn(interp, test_path, 4);
                 test_path = Parrot_str_append(interp, without_ext, bytecode_extension);
                 result = try_load_path(interp, test_path);
@@ -543,7 +543,7 @@
                     return result;
             }
             /* Next try substituting .pir, then .pasm for the .pbc extension */
-            else if (Parrot_str_not_equal(interp, orig_ext, bytecode_extension) == 0) {
+            else if (Parrot_str_equal(interp, orig_ext, bytecode_extension)) {
                 STRING * const without_ext = Parrot_str_chopn(interp, test_path, 4);
                 test_path = Parrot_str_append(interp, without_ext, pir_extension);
                 result = try_load_path(interp, test_path);
@@ -561,7 +561,7 @@
         /* Finally, try substituting .pbc for the .pasm extension. */
         if (Parrot_str_byte_length(interp, test_path) > 5) {
             STRING * const orig_ext = Parrot_str_substr(interp, test_path, -5, 5, NULL, 0);
-            if (Parrot_str_not_equal(interp, orig_ext, pasm_extension) == 0) {
+            if (Parrot_str_equal(interp, orig_ext, pasm_extension)) {
                 STRING * const without_ext = Parrot_str_chopn(interp, test_path, 5);
                 test_path = Parrot_str_append(interp, without_ext, bytecode_extension);
                 result = try_load_path(interp, test_path);

Modified: trunk/src/multidispatch.c
==============================================================================
--- trunk/src/multidispatch.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/multidispatch.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -659,13 +659,13 @@
         STRING *type_name = VTABLE_get_string_keyed_int(interp, type_list, i);
         INTVAL  type;
 
-        if (Parrot_str_not_equal(interp, type_name, CONST_STRING(interp, "DEFAULT"))==0)
+        if (Parrot_str_equal(interp, type_name, CONST_STRING(interp, "DEFAULT")))
             type = enum_type_PMC;
-        else if (Parrot_str_not_equal(interp, type_name, CONST_STRING(interp, "STRING"))==0)
+        else if (Parrot_str_equal(interp, type_name, CONST_STRING(interp, "STRING")))
             type = enum_type_STRING;
-        else if (Parrot_str_not_equal(interp, type_name, CONST_STRING(interp, "INTVAL"))==0)
+        else if (Parrot_str_equal(interp, type_name, CONST_STRING(interp, "INTVAL")))
             type = enum_type_INTVAL;
-        else if (Parrot_str_not_equal(interp, type_name, CONST_STRING(interp, "FLOATVAL"))==0)
+        else if (Parrot_str_equal(interp, type_name, CONST_STRING(interp, "FLOATVAL")))
             type = enum_type_FLOATVAL;
         else
             type = pmc_type(interp, type_name);

Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/oo.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -772,7 +772,7 @@
         return found;
 
 
-    if (!Parrot_str_not_equal(interp, method_name, CONST_STRING(interp, "__get_string")))
+    if (Parrot_str_equal(interp, method_name, CONST_STRING(interp, "__get_string")))
         return find_method_direct_1(interp, _class, CONST_STRING(interp, "__get_repr"));
 
     return PMCNULL;
@@ -1195,7 +1195,7 @@
                 const STRING * const check =
                     VTABLE_get_string_keyed_int(interp, exclude, i);
 
-                if (Parrot_str_not_equal(interp, check, method_name) == 0) {
+                if (Parrot_str_equal(interp, check, method_name)) {
                     excluded = 1;
                     break;
                 }

Modified: trunk/src/ops/cmp.ops
==============================================================================
--- trunk/src/ops/cmp.ops	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/ops/cmp.ops	Tue Mar  3 18:23:12 2009	(r37099)
@@ -77,7 +77,7 @@
 }
 
 op eq(in STR, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_not_equal(interp, $1, $2) == 0) {
+  if (Parrot_str_equal(interp, $1, $2)) {
     goto OFFSET($3);
   }
 }
@@ -113,7 +113,7 @@
 }
 
 op eq(invar PMC, in STR, inconst LABEL) :base_core {
-  if (0 == Parrot_str_not_equal(interp,
+  if (Parrot_str_equal(interp,
       VTABLE_get_string(interp, $1), $2)) {
     goto OFFSET($3);
   }
@@ -184,7 +184,7 @@
 }
 
 op ne(in STR, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_not_equal(interp, $1, $2) != 0) {
+  if (Parrot_str_not_equal(interp, $1, $2)) {
     goto OFFSET($3);
   }
 }
@@ -214,7 +214,7 @@
 }
 
 op ne(invar PMC, in STR, inconst LABEL) :base_core {
-  if (0 != Parrot_str_not_equal(interp,
+  if (Parrot_str_not_equal(interp,
       VTABLE_get_string(interp, $1), $2)) {
     goto OFFSET($3);
   }
@@ -842,7 +842,7 @@
 }
 
 inline op iseq(out INT, in STR, in STR) {
-  $1 = Parrot_str_not_equal(interp, $2, $3) == 0;
+  $1 = ( Parrot_str_equal(interp, $2, $3) ? 1 : 0 );
 }
 
 inline op iseq(out INT, invar PMC, invar PMC) {
@@ -873,7 +873,7 @@
 }
 
 inline op isne(out INT, in STR, in STR) {
-  $1 = Parrot_str_not_equal(interp, $2, $3) != 0;
+  $1 = ( Parrot_str_not_equal(interp, $2, $3) ? 1 : 0 );
 }
 
 inline op isne(out INT, invar PMC, invar PMC) {

Modified: trunk/src/packfile.c
==============================================================================
--- trunk/src/packfile.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/packfile.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -4327,7 +4327,7 @@
 
     for (i = 0; i < self->num_keys; i++) {
         STRING *test_key = PF_CONST(self->code, self->keys[i]->name)->u.string;
-        if (Parrot_str_not_equal(interp, test_key, key_name) == 0) {
+        if (Parrot_str_equal(interp, test_key, key_name)) {
             key_id = i;
             break;
         }
@@ -4450,7 +4450,7 @@
     if (key) {
         for (i = 0; i < self->num_keys; i++) {
             STRING *test_key = PF_CONST(self->code, self->keys[i]->name)->u.string;
-            if (Parrot_str_not_equal(interp, test_key, key) == 0) {
+            if (Parrot_str_equal(interp, test_key, key)) {
                 key_id = i;
                 break;
             }
@@ -4590,7 +4590,7 @@
 
     pbc = CONST_STRING(interp, "pbc");
 
-    if (Parrot_str_not_equal(interp, ext, pbc) == 0)
+    if (Parrot_str_equal(interp, ext, pbc))
         file_type = PARROT_RUNTIME_FT_PBC;
     else
         file_type = PARROT_RUNTIME_FT_SOURCE;

Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/class.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -808,7 +808,7 @@
             STRING * const current_name = VTABLE_get_string(interp, current_parent);
 
             /* throw an exception if we already have this parent */
-            if (Parrot_str_not_equal(interp, current_name, parent_name) == 0)
+            if (Parrot_str_equal(interp, current_name, parent_name))
                 Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_INVALID_OPERATION,
                     "The class '%S' already has a parent class '%S'. "
@@ -970,40 +970,40 @@
         /* What should we return? */
         PMC *found;
 
-        if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "name")) == 0) {
+        if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) {
             found = pmc_new(interp, enum_class_String);
             VTABLE_set_string_native(interp, found, _class->name);
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "id")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "id"))) {
             found = pmc_new(interp, enum_class_Integer);
             VTABLE_set_integer_native(interp, found, _class->id);
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "namespace")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "namespace"))) {
             /* Should not clone this. */
             return _class->_namespace;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "attributes")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attributes"))) {
             found = _class->attrib_metadata;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "attrib_index")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attrib_index"))) {
             found = _class->attrib_index;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "methods")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "methods"))) {
             found = _class->methods;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "vtable_overrides")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "vtable_overrides"))) {
             found = _class->vtable_overrides;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "parents")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "parents"))) {
             found = _class->parents;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "all_parents")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "all_parents"))) {
             found = _class->all_parents;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "roles")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "roles"))) {
             found = _class->roles;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "flags")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "flags"))) {
             found = pmc_new(interp, enum_class_Integer);
             VTABLE_set_integer_native(interp, found,
                 (INTVAL)PObj_get_FLAGS(SELF));
@@ -1290,7 +1290,7 @@
                                : make_class_name(interp, SELF);
 
             /* Check if the passed name is the same as the stored short name. */
-            INTVAL name_match = Parrot_str_not_equal(interp, classname, self_name) == 0;
+            INTVAL name_match = Parrot_str_equal(interp, classname, self_name);
 
             Parrot_str_free(interp, classname);
             if (is_proxy)
@@ -1329,7 +1329,7 @@
         PMC *want_class;
 
         /* hard-code this one exception right away */
-        if (Parrot_str_not_equal(interp, classname, CONST_STRING(interp, "Class")) == 0)
+        if (Parrot_str_equal(interp, classname, CONST_STRING(interp, "Class")))
             return 1;
 
         want_class = Parrot_oo_get_class_str(interp, classname);

Modified: trunk/src/pmc/codestring.pmc
==============================================================================
--- trunk/src/pmc/codestring.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/codestring.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -86,7 +86,7 @@
             I0   = Parrot_str_to_int(INTERP, key);
             repl = VTABLE_get_string_keyed_int(INTERP, args, I0);
         }
-        else if (0 == Parrot_str_not_equal(INTERP, key, comma)) {
+        else if (Parrot_str_equal(INTERP, key, comma)) {
             repl = VTABLE_get_string_keyed_int(INTERP, args, 0);
             repl = Parrot_str_new_COW(INTERP, repl);
             I1   = VTABLE_elements(INTERP, args);
@@ -99,7 +99,7 @@
                 I0++;
             }
         }
-        else if (0 == Parrot_str_not_equal(INTERP, key, percent)) {
+        else if (Parrot_str_equal(INTERP, key, percent)) {
             repl = percent;
         }
         else {

Modified: trunk/src/pmc/complex.pmc
==============================================================================
--- trunk/src/pmc/complex.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/complex.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -483,10 +483,10 @@
 
     VTABLE FLOATVAL get_number_keyed_str(STRING *key) {
         FLOATVAL value;
-        if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "real")) == 0) {
+        if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "real"))) {
             GET_ATTR_re(INTERP, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "imag")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "imag"))) {
             GET_ATTR_im(INTERP, SELF, value);
         }
         else
@@ -670,10 +670,10 @@
     }
 
     VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) {
-        if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "real")) == 0) {
+        if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "real"))) {
             SET_ATTR_re(INTERP, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "imag")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "imag"))) {
             SET_ATTR_im(INTERP, SELF, value);
         }
         else

Modified: trunk/src/pmc/cpointer.pmc
==============================================================================
--- trunk/src/pmc/cpointer.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/cpointer.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -91,12 +91,12 @@
             pobject_lives(interp, (PObj *)data->sig);
 
         if (data->pointer) {
-            if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+            if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
                 PMC ** const pmc_pointer = (PMC **) data->pointer;
                 PARROT_ASSERT(*pmc_pointer);
                 pobject_lives(interp, (PObj *) *pmc_pointer);
             }
-            else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "S")) == 0) {
+            else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
                 STRING ** const str_pointer = (STRING **) data->pointer;
                 PARROT_ASSERT(*str_pointer);
                 pobject_lives(interp, (PObj *) *str_pointer);
@@ -214,11 +214,11 @@
     VTABLE INTVAL get_integer() {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "I")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
             const INTVAL * const int_pointer = (INTVAL *) data->pointer;
             return *int_pointer;
         }
-        else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             return VTABLE_get_integer(interp, *pmc_pointer);
         }
@@ -241,11 +241,11 @@
     VTABLE void set_integer_native(INTVAL value) {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "I")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
             INTVAL * const int_pointer = (INTVAL *) data->pointer;
             *int_pointer = value;
         }
-        else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             VTABLE_set_integer_native(interp, *pmc_pointer, value);
         }
@@ -269,11 +269,11 @@
     VTABLE FLOATVAL get_number() {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "N")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
             const FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
             return *num_pointer;
         }
-        else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             return VTABLE_get_number(interp, *pmc_pointer);
         }
@@ -295,11 +295,11 @@
     VTABLE void set_number_native(FLOATVAL value) {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "N")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
             FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
             *num_pointer = value;
         }
-        else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             VTABLE_set_number_native(interp, *pmc_pointer, value);
         }
@@ -323,11 +323,11 @@
     VTABLE STRING *get_string() {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "S")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
             STRING ** const str_pointer = (STRING **) data->pointer;
             return *str_pointer;
         }
-        else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             return VTABLE_get_string(interp, *pmc_pointer);
         }
@@ -349,11 +349,11 @@
     VTABLE void set_string_native(STRING *value) {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "S")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
             STRING ** const str_pointer = (STRING **) data->pointer;
             *str_pointer = value;
         }
-        else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             VTABLE_set_string_native(interp, *pmc_pointer, value);
         }
@@ -376,7 +376,7 @@
     VTABLE PMC *get_pmc() {
         const Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             return *pmc_pointer;
         }
@@ -397,7 +397,7 @@
     VTABLE void set_pmc(PMC *value) {
         const Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "P")) == 0) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             *pmc_pointer = value;
         }

Modified: trunk/src/pmc/default.pmc
==============================================================================
--- trunk/src/pmc/default.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/default.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -944,13 +944,13 @@
 */
 
     PMC *inspect_str(STRING *name) {
-        if (Parrot_str_not_equal(interp, name, CONST_STRING(interp, "flags")) == 0) {
+        if (Parrot_str_equal(interp, name, CONST_STRING(interp, "flags"))) {
             PMC *found = pmc_new(interp, enum_class_Integer);
             VTABLE_set_integer_native(interp, found,
                     (INTVAL)PObj_get_FLAGS(SELF));
             return found;
         }
-        else if (Parrot_str_not_equal(interp, name, CONST_STRING(interp, "mro")) == 0) {
+        else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "mro"))) {
             return VTABLE_clone(interp, SELF->vtable->mro);
         }
         else

Modified: trunk/src/pmc/eventhandler.pmc
==============================================================================
--- trunk/src/pmc/eventhandler.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/eventhandler.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -246,7 +246,7 @@
             = PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
         PMC *value = PMCNULL;
 
-        if (Parrot_str_not_equal(interp, name, CONST_STRING(interp, "code")) == 0) {
+        if (Parrot_str_equal(interp, name, CONST_STRING(interp, "code"))) {
             value = core_struct->code;
         }
 
@@ -306,11 +306,11 @@
             PMC *type = VTABLE_get_attr_str(interp, event, CONST_STRING(interp, "type"));
             STRING *type_str = VTABLE_get_string(interp, type);
 
-            if (Parrot_str_not_equal(interp, type_str, CONST_STRING(interp, "event")) == 0) {
+            if (Parrot_str_equal(interp, type_str, CONST_STRING(interp, "event"))) {
                 PMC *subtype = VTABLE_get_attr_str(interp, event, CONST_STRING(interp, "subtype"));
                 STRING *subtype_str = VTABLE_get_string(interp, subtype);
 
-                if (Parrot_str_not_equal(interp, subtype_str, handler_struct->type) == 0) {
+                if (Parrot_str_equal(interp, subtype_str, handler_struct->type)) {
                     RETURN(INTVAL 1);
                 }
             }

Modified: trunk/src/pmc/exception.pmc
==============================================================================
--- trunk/src/pmc/exception.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/exception.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -240,7 +240,7 @@
         STRING *name = VTABLE_get_string(INTERP, key);
         STRING *message;
 
-        if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "message")) == 0) {
+        if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
             GET_ATTR_message(interp, SELF, message);
         }
         else {
@@ -266,16 +266,16 @@
         STRING *name   = VTABLE_get_string(INTERP, key);
         INTVAL  result = 0;
 
-        if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "type")) == 0) {
+        if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
             GET_ATTR_type(interp, SELF, result);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "severity")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
             GET_ATTR_severity(interp, SELF, result);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "exit_code")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
             GET_ATTR_exit_code(interp, SELF, result);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "handled")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
             GET_ATTR_handled(interp, SELF, result);
         }
         else {
@@ -300,16 +300,16 @@
     VTABLE INTVAL get_integer_keyed_str(STRING *key) {
         INTVAL result = 0;
 
-        if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "type")) == 0) {
+        if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "type"))) {
             GET_ATTR_type(interp, SELF, result);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "severity")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "severity"))) {
             GET_ATTR_severity(interp, SELF, result);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "exit_code")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "exit_code"))) {
             GET_ATTR_exit_code(interp, SELF, result);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "handled")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "handled"))) {
             GET_ATTR_handled(interp, SELF, result);
         }
         else {
@@ -394,7 +394,7 @@
     VTABLE void set_string_keyed(PMC *key, STRING *value) {
         STRING *name = VTABLE_get_string(INTERP, key);
 
-        if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "message")) == 0) {
+        if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
             SET_ATTR_message(interp, SELF, value);
         }
         else {
@@ -417,16 +417,16 @@
     VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
         STRING *name = VTABLE_get_string(INTERP, key);
 
-        if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "type")) == 0) {
+        if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
             SET_ATTR_type(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "severity")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
             SET_ATTR_severity(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "exit_code")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
             SET_ATTR_exit_code(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "handled")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
             SET_ATTR_handled(interp, SELF, value);
         }
         else {
@@ -447,16 +447,16 @@
 */
 
     VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
-        if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "type")) == 0) {
+        if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "type"))) {
             SET_ATTR_type(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "severity")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "severity"))) {
             SET_ATTR_severity(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "exit_code")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "exit_code"))) {
             SET_ATTR_exit_code(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, key, CONST_STRING(INTERP, "handled")) == 0) {
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "handled"))) {
             SET_ATTR_handled(interp, SELF, value);
         }
         else {
@@ -562,46 +562,46 @@
     VTABLE PMC *get_attr_str(STRING *name) {
         PMC *value = PMCNULL;
 
-        if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "type")) == 0) {
+        if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
                 INTVAL type;
                 GET_ATTR_type(interp, SELF, type);
                 value = pmc_new(interp, enum_class_Integer);
                 VTABLE_set_integer_native(interp, value, type);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "severity")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
                 INTVAL severity;
                 GET_ATTR_severity(interp, SELF, severity);
                 value = pmc_new(interp, enum_class_Integer);
                 VTABLE_set_integer_native(interp, value, severity);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "exit_code")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
                 INTVAL exit_code;
                 GET_ATTR_exit_code(interp, SELF, exit_code);
                 value = pmc_new(interp, enum_class_Integer);
                 VTABLE_set_integer_native(interp, value, exit_code);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "handled")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
                 INTVAL handled;
                 GET_ATTR_handled(interp, SELF, handled);
                 value = pmc_new(interp, enum_class_Integer);
                 VTABLE_set_integer_native(interp, value, handled);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "message")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
                 STRING *message;
                 GET_ATTR_message(interp, SELF, message);
                 value = pmc_new(interp, enum_class_String);
                 VTABLE_set_string_native(interp, value, message);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "payload")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "payload"))) {
                 GET_ATTR_payload(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "resume")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "resume"))) {
                 GET_ATTR_resume(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "backtrace")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "backtrace"))) {
                 GET_ATTR_backtrace(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "handler_iter")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handler_iter"))) {
                 GET_ATTR_handler_iter(interp, SELF, value);
         }
         else {
@@ -624,36 +624,36 @@
 */
     VTABLE void set_attr_str(STRING *name, PMC *value) {
 
-        if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "type")) == 0) {
+        if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) {
             INTVAL type = VTABLE_get_integer(interp, value);
             SET_ATTR_type(interp, SELF, type);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "severity")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) {
             INTVAL severity = VTABLE_get_integer(interp, value);
             SET_ATTR_severity(interp, SELF, severity);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "exit_code")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) {
             INTVAL exit_code = VTABLE_get_integer(interp, value);
             SET_ATTR_exit_code(interp, SELF, exit_code);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "handled")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) {
             INTVAL handled = VTABLE_get_integer(interp, value);
             SET_ATTR_handled(interp, SELF, handled);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "message")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
             STRING *message = VTABLE_get_string(interp, value);
             SET_ATTR_message(interp, SELF, message);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "payload")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "payload"))) {
             SET_ATTR_payload(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "resume")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "resume"))) {
             SET_ATTR_resume(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "backtrace")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "backtrace"))) {
             SET_ATTR_backtrace(interp, SELF, value);
         }
-        else if (Parrot_str_not_equal(INTERP, name, CONST_STRING(INTERP, "handler_iter")) == 0) {
+        else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handler_iter"))) {
             SET_ATTR_handler_iter(interp, SELF, value);
         }
         else {

Modified: trunk/src/pmc/filehandle.pmc
==============================================================================
--- trunk/src/pmc/filehandle.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/filehandle.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -551,11 +551,11 @@
         STRING * const fullbuffer_string = CONST_STRING(INTERP, "full-buffered");
 
         if (got_type) {
-            if (Parrot_str_not_equal(INTERP, new_type, nobuffer_string) == 0)
+            if (Parrot_str_equal(INTERP, new_type, nobuffer_string))
                 Parrot_io_setbuf(INTERP, SELF, PIOCTL_NONBUF);
-            else if (Parrot_str_not_equal(INTERP, new_type, linebuffer_string) == 0)
+            else if (Parrot_str_equal(INTERP, new_type, linebuffer_string))
                 Parrot_io_setlinebuf(INTERP, SELF);
-            else if (Parrot_str_not_equal(INTERP, new_type, fullbuffer_string) == 0)
+            else if (Parrot_str_equal(INTERP, new_type, fullbuffer_string))
                 Parrot_io_setbuf(INTERP, SELF, PIO_UNBOUND);
         }
 

Modified: trunk/src/pmc/namespace.pmc
==============================================================================
--- trunk/src/pmc/namespace.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/namespace.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -92,7 +92,7 @@
     if (sub->comp_flags & SUB_COMP_FLAG_METHOD) {
         STRING *method_name = key;
 
-        if (0 != Parrot_str_not_equal(interp, sub->method_name, CONST_STRING(interp, "")))
+        if (Parrot_str_not_equal(interp, sub->method_name, CONST_STRING(interp, "")))
             method_name = sub->method_name;
         add_to_class(interp, nsinfo, classobj, method_name, value);
     }
@@ -279,7 +279,7 @@
                 if (sub->comp_flags & SUB_COMP_FLAG_METHOD) {
                     STRING *method_name = key;
 
-                    if (0 != Parrot_str_not_equal(interp, sub->method_name, CONST_STRING(interp, "")))
+                    if (Parrot_str_not_equal(interp, sub->method_name, CONST_STRING(interp, "")))
                         method_name = sub->method_name;
 
                     add_to_class(INTERP, nsinfo, classobj, method_name, value);

Modified: trunk/src/pmc/parrotinterpreter.pmc
==============================================================================
--- trunk/src/pmc/parrotinterpreter.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/parrotinterpreter.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -382,12 +382,12 @@
 
         Parrot_Context *ctx;
 
-        if (Parrot_str_not_equal(interp, item, s) == 0)
+        if (Parrot_str_equal(interp, item, s))
             return interp->root_namespace;
 
         s     = CONST_STRING(interp, "outer");
 
-        if (Parrot_str_not_equal(interp, item, s) == 0) {
+        if (Parrot_str_equal(interp, item, s)) {
             outer   = item;
             nextkey = key_next(INTERP, key);
 
@@ -439,27 +439,27 @@
 
         s = CONST_STRING(interp, "sub");
 
-        if (Parrot_str_not_equal(interp, item, s) == 0)
+        if (Parrot_str_equal(interp, item, s))
             return ctx->current_sub;
 
         s = CONST_STRING(interp, "lexpad");
 
-        if (Parrot_str_not_equal(interp, item, s) == 0)
+        if (Parrot_str_equal(interp, item, s))
             return ctx->lex_pad;
 
         s = CONST_STRING(interp, "namespace");
 
-        if (Parrot_str_not_equal(interp, item, s) == 0)
+        if (Parrot_str_equal(interp, item, s))
             return ctx->current_namespace;
 
         s = CONST_STRING(interp, "continuation");
 
-        if (Parrot_str_not_equal(interp, item, s) == 0)
+        if (Parrot_str_equal(interp, item, s))
             return VTABLE_clone(interp, ctx->current_cont);
 
         s = CONST_STRING(interp, "annotations");
 
-        if (Parrot_str_not_equal(interp, item, s) == 0) {
+        if (Parrot_str_equal(interp, item, s)) {
             Parrot_sub *sub;
             PMC        *sub_pmc = ctx->current_sub;
             PMC_get_sub(interp, sub_pmc, sub);

Modified: trunk/src/pmc/pmcproxy.pmc
==============================================================================
--- trunk/src/pmc/pmcproxy.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/pmcproxy.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -137,7 +137,7 @@
         for (i = 1; i < mro_length; i++) {
             PMC    *pclass = VTABLE_get_pmc_keyed_int(interp, interp->vtables[type_num]->mro, i);
             STRING *cname  = pclass->vtable->whoami;
-            if (Parrot_str_not_equal(interp, cname, CONST_STRING(interp, "scalar")) != 0) {
+            if (Parrot_str_not_equal(interp, cname, CONST_STRING(interp, "scalar"))) {
                 PMC *pproxy = Parrot_oo_get_class_str(interp, cname);
                 VTABLE_push_pmc(interp, proxy_info->all_parents, pproxy);
             }
@@ -283,7 +283,7 @@
         classname = VTABLE_get_string(interp, classobj);
 
         /* Check if the passed name is the same as the stored short name. */
-        if (Parrot_str_not_equal(interp, classname, _proxy->name) == 0)
+        if (Parrot_str_equal(interp, classname, _proxy->name))
             return 1;
 
         /* Check if the class object is the same as self's class object */
@@ -291,7 +291,7 @@
             return 1;
 
         /* Check if the passed name is the same as the fully qualified name. */
-        if (Parrot_str_not_equal(interp, classname, VTABLE_get_string(interp, SELF)) == 0)
+        if (Parrot_str_equal(interp, classname, VTABLE_get_string(interp, SELF)))
             return 1;
 
         /* Look in the isa hash. */
@@ -326,7 +326,7 @@
         Parrot_Class_attributes * const _proxy = PARROT_CLASS(SELF);
         const STRING * const pmc_proxy = CONST_STRING(interp, "PMCProxy");
 
-        if (Parrot_str_not_equal(INTERP, classname, pmc_proxy) == 0)
+        if (Parrot_str_equal(INTERP, classname, pmc_proxy))
             return 1;
 
         if (SUPER(classname))

Modified: trunk/src/pmc/role.pmc
==============================================================================
--- trunk/src/pmc/role.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/role.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -408,21 +408,21 @@
         /* What should we return? */
         PMC         *found;
 
-        if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "name")) == 0) {
+        if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) {
             found = pmc_new(interp, enum_class_String);
             VTABLE_set_string_native(interp, found, role->name);
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "namespace")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "namespace"))) {
             /* Don't clone the namespace, as it's not part of our state. */
             return role->_namespace;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "attributes")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attributes"))) {
             found = role->attrib_metadata;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "methods")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "methods"))) {
             found = role->methods;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "roles")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "roles"))) {
             found = role->roles;
         }
         else {
@@ -533,7 +533,7 @@
         Parrot_Role_attributes * const role  = PARROT_ROLE(SELF);
         INTVAL      i, count;
 
-        if (Parrot_str_not_equal(interp, role->name, role_name) == 0)
+        if (Parrot_str_equal(interp, role->name, role_name))
             return 1;
 
         count = VTABLE_elements(interp, role->roles);

Modified: trunk/src/pmc/scalar.pmc
==============================================================================
--- trunk/src/pmc/scalar.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/scalar.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -1250,7 +1250,7 @@
 */
 
     MULTI INTVAL is_equal_string(PMC *value) {
-        return (0 == Parrot_str_not_equal(INTERP, VTABLE_get_string(INTERP, SELF),
+        return (0 != Parrot_str_equal(INTERP, VTABLE_get_string(INTERP, SELF),
                                           VTABLE_get_string(INTERP, value)));
     }
 

Modified: trunk/src/pmc/scheduler.pmc
==============================================================================
--- trunk/src/pmc/scheduler.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/scheduler.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -429,12 +429,12 @@
         for (index = 0; index < elements; ++index) {
             PMC *handler = VTABLE_get_pmc_keyed_int(INTERP, handlers, index);
             if (!PMC_IS_NULL(handler)) {
-                if (Parrot_str_not_equal(INTERP, type, except_str) == 0
+                if (Parrot_str_equal(INTERP, type, except_str)
                 &&  handler->vtable->base_type == enum_class_ExceptionHandler) {
                     VTABLE_set_pmc_keyed_int(INTERP, handlers, index, PMCNULL);
                     RETURN(void);
                 }
-                else if (Parrot_str_not_equal(INTERP, type, event_str) == 0
+                else if (Parrot_str_equal(INTERP, type, event_str)
                      && handler->vtable->base_type == enum_class_EventHandler) {
                     VTABLE_set_pmc_keyed_int(INTERP, handlers, index, PMCNULL);
                     RETURN(void);
@@ -529,9 +529,9 @@
             STRING *event     = CONST_STRING(INTERP, "event");
 
             if (!PMC_IS_NULL(handler)) {
-                if (((Parrot_str_not_equal(INTERP, type, exception) == 0)
+                if ((Parrot_str_equal(INTERP, type, exception)
                 &&   handler->vtable->base_type == enum_class_ExceptionHandler)
-                || ((Parrot_str_not_equal(INTERP, type, event) == 0)
+                || (Parrot_str_equal(INTERP, type, event)
                 &&  handler->vtable->base_type == enum_class_EventHandler))
                         count++;
             }

Modified: trunk/src/pmc/stringhandle.pmc
==============================================================================
--- trunk/src/pmc/stringhandle.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/stringhandle.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -175,7 +175,7 @@
 
             GET_ATTR_encoding(INTERP, SELF, encoding);
             if (!STRING_IS_NULL(encoding)
-            &&  Parrot_str_not_equal(INTERP, encoding, CONST_STRING(INTERP, "utf8")) == 0)
+            &&  Parrot_str_equal(INTERP, encoding, CONST_STRING(INTERP, "utf8")))
                 new_string = string_make(INTERP, "", 0, "unicode", 0);
             else
                 new_string = Parrot_str_new(INTERP, "", 0);
@@ -342,8 +342,8 @@
             STRING *encoding;
             GET_ATTR_encoding(INTERP, SELF, encoding);
             if (!STRING_IS_NULL(encoding) &&
-                    Parrot_str_not_equal(INTERP, encoding,
-                        Parrot_str_new_constant(INTERP, "utf8")) == 0)
+                    Parrot_str_equal(INTERP, encoding,
+                        Parrot_str_new_constant(INTERP, "utf8")))
                 string_result = string_make(INTERP, "", 0, "unicode", 0);
             else
                 string_result = Parrot_str_new_constant(INTERP, "");
@@ -437,15 +437,15 @@
         GET_ATTR_flags(INTERP, SELF, flags);
 
         if (got_type) {
-            if (Parrot_str_not_equal(INTERP, new_type, nobuffer_string) == 0) {
+            if (Parrot_str_equal(INTERP, new_type, nobuffer_string)) {
                 flags &= ~ PIO_F_LINEBUF;
                 flags &= ~ PIO_F_BLKBUF;
             }
-            else if (Parrot_str_not_equal(INTERP, new_type, linebuffer_string) == 0) {
+            else if (Parrot_str_equal(INTERP, new_type, linebuffer_string)) {
                 flags |=   PIO_F_LINEBUF;
                 flags &= ~ PIO_F_BLKBUF;
             }
-            else if (Parrot_str_not_equal(INTERP, new_type, fullbuffer_string) == 0) {
+            else if (Parrot_str_equal(INTERP, new_type, fullbuffer_string)) {
                 flags &= ~ PIO_F_LINEBUF;
                 flags |=   PIO_F_BLKBUF;
             }

Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/pmc/sub.pmc	Tue Mar  3 18:23:12 2009	(r37099)
@@ -784,22 +784,22 @@
         }
 
         /* Return the argument information that was requested. */
-        if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "pos_required")) == 0) {
+        if (Parrot_str_equal(interp, what, CONST_STRING(interp, "pos_required"))) {
             count_found = (INTVAL)sub->arg_info->pos_required;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "pos_optional")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "pos_optional"))) {
             count_found = (INTVAL)sub->arg_info->pos_optional;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "pos_slurpy")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "pos_slurpy"))) {
             count_found = (INTVAL)sub->arg_info->pos_slurpy;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "named_required")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "named_required"))) {
             count_found = (INTVAL)sub->arg_info->named_required;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "named_optional")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "named_optional"))) {
             count_found = (INTVAL)sub->arg_info->named_optional;
         }
-        else if (Parrot_str_not_equal(interp, what, CONST_STRING(interp, "named_slurpy")) == 0) {
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "named_slurpy"))) {
             count_found = (INTVAL)sub->arg_info->named_slurpy;
         }
         else {

Modified: trunk/src/scheduler.c
==============================================================================
--- trunk/src/scheduler.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/scheduler.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -130,13 +130,13 @@
         PMC *type_pmc = VTABLE_get_attr_str(interp, task, CONST_STRING(interp, "type"));
         STRING *type = VTABLE_get_string(interp, type_pmc);
 
-        if (Parrot_str_not_equal(interp, type, CONST_STRING(interp, "callback")) == 0) {
+        if (Parrot_str_equal(interp, type, CONST_STRING(interp, "callback"))) {
             Parrot_cx_invoke_callback(interp, task);
         }
-        else if (Parrot_str_not_equal(interp, type, CONST_STRING(interp, "timer")) == 0) {
+        else if (Parrot_str_equal(interp, type, CONST_STRING(interp, "timer"))) {
             Parrot_cx_timer_invoke(interp, task);
         }
-        else if (Parrot_str_not_equal(interp, type, CONST_STRING(interp, "event")) == 0) {
+        else if (Parrot_str_equal(interp, type, CONST_STRING(interp, "event"))) {
             PMC * const handler = Parrot_cx_find_handler_for_task(interp, task);
             if (!PMC_IS_NULL(handler)) {
                 PMC * handler_sub = VTABLE_get_attr_str(interp, handler, CONST_STRING(interp, "code"));
@@ -445,8 +445,8 @@
         for (index = 0; index < num_tasks; index++) {
             PMC *message = VTABLE_get_pmc_keyed_int(interp, sched_struct->messages, index);
             if (!PMC_IS_NULL(message)
-            &&   Parrot_str_not_equal(interp, VTABLE_get_string(interp, message),
-                        suspend_str) == 0) {
+            &&   Parrot_str_equal(interp, VTABLE_get_string(interp, message),
+                        suspend_str)) {
                 VTABLE_delete_keyed_int(interp, sched_struct->messages, index);
                 UNLOCK(sched_struct->msg_lock);
                 return message;
@@ -521,9 +521,9 @@
         typedef enum { Hunknown,  Hexception, Hevent } Htype;
 
         const Htype htype =
-            (Parrot_str_not_equal(interp, handler_type, exception_str) == 0) ?
+            Parrot_str_equal(interp, handler_type, exception_str) ?
             Hexception :
-            (Parrot_str_not_equal(interp, handler_type, event_str) == 0) ?
+            Parrot_str_equal(interp, handler_type, event_str) ?
                 Hevent :
                 Hunknown;
         STRING * const handler_name = (htype == Hexception) ?
@@ -594,9 +594,9 @@
         typedef enum { Hunknown,  Hexception, Hevent } Htype;
 
         const Htype htype =
-            (Parrot_str_not_equal(interp, handler_type, exception_str) == 0) ?
+            (Parrot_str_equal(interp, handler_type, exception_str)) ?
             Hexception :
-            (Parrot_str_not_equal(interp, handler_type, event_str) == 0) ?
+            (Parrot_str_equal(interp, handler_type, event_str)) ?
                 Hevent :
                 Hunknown;
         STRING * const handler_name = (htype == Hexception) ?
@@ -1119,8 +1119,8 @@
 #endif
         UNLOCK(sched_struct->msg_lock);
         if (!PMC_IS_NULL(message)
-         && Parrot_str_not_equal(interp, VTABLE_get_string(interp, message),
-                suspend_str) == 0) {
+         && Parrot_str_equal(interp, VTABLE_get_string(interp, message),
+                suspend_str)) {
 #if CX_DEBUG
     fprintf(stderr, "found a suspend, suspending [interp=%p]\n", interp);
 #endif

Modified: trunk/src/string/charset.c
==============================================================================
--- trunk/src/string/charset.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/string/charset.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -210,7 +210,7 @@
     const int n = all_charsets->n_charsets;
 
     for (i = 0; i < n; ++i) {
-        if (!Parrot_str_not_equal(interp, all_charsets->set[i].name, charsetname))
+        if (Parrot_str_equal(interp, all_charsets->set[i].name, charsetname))
             return i;
     }
     return -1;

Modified: trunk/src/string/encoding.c
==============================================================================
--- trunk/src/string/encoding.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/string/encoding.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -179,8 +179,7 @@
     int i;
 
     for (i = 0; i < n; ++i) {
-        if (!Parrot_str_not_equal(interp, all_encodings->enc[i].name,
-                          encodingname))
+        if (Parrot_str_equal(interp, all_encodings->enc[i].name, encodingname))
             return i;
     }
     return -1;

Modified: trunk/src/sub.c
==============================================================================
--- trunk/src/sub.c	Tue Mar  3 18:11:46 2009	(r37098)
+++ trunk/src/sub.c	Tue Mar  3 18:23:12 2009	(r37099)
@@ -599,7 +599,7 @@
             if (!PMC_IS_NULL(child_sub->outer_sub))
 
                 PMC_get_sub(interp, child_sub->outer_sub, child_outer_sub);
-                if (0 == Parrot_str_not_equal(interp, current_sub->subid,
+                if (Parrot_str_equal(interp, current_sub->subid,
                                       child_outer_sub->subid)) {
                 old = child_sub->outer_ctx;
                 child_sub->outer_ctx = Parrot_context_ref(interp, ctx);
@@ -618,7 +618,7 @@
 #if 0
     /* verify that the current sub is sub_pmc's :outer */
     PMC_get_sub(interp, sub->outer_sub, outer_sub);
-    if (0 != Parrot_str_not_equal(interp, current_sub->subid,
+    if (Parrot_str_not_equal(interp, current_sub->subid,
                          outer_sub->subid)) {
         Parrot_ex_throw_from_c_args(interp, NULL,
             EXCEPTION_INVALID_OPERATION, "'%Ss' isn't the :outer of '%Ss'",


More information about the parrot-commits mailing list