[svn:parrot] r48366 - in branches/unshared_buffers/src: gc pmc string
darbelo at svn.parrot.org
darbelo at svn.parrot.org
Mon Aug 9 21:07:30 UTC 2010
Author: darbelo
Date: Mon Aug 9 21:07:30 2010
New Revision: 48366
URL: https://trac.parrot.org/parrot/changeset/48366
Log:
Minor typo fixes. Also, add some casts here and there.
Modified:
branches/unshared_buffers/src/gc/alloc_resources.c
branches/unshared_buffers/src/pmc/filehandle.pmc
branches/unshared_buffers/src/string/api.c
Modified: branches/unshared_buffers/src/gc/alloc_resources.c
==============================================================================
--- branches/unshared_buffers/src/gc/alloc_resources.c Mon Aug 9 21:07:11 2010 (r48365)
+++ branches/unshared_buffers/src/gc/alloc_resources.c Mon Aug 9 21:07:30 2010 (r48366)
@@ -612,7 +612,6 @@
if (PObj_is_COWable_TEST(old_buf)) {
flags = Buffer_bufrefcountptr(old_buf);
old_block = Buffer_pool(old_buf);
- }
}
/* buffer has already been moved; just change the header */
Modified: branches/unshared_buffers/src/pmc/filehandle.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/filehandle.pmc Mon Aug 9 21:07:11 2010 (r48365)
+++ branches/unshared_buffers/src/pmc/filehandle.pmc Mon Aug 9 21:07:30 2010 (r48366)
@@ -373,7 +373,7 @@
#ifdef PARROT_HAS_READLINE
/* 4-column indent to get c_indent.t to DTRT */
- char * const r = readline(got_prompt ? Buffer_bufstart(prompt) : NULL);
+ char * const r = readline(got_prompt ? (char*)Buffer_bufstart(prompt) : NULL);
if (r) {
if (*r)
@@ -384,7 +384,7 @@
}
#else
if (got_prompt)
- fprintf(stderr, "%s", Buffer_bufstart(prompt));
+ fprintf(stderr, "%s", (char *)Buffer_bufstart(prompt));
if (!(PARROT_FILEHANDLE(SELF)->flags & PIO_F_LINEBUF))
Parrot_io_setlinebuf(INTERP, SELF);
@@ -398,7 +398,7 @@
else {
while (len > 0
&& (((char *)Buffer_bufstart(string_result))[len - 1] == '\n'
- || ((char *)Buffer_bufstart(string_result)[len - 1] == '\r')) {
+ || ((char *)Buffer_bufstart(string_result))[len - 1] == '\r')) {
--len;
--string_result->strlen;
--string_result->bufused;
Modified: branches/unshared_buffers/src/string/api.c
==============================================================================
--- branches/unshared_buffers/src/string/api.c Mon Aug 9 21:07:11 2010 (r48365)
+++ branches/unshared_buffers/src/string/api.c Mon Aug 9 21:07:30 2010 (r48366)
@@ -1019,8 +1019,8 @@
/* copy s into dest num times */
UINTVAL length = s->bufused;
UINTVAL i;
- char * destpos = Buffer_bufstart(dest);
- const char * const srcpos = Buffer_bufstart(s);
+ char * destpos = (char *)Buffer_bufstart(dest);
+ const char * const srcpos = (char *)Buffer_bufstart(s);
for (i = 0; i < num; ++i) {
mem_sys_memcopy(destpos, srcpos, length);
destpos += length;
@@ -2891,7 +2891,7 @@
{
ASSERT_ARGS(Parrot_str_cstring)
/* TODO handle NULL and friends */
- return Buffer_bufstart(str);
+ return (char *)Buffer_bufstart(str);
}
@@ -3170,7 +3170,7 @@
res->encoding = j->encoding;
/* Iterate over chunks and append it to res */
- pos = Buffer_bufstart(res);
+ pos = (char *) Buffer_bufstart(res);
/* Copy first chunk */
s = chunks[0];
@@ -3192,10 +3192,10 @@
pos += next->bufused;
/* We can consume all buffer and pos will be next-after-end of buffer */
- PARROT_ASSERT(pos <= Buffer_bufstart(res) + Buffer_buflen(res) + 1);
+ PARROT_ASSERT(pos <= (char *)Buffer_bufstart(res) + Buffer_buflen(res) + 1);
}
- res->bufused = pos - Buffer_bufstart(res);
+ res->bufused = pos - (char *)Buffer_bufstart(res);
res->strlen = CHARSET_CODEPOINTS(interp, res);
Parrot_gc_free_fixed_size_storage(interp, ar_len * sizeof (STRING *),
More information about the parrot-commits
mailing list