cvsuser 03/10/24 22:28:21
Modified: include/parrot interpreter.h io.h
io io.c io_unix.c
Log:
Remove that stupid macro and change interpreter->pioddata from void * to
ParrotIOData *.
No more casting required. :)
Don't know why I ever made it a void *, I think we were trying to keep
interpreter.h namespace pollution down.
Revision Changes Path
1.98 +2 -2 parrot/include/parrot/interpreter.h
Index: interpreter.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/interpreter.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -w -r1.97 -r1.98
--- interpreter.h 23 Oct 2003 10:21:12 -0000 1.97
+++ interpreter.h 25 Oct 2003 05:28:18 -0000 1.98
@@ -1,7 +1,7 @@
/* interpreter.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: interpreter.h,v 1.97 2003/10/23 10:21:12 leo Exp $
+ * $Id: interpreter.h,v 1.98 2003/10/25 05:28:18 mrjoltcola Exp $
* Overview:
* The interpreter api handles running the operations
* Data Structure and Algorithms:
@@ -135,7 +135,7 @@
struct Arenas *arena_base; /* Pointer to this interpreter's
* arena */
PMC *class_hash; /* Hash of classes */
- void *piodata; /* interpreter's IO system */
+ struct _ParrotIOData *piodata; /* interpreter's IO system */
op_lib_t *op_lib; /* Opcode library */
size_t op_count; /* The number of ops */
1.48 +1 -2 parrot/include/parrot/io.h
Index: io.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/io.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -w -r1.47 -r1.48
--- io.h 13 Oct 2003 15:54:48 -0000 1.47
+++ io.h 25 Oct 2003 05:28:18 -0000 1.48
@@ -1,7 +1,7 @@
/* io.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: io.h,v 1.47 2003/10/13 15:54:48 boemmels Exp $
+ * $Id: io.h,v 1.48 2003/10/25 05:28:18 mrjoltcola Exp $
* Overview:
* Parrot IO subsystem
* Data Structure and Algorithms:
@@ -121,7 +121,6 @@
#define PIO_DOWNLAYER(x) x->down
#define PIO_UPLAYER(x) x->up
#define GET_INTERP_IO(i) (((ParrotIOData*)i->piodata)->default_stack)
-#define GET_INTERP_IOD(i) ((ParrotIOData *)i->piodata)
/*
* Terminal layer can't be pushed on top of other layers;
1.65 +7 -7 parrot/io/io.c
Index: io.c
===================================================================
RCS file: /cvs/public/parrot/io/io.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -w -r1.64 -r1.65
--- io.c 13 Oct 2003 15:54:53 -0000 1.64
+++ io.c 25 Oct 2003 05:28:20 -0000 1.65
@@ -1,7 +1,7 @@
/* io.c
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: io.c,v 1.64 2003/10/13 15:54:53 boemmels Exp $
+ * $Id: io.c,v 1.65 2003/10/25 05:28:20 mrjoltcola Exp $
* Overview:
* This is the Parrot IO subsystem API. Generic IO stuff
* goes here, each specific layer goes in its own file...
@@ -141,9 +141,9 @@
interpreter->piodata = mem_sys_allocate(sizeof(ParrotIOData));
if (interpreter->piodata == NULL)
internal_exception(PIO_ERROR, "PIO alloc piodata failure.");
- GET_INTERP_IOD(interpreter)->default_stack = NULL;
- GET_INTERP_IOD(interpreter)->table = alloc_pio_array(PIO_NR_OPEN);
- if (GET_INTERP_IOD(interpreter)->table == NULL)
+ interpreter->piodata->default_stack = NULL;
+ interpreter->piodata->table = alloc_pio_array(PIO_NR_OPEN);
+ if (interpreter->piodata->table == NULL)
internal_exception(PIO_ERROR, "PIO alloc table failure.");
}
@@ -166,19 +166,19 @@
/* TODO: close std descriptors */
for (i = 0 ; i < PIO_NR_OPEN; i++) {
- if ( (io = GET_INTERP_IOD(interpreter)->table[i]) ) {
+ if ( (io = ((ParrotIOData *)interpreter->piodata)->table[i]) ) {
PIO_close(interpreter, new_io_pmc(interpreter, io));
}
}
#endif
- for (p = GET_INTERP_IO(interpreter); p; ) {
+ for (p = ((ParrotIOData *)interpreter->piodata)->default_stack; p; ) {
down = p->down;
if (p->api->Delete)
(*p->api->Delete) (p);
/* mem_sys_free(p); */ /* XXX ??? */
p = down;
}
- mem_sys_free(GET_INTERP_IOD(interpreter)->table);
+ mem_sys_free(((ParrotIOData *)interpreter->piodata)->table);
mem_sys_free(interpreter->piodata);
}
1.39 +2 -2 parrot/io/io_unix.c
Index: io_unix.c
===================================================================
RCS file: /cvs/public/parrot/io/io_unix.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -w -r1.38 -r1.39
--- io_unix.c 17 Oct 2003 04:02:21 -0000 1.38
+++ io_unix.c 25 Oct 2003 05:28:20 -0000 1.39
@@ -1,7 +1,7 @@
/* io_unix.c
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: io_unix.c,v 1.38 2003/10/17 04:02:21 mrjoltcola Exp $
+ * $Id: io_unix.c,v 1.39 2003/10/25 05:28:20 mrjoltcola Exp $
* Overview:
* This is the Parrot IO UNIX layer. May be changed to
* include other platforms if that platform is similar
@@ -87,7 +87,7 @@
static INTVAL
PIO_unix_init(theINTERP, ParrotIOLayer *layer)
{
- ParrotIOData *d = GET_INTERP_IOD(interpreter);
+ ParrotIOData *d = interpreter->piodata;
if (d != NULL && d->table != NULL) {
ParrotIO *io;