cvsuser 04/05/25 01:34:24
Modified: . PLATFORMS
classes perlstring.pmc
config/gen/platform/darwin dl.c
imcc imcc.l parser_util.c
include/parrot parrot.h
io io.c
src string.c
Log:
io_layers 7 - cleanup; move const_cast to parrot.h
Revision Changes Path
1.23 +1 -1 parrot/PLATFORMS
Index: PLATFORMS
===================================================================
RCS file: /cvs/public/parrot/PLATFORMS,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -r1.22 -r1.23
--- PLATFORMS 8 May 2004 08:27:49 -0000 1.22
+++ PLATFORMS 25 May 2004 08:34:06 -0000 1.23
@@ -33,7 +33,7 @@
win32-cygwin Y Y Y Y
win32-icl_8.0.48 - Y - - - Y Y/2
win32-mingw
-win32-ms-cl_13.00.9466 - Y/2 - - - Y Y/2
+win32-ms-cl_13.10.3077 - Y - - - Y Y
- ... no
Y ... yes
1.71 +1 -2 parrot/classes/perlstring.pmc
Index: perlstring.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlstring.pmc,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -w -r1.70 -r1.71
--- perlstring.pmc 18 May 2004 13:02:54 -0000 1.70
+++ perlstring.pmc 25 May 2004 08:34:10 -0000 1.71
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: perlstring.pmc,v 1.70 2004/05/18 13:02:54 leo Exp $
+$Id: perlstring.pmc,v 1.71 2004/05/25 08:34:10 leo Exp $
=head1 NAME
@@ -21,7 +21,6 @@
#include "parrot/parrot.h"
#include "parrot/perltypes.h"
-#define const_cast(b) (__ptr_u.__c_ptr = (b), __ptr_u.__ptr)
pmclass PerlString extends perlscalar {
1.3 +3 -1 parrot/config/gen/platform/darwin/dl.c
Index: dl.c
===================================================================
RCS file: /cvs/public/parrot/config/gen/platform/darwin/dl.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- dl.c 11 Apr 2004 10:41:17 -0000 1.2
+++ dl.c 25 May 2004 08:34:13 -0000 1.3
@@ -42,7 +42,9 @@
const void * __c_ptr;
void * __ptr;
} __ptr_u;
+#ifndef const_cast
#define const_cast(b) (__ptr_u.__c_ptr = (b), __ptr_u.__ptr)
+#endif
return const_cast(header);
}
1.102 +7 -8 parrot/imcc/imcc.l
Index: imcc.l
===================================================================
RCS file: /cvs/public/parrot/imcc/imcc.l,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -w -r1.101 -r1.102
--- imcc.l 21 May 2004 14:29:11 -0000 1.101
+++ imcc.l 25 May 2004 08:34:15 -0000 1.102
@@ -731,7 +731,6 @@
const void * __c_ptr;
void * __ptr;
} __ptr_u;
-#define const_cast(b) (__ptr_u.__c_ptr = (b), __ptr_u.__ptr)
UNUSED(valp);
frame = new_frame();
1.67 +0 -1 parrot/imcc/parser_util.c
Index: parser_util.c
===================================================================
RCS file: /cvs/public/parrot/imcc/parser_util.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -w -r1.66 -r1.67
--- parser_util.c 23 Apr 2004 09:20:31 -0000 1.66
+++ parser_util.c 25 May 2004 08:34:15 -0000 1.67
@@ -515,7 +515,6 @@
const void * __c_ptr;
void * __ptr;
} __ptr_u;
-#define const_cast(b) (__ptr_u.__c_ptr = (b), __ptr_u.__ptr)
if (!(new = fopen(s, "r"))) {
fatal(1, "imcc_compile_file", "couldn't open '%s'\n", s);
1.94 +10 -1 parrot/include/parrot/parrot.h
Index: parrot.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/parrot.h,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -w -r1.93 -r1.94
--- parrot.h 20 May 2004 08:37:23 -0000 1.93
+++ parrot.h 25 May 2004 08:34:18 -0000 1.94
@@ -1,7 +1,7 @@
/* parrot.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: parrot.h,v 1.93 2004/05/20 08:37:23 leo Exp $
+ * $Id: parrot.h,v 1.94 2004/05/25 08:34:18 leo Exp $
* Overview:
* General header file includes for the parrot interpreter
* Data Structure and Algorithms:
@@ -178,6 +178,15 @@
#define LVALUE_CAST(type, val) (*((type *)&(val)))
#endif /* __GCC__ */
+
+/* work around warning:
+ * cast discards qualifiers from pointer target type
+ * for usage grep e.g. in string.c
+ */
+
+#define const_cast(b) (__ptr_u.__c_ptr = (b), __ptr_u.__ptr)
+
+
/* define some shortcuts for dealing with function pointers */
/* according to ANSI C, casting between function and non-function pointers is
* no good. So we should use "funcptr_t" in place of void* when dealing with
1.91 +7 -22 parrot/io/io.c
Index: io.c
===================================================================
RCS file: /cvs/public/parrot/io/io.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -w -r1.90 -r1.91
--- io.c 24 May 2004 13:46:44 -0000 1.90
+++ io.c 25 May 2004 08:34:21 -0000 1.91
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: io.c,v 1.90 2004/05/24 13:46:44 leo Exp $
+$Id: io.c,v 1.91 2004/05/25 08:34:21 leo Exp $
=head1 NAME
@@ -766,12 +766,17 @@
ParrotIOLayer *l = PMC_struct_val(pmc);
ParrotIO *io = PMC_data(pmc);
STRING fake;
+ union {
+ const void * __c_ptr;
+ void * __ptr;
+ } __ptr_u;
+
if(!io)
return -1;
if (io->flags & PIO_F_WRITE) {
/* TODO skip utf8 translation layers if any */
- fake.strstart = buffer;
+ fake.strstart = const_cast(buffer);
fake.bufused = len;
return PIO_write_down(interpreter, l, io, &fake);
}
@@ -886,29 +891,9 @@
INTVAL
PIO_putps(theINTERP, PMC *pmc, STRING *s)
{
-#if 1
ParrotIOLayer *l = PMC_struct_val(pmc);
ParrotIO *io = PMC_data(pmc);
return PIO_write_down(interpreter, l, io, s);
-#else
- UINTVAL length = string_length(interpreter, s);
- char *buffer = malloc(4*length);
- char *cursor = buffer;
- UINTVAL idx = 0;
- INTVAL temp = 0;
-
- /* temporary--write out in UTF-8 */
- for( idx = 0; idx < length; ++idx )
- {
- cursor = Parrot_utf8_encode(cursor, string_index(interpreter, s, idx));
- }
-
- temp = PIO_write(interpreter, pmc, buffer, cursor - buffer);
-
- free(buffer);
-
- return temp;
-#endif
}
/*
1.202 +1 -8 parrot/src/string.c
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/src/string.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -w -r1.201 -r1.202
--- string.c 23 Apr 2004 09:21:12 -0000 1.201
+++ string.c 25 May 2004 08:34:24 -0000 1.202
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: string.c,v 1.201 2004/04/23 09:21:12 jrieks Exp $
+$Id: string.c,v 1.202 2004/05/25 08:34:24 leo Exp $
=head1 NAME
@@ -41,13 +41,6 @@
#define EXTRA_SIZE 256
-/* work around warning:
- * cast discards qualifiers from pointer target type
- * s. usage below
- */
-
-#define const_cast(b) (__ptr_u.__c_ptr = (b), __ptr_u.__ptr)
-
/* statics */
static void _string_upscale(Interp *interpreter, STRING *s,
parrot_string_representation_t representation, UINTVAL capacity);