# New Ticket Created by Steve Peters # Please include the string: [perl #42768] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42768 >
Intel C++ complains very loudly using enum types in variable and parameter declarations. This patch helps to clean them up. Steve Peters [EMAIL PROTECTED]
Index: src/embed.c =================================================================== --- src/embed.c (revision 18345) +++ src/embed.c (working copy) @@ -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); } Index: src/events.c =================================================================== --- src/events.c (revision 18345) +++ src/events.c (working copy) @@ -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; Index: src/gc/smallobject.c =================================================================== --- src/gc/smallobject.c (revision 18345) +++ src/gc/smallobject.c (working copy) @@ -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); Index: src/charset/tables.h =================================================================== --- src/charset/tables.h (revision 18345) +++ src/charset/tables.h (working copy) @@ -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 */ /* Index: src/charset/iso-8859-1.c =================================================================== --- src/charset/iso-8859-1.c (revision 18345) +++ src/charset/iso-8859-1.c (working copy) @@ -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; Index: src/charset/binary.c =================================================================== --- src/charset/binary.c (revision 18345) +++ src/charset/binary.c (working copy) @@ -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; Index: src/charset/unicode.c =================================================================== --- src/charset/unicode.c (revision 18345) +++ src/charset/unicode.c (working copy) @@ -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; Index: src/charset/ascii.c =================================================================== --- src/charset/ascii.c (revision 18345) +++ src/charset/ascii.c (working copy) @@ -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; Index: src/charset/tables.c =================================================================== --- src/charset/tables.c (revision 18345) +++ src/charset/tables.c (working copy) @@ -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 */ Index: src/objects.c =================================================================== --- src/objects.c (revision 18345) +++ src/objects.c (working copy) @@ -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]; Index: src/pmc/parrotinterpreter.pmc =================================================================== --- src/pmc/parrotinterpreter.pmc (revision 18345) +++ src/pmc/parrotinterpreter.pmc (working copy) @@ -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) Index: src/inter_create.c =================================================================== --- src/inter_create.c (revision 18345) +++ src/inter_create.c (working copy) @@ -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 Index: src/packfile.c =================================================================== --- src/packfile.c (revision 18345) +++ src/packfile.c (working copy) @@ -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; @@ -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); Index: src/jit.c =================================================================== --- src/jit.c (revision 18345) +++ src/jit.c (working copy) @@ -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; Index: src/sub.c =================================================================== --- src/sub.c (revision 18345) +++ src/sub.c (working copy) @@ -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; Index: src/jit.h =================================================================== --- src/jit.h (revision 18345) +++ src/jit.h (working copy) @@ -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 */ Index: include/parrot/misc.h =================================================================== --- include/parrot/misc.h (revision 18345) +++ include/parrot/misc.h (working copy) @@ -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 */ Index: include/parrot/embed.h =================================================================== --- include/parrot/embed.h (revision 18345) +++ include/parrot/embed.h (working copy) @@ -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, INTVAL); +PARROT_API void Parrot_clear_flag(Parrot_Interp, INTVAL); +PARROT_API Parrot_Int Parrot_test_flag(Parrot_Interp, INTVAL); PARROT_API void Parrot_set_trace(Parrot_Interp, Parrot_UInt); PARROT_API void Parrot_clear_trace(Parrot_Interp, Parrot_UInt); Index: include/parrot/charset.h =================================================================== --- include/parrot/charset.h (revision 18345) +++ include/parrot/charset.h (working copy) @@ -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); Index: include/parrot/interpreter.h =================================================================== --- include/parrot/interpreter.h (revision 18345) +++ include/parrot/interpreter.h (working copy) @@ -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); Index: include/parrot/thread.h =================================================================== --- include/parrot/thread.h (revision 18345) +++ include/parrot/thread.h (working copy) @@ -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 */ Index: include/parrot/packfile.h =================================================================== --- include/parrot/packfile.h (revision 18345) +++ include/parrot/packfile.h (working copy) @@ -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: Index: include/parrot/pmc_freeze.h =================================================================== --- include/parrot/pmc_freeze.h (revision 18345) +++ include/parrot/pmc_freeze.h (working copy) @@ -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; Index: include/parrot/exceptions.h =================================================================== --- include/parrot/exceptions.h (revision 18345) +++ include/parrot/exceptions.h (working copy) @@ -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 */