[svn:parrot] r46043 - in trunk/src: dynpmc io

darbelo at svn.parrot.org darbelo at svn.parrot.org
Mon Apr 26 20:46:15 UTC 2010


Author: darbelo
Date: Mon Apr 26 20:46:14 2010
New Revision: 46043
URL: https://trac.parrot.org/parrot/changeset/46043

Log:
[io] Replace another fake string with a real one. Let's pretend we have at least heard of subsystem encapsulation.

Modified:
   trunk/src/dynpmc/gziphandle.pmc
   trunk/src/io/buffer.c

Modified: trunk/src/dynpmc/gziphandle.pmc
==============================================================================
--- trunk/src/dynpmc/gziphandle.pmc	Mon Apr 26 20:40:44 2010	(r46042)
+++ trunk/src/dynpmc/gziphandle.pmc	Mon Apr 26 20:46:14 2010	(r46043)
@@ -23,6 +23,7 @@
 #include <zlib.h>
 #include "parrot/extend.h"
 
+#define CHAR char
 /* HEADERIZER HFILE: none */
 /* HEADERIZER BEGIN: static */
 /* HEADERIZER END: static */

Modified: trunk/src/io/buffer.c
==============================================================================
--- trunk/src/io/buffer.c	Mon Apr 26 20:40:44 2010	(r46042)
+++ trunk/src/io/buffer.c	Mon Apr 26 20:46:14 2010	(r46043)
@@ -337,11 +337,9 @@
         size_t got;
 
         if (len >= Parrot_io_get_buffer_size(interp, filehandle)) {
-            STRING     fake;
-            STRING    *sf = &fake;
-
-            Buffer_bufstart(sf) = (char *)out_buf;
-            fake.bufused        = len;
+            STRING *sf = Parrot_str_new_init(interp, out_buf, len,
+                PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
+                PObj_external_FLAG);
             got                 = PIO_READ(interp, filehandle, &sf);
             s->strlen           = s->bufused = current + got;
 


More information about the parrot-commits mailing list