Author: chromatic
Date: Fri Apr 27 13:09:28 2007
New Revision: 18347
Modified:
trunk/compilers/imcc/symreg.h
trunk/compilers/imcc/unit.h
trunk/include/parrot/charset.h
trunk/include/parrot/embed.h
trunk/include/parrot/exceptions.h
trunk/include/parrot/interpreter.h
trunk/include/parrot/misc.h
trunk/include/parrot/packfile.h
trunk/include/parrot/pmc_freeze.h
trunk/include/parrot/thread.h
trunk/src/charset/ascii.c
trunk/src/charset/binary.c
trunk/src/charset/iso-8859-1.c
trunk/src/charset/tables.c
trunk/src/charset/tables.h
trunk/src/charset/unicode.c
trunk/src/embed.c
trunk/src/events.c
trunk/src/gc/smallobject.c
trunk/src/inter_create.c
trunk/src/jit.c
trunk/src/jit.h
trunk/src/mmd.c
trunk/src/objects.c
trunk/src/packfile.c
trunk/src/pmc/class.pmc
trunk/src/pmc/parrotinterpreter.pmc
trunk/src/pmc/role.pmc
trunk/src/sub.c
Log:
Enum cleanups (Steve Peters, RT #42768).
Modified: trunk/compilers/imcc/symreg.h
==============================================================================
--- trunk/compilers/imcc/symreg.h (original)
+++ trunk/compilers/imcc/symreg.h Fri Apr 27 13:09:28 2007
@@ -58,8 +58,8 @@
typedef struct _SymReg {
char * name;
- enum VARTYPE type; /* Variable type */
- enum USAGE usage; /* s. USAGE above */
+ INTVAL type; /* Variable type */
+ INTVAL usage; /* s. USAGE above */
int set; /* Which register set/file it belongs to */
int want_regno; /* wanted register number */
INTVAL color; /* Color: parrot register number
@@ -162,7 +162,7 @@
int nret;
SymReg ** multi;
int nmulti;
- pragma_enum_t pragma;
+ INTVAL pragma;
int calls_a_sub;
int flags; /* isNCI, isTAIL_CALL */
int label;
Modified: trunk/compilers/imcc/unit.h
==============================================================================
--- trunk/compilers/imcc/unit.h (original)
+++ trunk/compilers/imcc/unit.h Fri Apr 27 13:09:28 2007
@@ -28,7 +28,7 @@
} ;
typedef struct _IMC_Unit {
- IMC_Unit_Type type;
+ INTVAL type;
Instruction * instructions;
Instruction * last_ins;
SymHash hash;
Modified: trunk/include/parrot/charset.h
==============================================================================
--- trunk/include/parrot/charset.h (original)
+++ trunk/include/parrot/charset.h Fri Apr 27 13:09:28 2007
@@ -53,9 +53,9 @@
typedef INTVAL (*charset_index_t)(Interp *, STRING *source_string, STRING
*search_string, UINTVAL offset);
typedef INTVAL (*charset_rindex_t)(Interp *, STRING *source_string, STRING
*search_string, UINTVAL offset);
typedef UINTVAL (*charset_validate_t)(Interp *, STRING *source_string);
-typedef INTVAL (*charset_is_cclass_t)(Interp *, PARROT_CCLASS_FLAGS, STRING
*source_string, UINTVAL offset);
-typedef INTVAL (*charset_find_cclass_t)(Interp *, PARROT_CCLASS_FLAGS, STRING
*source_string, UINTVAL offset, UINTVAL count);
-typedef INTVAL (*charset_find_not_cclass_t)(Interp *, PARROT_CCLASS_FLAGS,
STRING *source_string, UINTVAL offset, UINTVAL count);
+typedef INTVAL (*charset_is_cclass_t)(Interp *, INTVAL, STRING *source_string,
UINTVAL offset);
+typedef INTVAL (*charset_find_cclass_t)(Interp *, INTVAL, STRING
*source_string, UINTVAL offset, UINTVAL count);
+typedef INTVAL (*charset_find_not_cclass_t)(Interp *, INTVAL, STRING
*source_string, UINTVAL offset, UINTVAL count);
typedef INTVAL (*charset_is_wordchar_t)(Interp *, STRING *source_string,
UINTVAL offset);
typedef INTVAL (*charset_find_wordchar_t)(Interp *, STRING *source_string,
UINTVAL offset);
typedef INTVAL (*charset_find_not_wordchar_t)(Interp *, STRING *source_string,
UINTVAL offset);
Modified: trunk/include/parrot/embed.h
==============================================================================
--- trunk/include/parrot/embed.h (original)
+++ trunk/include/parrot/embed.h Fri Apr 27 13:09:28 2007
@@ -28,9 +28,9 @@
PARROT_API void Parrot_init(Parrot_Interp);
PARROT_API void Parrot_init_stacktop(Parrot_Interp, void *);
-PARROT_API void Parrot_set_flag(Parrot_Interp, Parrot_Interp_flag);
-PARROT_API void Parrot_clear_flag(Parrot_Interp, Parrot_Interp_flag);
-PARROT_API Parrot_Int Parrot_test_flag(Parrot_Interp, Parrot_Interp_flag);
+PARROT_API void Parrot_set_flag(Parrot_Interp, Parrot_Int);
+PARROT_API void Parrot_clear_flag(Parrot_Interp, Parrot_Int);
+PARROT_API Parrot_Int Parrot_test_flag(Parrot_Interp, Parrot_Int);
PARROT_API void Parrot_set_trace(Parrot_Interp, Parrot_UInt);
PARROT_API void Parrot_clear_trace(Parrot_Interp, Parrot_UInt);
@@ -56,7 +56,7 @@
PARROT_API void Parrot_destroy(Parrot_Interp);
-PARROT_API Parrot_Opcode * Parrot_debug(Parrot_Interp, Parrot_Opcode* pc);
+PARROT_API Parrot_Opcode * Parrot_debug(Parrot_Interp, Parrot_Opcode *pc);
PARROT_API void Parrot_disassemble(Parrot_Interp);
Modified: trunk/include/parrot/exceptions.h
==============================================================================
--- trunk/include/parrot/exceptions.h (original)
+++ trunk/include/parrot/exceptions.h Fri Apr 27 13:09:28 2007
@@ -155,7 +155,7 @@
* one later, so we wrap it in a struct so that we can expand it later */
typedef struct parrot_exception_t {
Parrot_jump_buff destination; /* jmp_buf */
- exception_severity severity; /* s. above */
+ INTVAL severity; /* s. above */
long error; /* exception_type_enum */
STRING *msg; /* may be NULL */
void *resume; /* opcode_t* for resume or NULL */
Modified: trunk/include/parrot/interpreter.h
==============================================================================
--- trunk/include/parrot/interpreter.h (original)
+++ trunk/include/parrot/interpreter.h Fri Apr 27 13:09:28 2007
@@ -320,7 +320,7 @@
UINTVAL debug_flags; /* debug settings */
- Run_Cores run_core; /* type of core to run the ops */
+ INTVAL run_core; /* type of core to run the ops */
/* TODO profile per code segment or global */
RunProfile *profile; /* The structure and array where
we keep the
@@ -459,7 +459,7 @@
/* &end_gen */
-PARROT_API Interp *make_interpreter(Interp * parent, Interp_flags);
+PARROT_API Interp *make_interpreter(Interp * parent, INTVAL);
PARROT_API void Parrot_init(Interp *);
PARROT_API void Parrot_destroy(Interp *);
@@ -528,7 +528,7 @@
PARROT_API void dynop_register(Interp *interp, PMC* op_lib);
void do_prederef(void **pc_prederef, Interp *interp, int type);
-void clone_interpreter(Parrot_Interp dest, Parrot_Interp self,
Parrot_clone_flags flags);
+void clone_interpreter(Parrot_Interp dest, Parrot_Interp self, INTVAL flags);
PARROT_API void enter_nci_method(Interp *, const int type,
void *func, const char *name, const char *proto);
Modified: trunk/include/parrot/misc.h
==============================================================================
--- trunk/include/parrot/misc.h (original)
+++ trunk/include/parrot/misc.h Fri Apr 27 13:09:28 2007
@@ -141,9 +141,9 @@
typedef struct spfinfo_t {
UINTVAL width;
UINTVAL prec;
- FLAG flags;
- TYPE type;
- PHASE phase;
+ INTVAL flags;
+ INTVAL type;
+ INTVAL phase;
} *SpfInfo;
/* SPRINTF ARGUMENT OBJECT */
Modified: trunk/include/parrot/packfile.h
==============================================================================
--- trunk/include/parrot/packfile.h (original)
+++ trunk/include/parrot/packfile.h Fri Apr 27 13:09:28 2007
@@ -319,10 +319,10 @@
/* create new fixup entry */
PARROT_API void PackFile_FixupTable_new_entry(Interp *, char *label,
- enum_fixup_t, opcode_t offs);
+ INTVAL, opcode_t offs);
/* find entry */
PARROT_API PackFile_FixupEntry * PackFile_find_fixup_entry(Interp *,
- enum_fixup_t type, char *);
+ INTVAL type, char *);
/*
** PackFile_ByteCode Functions:
Modified: trunk/include/parrot/pmc_freeze.h
==============================================================================
--- trunk/include/parrot/pmc_freeze.h (original)
+++ trunk/include/parrot/pmc_freeze.h Fri Apr 27 13:09:28 2007
@@ -65,7 +65,7 @@
visit_f visit_pmc_now;
visit_f visit_pmc_later;
visit_f visit_action; /* freeze, thaw ... */
- visit_enum_type what;
+ INTVAL what;
STRING* image;
PMC* mark_ptr;
PMC** thaw_ptr; /* where to thaw aa new PMC */
@@ -76,7 +76,7 @@
PMC* id_list; /* seen list used by thaw */
UINTVAL id; /* freze ID of PMC */
void* extra; /* PMC specific */
- extra_flags_enum extra_flags; /* concerning to extra */
+ INTVAL extra_flags; /* concerning to extra */
PMC* thaw_result; /* 1st thawed */
IMAGE_IO *image_io;
} visit_info;
Modified: trunk/include/parrot/thread.h
==============================================================================
--- trunk/include/parrot/thread.h (original)
+++ trunk/include/parrot/thread.h Fri Apr 27 13:09:28 2007
@@ -86,7 +86,7 @@
*/
typedef struct _Thread_data {
Parrot_thread thread; /* pthread_t or such */
- thread_state_enum state;
+ INTVAL state;
int wants_shared_gc; /* therad is trying to
do a shared GC run */
UINTVAL tid; /* 0.. n-1 idx in interp array */
Modified: trunk/src/charset/ascii.c
==============================================================================
--- trunk/src/charset/ascii.c (original)
+++ trunk/src/charset/ascii.c Fri Apr 27 13:09:28 2007
@@ -355,8 +355,7 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset)
+is_cclass(Interp *interp, INTVAL flags, STRING *source_string, UINTVAL offset)
{
UINTVAL codepoint;
@@ -372,8 +371,8 @@
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset, UINTVAL count)
+find_cclass(Interp *interp, INTVAL flags, STRING *source_string,
+ UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
UINTVAL end = offset + count;
@@ -391,8 +390,8 @@
}
static INTVAL
-find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset, UINTVAL count)
+find_not_cclass(Interp *interp, INTVAL flags, STRING *source_string,
+ UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
UINTVAL end = offset + count;
Modified: trunk/src/charset/binary.c
==============================================================================
--- trunk/src/charset/binary.c (original)
+++ trunk/src/charset/binary.c Fri Apr 27 13:09:28 2007
@@ -125,21 +125,20 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset)
+is_cclass(Interp *interp, INTVAL flags, STRING *source_string, UINTVAL offset)
{
return 0;
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
return offset + count;
}
static INTVAL
-find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_not_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
return offset + count;
Modified: trunk/src/charset/iso-8859-1.c
==============================================================================
--- trunk/src/charset/iso-8859-1.c (original)
+++ trunk/src/charset/iso-8859-1.c Fri Apr 27 13:09:28 2007
@@ -262,7 +262,7 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+is_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset)
{
UINTVAL codepoint;
@@ -278,7 +278,7 @@
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
@@ -297,7 +297,7 @@
}
static INTVAL
-find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_not_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
Modified: trunk/src/charset/tables.c
==============================================================================
--- trunk/src/charset/tables.c (original)
+++ trunk/src/charset/tables.c Fri Apr 27 13:09:28 2007
@@ -14,7 +14,9 @@
*/
#include "tables.h"
-const PARROT_CCLASS_FLAGS Parrot_ascii_typetable[256] = {
+#include "parrot/parrot.h"
+
+const INTVAL Parrot_ascii_typetable[256] = {
0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, /* 0-7 */
0x0200, 0x0320, 0x1220, 0x0220, 0x1220, 0x1220, 0x0200, 0x0200, /* 8-15 */
0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, /* 16-23 */
@@ -48,7 +50,7 @@
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 240-247 */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 248-255 */
};
-const PARROT_CCLASS_FLAGS Parrot_iso_8859_1_typetable[256] = {
+const INTVAL Parrot_iso_8859_1_typetable[256] = {
0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, /* 0-7 */
0x0200, 0x0320, 0x1220, 0x0220, 0x1220, 0x1220, 0x0200, 0x0200, /* 8-15 */
0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, /* 16-23 */
Modified: trunk/src/charset/tables.h
==============================================================================
--- trunk/src/charset/tables.h (original)
+++ trunk/src/charset/tables.h Fri Apr 27 13:09:28 2007
@@ -16,12 +16,13 @@
#if !defined(PARROT_CHARSET_TABLES_H_GUARD)
#define PARROT_CHARSET_TABLES_H_GUARD
#include "parrot/cclass.h"
+#include "parrot/parrot.h"
#define WHITESPACE enum_cclass_whitespace
#define WORDCHAR enum_cclass_word
#define PUNCTUATION enum_cclass_punctuation
#define DIGIT enum_cclass_numeric
-extern const PARROT_CCLASS_FLAGS Parrot_ascii_typetable[256];
-extern const PARROT_CCLASS_FLAGS Parrot_iso_8859_1_typetable[256];
+extern const INTVAL Parrot_ascii_typetable[256];
+extern const INTVAL Parrot_iso_8859_1_typetable[256];
#endif /* PARROT_CHARSET_TABLES_H_GUARD */
/*
Modified: trunk/src/charset/unicode.c
==============================================================================
--- trunk/src/charset/unicode.c (original)
+++ trunk/src/charset/unicode.c Fri Apr 27 13:09:28 2007
@@ -362,7 +362,7 @@
}
static int
-u_iscclass(Interp *interp, UINTVAL codepoint, PARROT_CCLASS_FLAGS flags)
+u_iscclass(Interp *interp, UINTVAL codepoint, INTVAL flags)
{
#if PARROT_HAS_ICU
/* XXX which one
@@ -429,7 +429,7 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+is_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset)
{
UINTVAL codepoint;
@@ -444,7 +444,7 @@
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
@@ -469,7 +469,7 @@
}
static INTVAL
-find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_not_cclass(Interp *interp, INTVAL flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
Modified: trunk/src/embed.c
==============================================================================
--- trunk/src/embed.c (original)
+++ trunk/src/embed.c Fri Apr 27 13:09:28 2007
@@ -97,7 +97,7 @@
/*
-=item C<void Parrot_set_flag(Interp *interp, Parrot_Interp_flag flag)>
+=item C<void Parrot_set_flag(Interp *interp, INTVAL flag)>
Sets a flag in the interpreter specified by C<flag>, any of
C<PARROT_BOUNDS_FLAG>, or C<PARROT_PROFILE_FLAG> to enable profiling, and
@@ -119,7 +119,7 @@
*/
void
-Parrot_set_flag(Interp *interp, Parrot_Interp_flag flag)
+Parrot_set_flag(Interp *interp, INTVAL flag)
{
/* These two macros (from interpreter.h) do exactly what they look like. */
@@ -150,7 +150,7 @@
/*
-=item C<void Parrot_clear_flag(Interp *, Parrot_Interp_flag flag)>
+=item C<void Parrot_clear_flag(Interp *, INTVAL flag)>
=item C<void Parrot_clear_debug(Interp *, UINTVAL flag)>
@@ -163,7 +163,7 @@
*/
void
-Parrot_clear_flag(Parrot_Interp interp, Parrot_Interp_flag flag)
+Parrot_clear_flag(Parrot_Interp interp, INTVAL flag)
{
Interp_flags_CLEAR(interp, flag);
}
@@ -183,7 +183,7 @@
/*
=item C<Parrot_Int
-Parrot_test_flag(Interp*, Parrot_Interp_flag flag)>
+Parrot_test_flag(Interp*, INTVAL flag)>
=item C<UINTVAL
Parrot_test_debug(Interp*, UINTVAL flag)>
@@ -198,7 +198,7 @@
*/
Parrot_Int
-Parrot_test_flag(Interp* interp, Parrot_Interp_flag flag)
+Parrot_test_flag(Interp* interp, INTVAL flag)
{
return Interp_flags_TEST(interp, flag);
}
Modified: trunk/src/events.c
==============================================================================
--- trunk/src/events.c (original)
+++ trunk/src/events.c Fri Apr 27 13:09:28 2007
@@ -107,7 +107,7 @@
* a structure to communicate with the io_thread
*/
typedef struct io_thread_msg {
- io_thread_msg_type command;
+ INTVAL command;
parrot_event *ev;
} io_thread_msg;
Modified: trunk/src/gc/smallobject.c
==============================================================================
--- trunk/src/gc/smallobject.c (original)
+++ trunk/src/gc/smallobject.c Fri Apr 27 13:09:28 2007
@@ -301,7 +301,7 @@
size_t object_size, size_t objects_per_alloc)
{
Small_Object_Pool * const pool =
- (Small_Object_Pool * const)mem_internal_allocate_zeroed(
+ (Small_Object_Pool *)mem_internal_allocate_zeroed(
sizeof (Small_Object_Pool));
SET_NULL(pool->last_Arena);
Modified: trunk/src/inter_create.c
==============================================================================
--- trunk/src/inter_create.c (original)
+++ trunk/src/inter_create.c Fri Apr 27 13:09:28 2007
@@ -78,7 +78,7 @@
/*
=item C<Parrot_Interp
-make_interpreter(Parrot_Interp parent, Interp_flags flags)>
+make_interpreter(Parrot_Interp parent, INTVAL flags)>
Create the Parrot interpreter. Allocate memory and clear the registers.
@@ -89,7 +89,7 @@
void Parrot_really_destroy(Interp *, int exit_code, void *);
Parrot_Interp
-make_interpreter(Parrot_Interp parent, Interp_flags flags)
+make_interpreter(Parrot_Interp parent, INTVAL flags)
{
Interp *interp;
#if EXEC_CAPABLE
Modified: trunk/src/jit.c
==============================================================================
--- trunk/src/jit.c (original)
+++ trunk/src/jit.c Fri Apr 27 13:09:28 2007
@@ -1351,7 +1351,7 @@
Parrot_jit_info_t *
parrot_build_asm(Interp *interp,
opcode_t *code_start, opcode_t *code_end,
- void *objfile, enum_jit_code_type jit_type)
+ void *objfile, INTVAL jit_type)
{
UINTVAL i;
char *new_arena;
Modified: trunk/src/jit.h
==============================================================================
--- trunk/src/jit.h (original)
+++ trunk/src/jit.h Fri Apr 27 13:09:28 2007
@@ -195,7 +195,7 @@
Parrot_jit_arena_t arena;
Parrot_jit_optimizer_t *optimizer;
Parrot_jit_constant_pool_t *constant_pool;
- enum_jit_code_type code_type;
+ INTVAL code_type;
int flags;
const struct jit_arch_info_t *arch_info;
int n_args;
@@ -314,7 +314,7 @@
Parrot_jit_info_t *
parrot_build_asm(Interp *interp,
opcode_t *code_start, opcode_t *code_end,
- void *objfile, enum_jit_code_type);
+ void *objfile, INTVAL);
/*
* NCI interface
*/
Modified: trunk/src/mmd.c
==============================================================================
--- trunk/src/mmd.c (original)
+++ trunk/src/mmd.c Fri Apr 27 13:09:28 2007
@@ -1703,7 +1703,12 @@
* register default mmds for this type
*/
for (i = 0; i < n; ++i) {
+ /* The following always fails for Intel C++ for unknown reasons,
+ * but I'm assuming it's optimizer related.
+ */
+#ifndef __INTEL_COMPILER
assert((PTR2UINTVAL(mmd_table[i].func_ptr) & 3) == 0);
+#endif
mmd_register(interp,
mmd_table[i].func_nr, type,
mmd_table[i].right, mmd_table[i].func_ptr);
Modified: trunk/src/objects.c
==============================================================================
--- trunk/src/objects.c (original)
+++ trunk/src/objects.c Fri Apr 27 13:09:28 2007
@@ -297,7 +297,7 @@
PMC * const vtable_pmc = get_attrib_num((SLOTTYPE*)PMC_data(_class),
PCD_OBJECT_VTABLE);
VTABLE * const vtable =
- (VTABLE * const)PMC_struct_val(vtable_pmc);
+ (VTABLE *)PMC_struct_val(vtable_pmc);
VTABLE * const ro_vtable = vtable->ro_variant_vtable;
VTABLE * const deleg_pmc_vtable =
interp->vtables[enum_class_deleg_pmc];
Modified: trunk/src/packfile.c
==============================================================================
--- trunk/src/packfile.c (original)
+++ trunk/src/packfile.c Fri Apr 27 13:09:28 2007
@@ -247,7 +247,7 @@
static PMC*
run_sub(Parrot_Interp interp, PMC *sub_pmc)
{
- const Parrot_Run_core_t old = interp->run_core;
+ const INTVAL old = interp->run_core;
PMC *retval;
/*
@@ -1178,7 +1178,7 @@
PackFile_Segment *seg;
const size_t len = strlen(name) + strlen(file_name) + 2;
- char * const buf = (char * const)malloc(len);
+ char * const buf = (char *)malloc(len);
sprintf(buf, "%s_%s", name, file_name);
seg = PackFile_Segment_new_seg(interp, dir, t, buf, add);
@@ -2197,7 +2197,7 @@
}
else { /* create one */
const size_t len = strlen(cs->base.name) + 4;
- char * const name = (char * const)mem_sys_allocate(len);
+ char * const name = (char *)mem_sys_allocate(len);
sprintf(name, "%s_DB", cs->base.name);
if (interp->code && interp->code->base.dir) {
@@ -2527,7 +2527,7 @@
HashBucket *bucket = hash->bi[i];
while (bucket) {
PackFile_ConstTable * const table =
- (PackFile_ConstTable * const)bucket->key;
+ (PackFile_ConstTable *)bucket->key;
PackFile_Constant ** const orig_consts = table->constants;
PackFile_Constant ** const consts =
(PackFile_Constant **) bucket->value;
@@ -2784,7 +2784,7 @@
void
PackFile_FixupTable_new_entry(Interp *interp,
- char *label, enum_fixup_t type, opcode_t offs)
+ char *label, INTVAL type, opcode_t offs)
{
PackFile_FixupTable *self = interp->code->fixups;
opcode_t i;
@@ -2817,7 +2817,7 @@
/*
=item C<static PackFile_FixupEntry *
-find_fixup(PackFile_FixupTable *ft, enum_fixup_t type, const char *name)>
+find_fixup(PackFile_FixupTable *ft, INTVAL type, const char *name)>
Finds the fix-up entry for C<name> and returns it.
@@ -2826,7 +2826,7 @@
*/
static PackFile_FixupEntry *
-find_fixup(PackFile_FixupTable *ft, enum_fixup_t type, const char *name)
+find_fixup(PackFile_FixupTable *ft, INTVAL type, const char *name)
{
opcode_t i;
for (i = 0; i < ft->fixup_count; i++) {
@@ -2860,7 +2860,7 @@
}
else if (seg->type == PF_FIXUP_SEG) {
PackFile_FixupEntry ** const e = (PackFile_FixupEntry **)user_data;
- PackFile_FixupEntry * const fe = (PackFile_FixupEntry *
const)find_fixup(
+ PackFile_FixupEntry * const fe = (PackFile_FixupEntry *)find_fixup(
(PackFile_FixupTable *) seg, (*e)->type, (*e)->name);
if (fe) {
*e = fe;
@@ -2873,7 +2873,7 @@
/*
=item C<PackFile_FixupEntry *
-PackFile_find_fixup_entry(Interp *interp, enum_fixup_t type, char *name)>
+PackFile_find_fixup_entry(Interp *interp, int type, char *name)>
I<What does this do?>
@@ -2882,7 +2882,7 @@
*/
PackFile_FixupEntry *
-PackFile_find_fixup_entry(Interp *interp, enum_fixup_t type, char *name)
+PackFile_find_fixup_entry(Interp *interp, INTVAL type, char *name)
{
/* TODO make a hash of all fixups */
PackFile_Directory *dir = interp->code->base.dir;
@@ -3449,7 +3449,7 @@
else {
STRING *err;
PackFile_ByteCode * const cs =
- (PackFile_ByteCode * const)IMCC_compile_file_s(interp,
+ (PackFile_ByteCode *)IMCC_compile_file_s(interp,
filename, &err);
if (cs) {
do_sub_pragmas(interp, cs, PBC_LOADED, NULL);
Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc (original)
+++ trunk/src/pmc/class.pmc Fri Apr 27 13:09:28 2007
@@ -468,11 +468,9 @@
}
/* Set name and type. */
- VTABLE_set_string_keyed_str(interp, new_attribute,
- CONST_STRING(interp, "name"), name);
+ VTABLE_set_string_keyed_str(interp, new_attribute,
CONST_STRING(interp, "name"), name);
if (!PMC_IS_NULL(type)) {
- VTABLE_set_pmc_keyed_str(interp, new_attribute,
- CONST_STRING(interp, "type"), type);
+ VTABLE_set_pmc_keyed_str(interp, new_attribute,
CONST_STRING(interp, "type"), type);
}
/* Enter the attribute in the attributes array. */
@@ -744,8 +742,7 @@
/* We'll build a hash just containing the name, then give this to
* init_class_from_hash - saves some code duplication. */
PMC *naming_hash = pmc_new(interp, enum_class_Hash);
- VTABLE_set_string_keyed_str(interp, naming_hash,
- CONST_STRING(interp, "name"), name);
+ VTABLE_set_string_keyed_str(interp, naming_hash,
CONST_STRING(interp, "name"), name);
init_class_from_hash(interp, SELF, naming_hash);
}
@@ -874,8 +871,7 @@
*/
PCCMETHOD void attributes() {
- PMC *ret_attrib_metadata = VTABLE_inspect_str(interp, SELF,
- CONST_STRING(interp, "attributes"));
+ PMC *ret_attrib_metadata = VTABLE_inspect_str(interp, SELF,
CONST_STRING(interp, "attributes"));
PCCRETURN(PMC *ret_attrib_metadata);
}
@@ -904,8 +900,7 @@
*/
PCCMETHOD void methods() {
- PMC *ret_methods = VTABLE_inspect_str(interp, SELF,
- CONST_STRING(interp, "methods"));
+ PMC *ret_methods = VTABLE_inspect_str(interp, SELF,
CONST_STRING(interp, "methods"));
PCCRETURN(PMC *ret_methods);
}
@@ -934,8 +929,7 @@
*/
PCCMETHOD void parents() {
- PMC *ret_parents = VTABLE_inspect_str(interp, SELF,
- CONST_STRING(interp, "parents"));
+ PMC *ret_parents = VTABLE_inspect_str(interp, SELF,
CONST_STRING(interp, "parents"));
PCCRETURN(PMC *ret_parents);
}
@@ -962,8 +956,7 @@
*/
PCCMETHOD void roles() {
- PMC *ret_roles = VTABLE_inspect_str(interp, SELF,
- CONST_STRING(interp, "roles"));
+ PMC *ret_roles = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp,
"roles"));
PCCRETURN(PMC *ret_roles);
}
Modified: trunk/src/pmc/parrotinterpreter.pmc
==============================================================================
--- trunk/src/pmc/parrotinterpreter.pmc (original)
+++ trunk/src/pmc/parrotinterpreter.pmc Fri Apr 27 13:09:28 2007
@@ -34,7 +34,7 @@
=item C<void
clone_interpreter(Parrot_Interp dest, const Parrot_Interp source,
- Parrot_clone_flags)>
+ INTVAL flags)>
Clones the interpreter as specified by the flags.
@@ -43,7 +43,7 @@
*/
void
-clone_interpreter(Parrot_Interp d, Parrot_Interp s, Parrot_clone_flags flags)
+clone_interpreter(Parrot_Interp d, Parrot_Interp s, INTVAL flags)
{
/* we block DOD runs while cloning since C<d> is not yet running */
Parrot_block_DOD(d);
@@ -138,7 +138,7 @@
static void
create_interp(PMC *self, Parrot_Interp parent)
{
- Interp_flags flag = 0;
+ Interp_flags flag = PARROT_NO_FLAGS;
Parrot_Interp new_interp;
if (self->vtable->base_type == enum_class_ParrotThread)
Modified: trunk/src/pmc/role.pmc
==============================================================================
--- trunk/src/pmc/role.pmc (original)
+++ trunk/src/pmc/role.pmc Fri Apr 27 13:09:28 2007
@@ -306,11 +306,9 @@
PMC *new_attribute = pmc_new(interp, enum_class_Hash);
/* Set name and type. */
- VTABLE_set_string_keyed_str(interp, new_attribute,
- CONST_STRING(interp, "name"), name);
+ VTABLE_set_string_keyed_str(interp, new_attribute,
CONST_STRING(interp, "name"), name);
if (!PMC_IS_NULL(type)) {
- VTABLE_set_pmc_keyed_str(interp, new_attribute,
- CONST_STRING(interp, "type"), type);
+ VTABLE_set_pmc_keyed_str(interp, new_attribute,
CONST_STRING(interp, "type"), type);
}
/* Enter the attribute in the attributes array. */
@@ -483,8 +481,7 @@
/* We'll build a hash just containing the name, then give this to
* init_role_from_hash - saves some code duplication. */
PMC *naming_hash = pmc_new(interp, enum_class_Hash);
- VTABLE_set_string_keyed_str(interp, naming_hash,
- CONST_STRING(interp, "name"), name);
+ VTABLE_set_string_keyed_str(interp, naming_hash,
CONST_STRING(interp, "name"), name);
init_role_from_hash(interp, SELF, naming_hash);
}
@@ -523,8 +520,7 @@
*/
PCCMETHOD void attributes() {
- PMC *ret_attrib_metadata = VTABLE_inspect_str(interp, SELF,
- CONST_STRING(interp, "attributes"));
+ PMC *ret_attrib_metadata = VTABLE_inspect_str(interp, SELF,
CONST_STRING(interp, "attributes"));
PCCRETURN(PMC *ret_attrib_metadata);
}
@@ -558,8 +554,7 @@
*/
PCCMETHOD void methods() {
- PMC *ret_methods = VTABLE_inspect_str(interp, SELF,
- CONST_STRING(interp, "methods"));
+ PMC *ret_methods = VTABLE_inspect_str(interp, SELF,
CONST_STRING(interp, "methods"));
PCCRETURN(PMC *ret_methods);
}
@@ -590,8 +585,7 @@
*/
PCCMETHOD void roles() {
- PMC *ret_roles = VTABLE_inspect_str(interp, SELF,
- CONST_STRING(interp, "roles"));
+ PMC *ret_roles = VTABLE_inspect_str(interp, SELF, CONST_STRING(interp,
"roles"));
PCCRETURN(PMC *ret_roles);
}
Modified: trunk/src/sub.c
==============================================================================
--- trunk/src/sub.c (original)
+++ trunk/src/sub.c Fri Apr 27 13:09:28 2007
@@ -310,7 +310,7 @@
struct Parrot_sub *sub;
/* set file/line/pc defaults */
- info->file = (const char *) "(unknown file)";
+ info->file = (char *) "(unknown file)";
info->line = -1;
info->pc = -1;
info->nsname = NULL;