[svn:parrot] r41222 - in trunk/src: dynpmc pmc

darbelo at svn.parrot.org darbelo at svn.parrot.org
Sat Sep 12 00:28:59 UTC 2009


Author: darbelo
Date: Sat Sep 12 00:28:58 2009
New Revision: 41222
URL: https://trac.parrot.org/parrot/changeset/41222

Log:
Remove a few more strstart uses. GeJ++ for testing the gdbm side of this.

Modified:
   trunk/src/dynpmc/gdbmhash.pmc
   trunk/src/pmc/unmanagedstruct.pmc

Modified: trunk/src/dynpmc/gdbmhash.pmc
==============================================================================
--- trunk/src/dynpmc/gdbmhash.pmc	Fri Sep 11 21:54:06 2009	(r41221)
+++ trunk/src/dynpmc/gdbmhash.pmc	Sat Sep 12 00:28:58 2009	(r41222)
@@ -349,15 +349,19 @@
         STRING* keystr;
         GDBM_FILE dbf = PMC_dbfh(SELF);
         datum key_gdbm;
+        INTVAL ret;
 
         if (!key) return 0;
         if (!dbf) return 0;
         keystr = make_hash_key(interp, key);
 
-        key_gdbm.dsize = keystr->strlen;
-        key_gdbm.dptr  = keystr->strstart;
+        key_gdbm.dptr  = Parrot_str_to_cstring(interp, keystr);
+        key_gdbm.dsize = strlen(key_gdbm.dptr);
+
+        ret = gdbm_exists(dbf, key_gdbm);
+        Parrot_str_free_cstring(key_gdbm.dptr);
 
-        return gdbm_exists(dbf, key_gdbm);
+        return ret;
     }
 
 /*

Modified: trunk/src/pmc/unmanagedstruct.pmc
==============================================================================
--- trunk/src/pmc/unmanagedstruct.pmc	Fri Sep 11 21:54:06 2009	(r41221)
+++ trunk/src/pmc/unmanagedstruct.pmc	Sat Sep 12 00:28:58 2009	(r41222)
@@ -502,7 +502,7 @@
     if (type == enum_type_cstr) {
         /* assuming 0-terminated C-string here;
          * we can't use Parrot_str_to_cstring easily */
-        char *cstr  = value->strstart;
+        char *cstr  = Buffer_bufstart(value);
         *(char **)p = cstr;
     }
     else


More information about the parrot-commits mailing list