[svn:parrot] r46318 - in trunk: config/gen/makefiles src

bacek at svn.parrot.org bacek at svn.parrot.org
Wed May 5 21:47:09 UTC 2010


Author: bacek
Date: Wed May  5 21:47:08 2010
New Revision: 46318
URL: https://trac.parrot.org/parrot/changeset/46318

Log:
Use CONST_STRING in src/embed.c

Modified:
   trunk/config/gen/makefiles/root.in
   trunk/src/embed.c

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Wed May  5 21:15:50 2010	(r46317)
+++ trunk/config/gen/makefiles/root.in	Wed May  5 21:47:08 2010	(r46318)
@@ -664,6 +664,7 @@
     src/spf_vtable.str \
     src/string/api.str \
     src/sub.str \
+    src/embed.str \
     \
     $(CLASS_STR_FILES)
 

Modified: trunk/src/embed.c
==============================================================================
--- trunk/src/embed.c	Wed May  5 21:15:50 2010	(r46317)
+++ trunk/src/embed.c	Wed May  5 21:47:08 2010	(r46318)
@@ -27,6 +27,8 @@
 
 #include "../compilers/imcc/imc.h"
 
+#include "embed.str"
+
 /* HEADERIZER HFILE: none */ /* The visible types are different than what we use in here */
 
 /* HEADERIZER BEGIN: static */
@@ -1093,18 +1095,17 @@
 
     if (!interp->initial_pf) {
         /* SIDE EFFECT: PackFile_new_dummy sets interp->initial_pf */
-        interp->initial_pf = PackFile_new_dummy(interp,
-            Parrot_str_new_constant(interp, "compile_string"));
+        interp->initial_pf = PackFile_new_dummy(interp, CONST_STRING(interp, "compile_string"));
         /* Assumption: there is no valid reason to fail to create it.
          * If the assumption changes, replace the assertion with a
          * runtime check */
         PARROT_ASSERT(interp->initial_pf);
     }
 
-    if (Parrot_str_compare(interp, Parrot_str_new(interp, "PIR", 3), type) == 0)
+    if (Parrot_str_compare(interp, CONST_STRING(interp, "PIR"), type) == 0)
         return IMCC_compile_pir_s(interp, code, error);
 
-    if (Parrot_str_compare(interp, Parrot_str_new(interp, "PASM", 4), type) == 0)
+    if (Parrot_str_compare(interp, CONST_STRING(interp, "PASM"), type) == 0)
         return IMCC_compile_pasm_s(interp, code, error);
 
     *error = Parrot_str_new(interp, "Invalid interpreter type", 0);


More information about the parrot-commits mailing list