On Sunday 08 April 2007 18:07, Steve Peters via RT wrote:
> On Sun Apr 08 16:08:05 2007, stmpeters wrote:
> > The attached patch includes several cleanups needed to silence
> > warnings
> > when compiling Parrot with Intel C++.
>
> It helps to attach the right patch....
I get several warnings. I've cleaned up this batch:
src/pmc/eval.pmc: In function ‘Parrot_Eval_get_string’:
src/pmc/eval.pmc:255: warning: passing argument 3 of ‘PackFile_pack’ from
incompatible pointer type
src/pmc/eval.pmc: In function ‘Parrot_Eval_thaw’:
src/pmc/eval.pmc:312: warning: passing argument 3 of ‘PackFile_unpack’ from
incompatible pointer type
src/pmc_freeze.c: In function ‘run_thaw’:
src/pmc_freeze.c:1435: warning: comparison of distinct pointer types lacks a
cast
src/pmc/string.pmc: In function ‘Parrot_String_nci_trans’:
src/pmc/string.pmc:853: warning: array subscript has type ‘char’
... but my attempt to fix these causes more test failures in t/op/string_cs.t:
src/encodings/fixed_8.c
src/encodings/fixed_8.c: In function ‘get_byte’:
src/encodings/fixed_8.c:49: warning: pointer targets in initialization differ
in
signedness
src/encodings/fixed_8.c: In function ‘set_byte’:
src/encodings/fixed_8.c:67: warning: pointer targets in assignment differ in
sig
nedness
src/encodings/ucs2.c
src/encodings/utf16.c
src/encodings/utf16.c: In function ‘get_byte’:
src/encodings/utf16.c:170: warning: pointer targets in initialization differ
in
signedness
src/encodings/utf16.c: In function ‘set_byte’:
src/encodings/utf16.c:188: warning: pointer targets in assignment differ in
sign
edness
src/encodings/utf8.c
src/encodings/utf8.c: In function ‘to_encoding’:
src/encodings/utf8.c:334: warning: pointer targets in assignment differ in
signe
dness
src/encodings/utf8.c:357: warning: pointer targets in assignment differ in
signe
dness
src/encodings/utf8.c: In function ‘get_byte’:
src/encodings/utf8.c:400: warning: pointer targets in initialization differ
in s
ignedness
src/encodings/utf8.c: In function ‘set_byte’:
src/encodings/utf8.c:418: warning: pointer targets in assignment differ in
signe
dness
The test results are:
not ok 5 - downcase
# Failed test (t/op/string_cs.t at line 72)
# got: 'aeiou_��
# '
# expected: 'aeiou_��
# '
ok 6 - upcase
not ok 7 - titlecase
# Failed test (t/op/string_cs.t at line 90)
# got: 'Zaeiou_��
# '
# expected: 'Zaeiou_��
# '
As seen through less, they are:
# Failed test (t/op/string_cs.t at line 72)
# got: 'aeiou_<C4><D6><DC>
# '
# expected: 'aeiou_<E4><F6><FC>
# '
# Failed test (t/op/string_cs.t at line 90)
# got: 'Zaeiou_<C4><D6><DC>
# '
# expected: 'Zaeiou_<E4><F6><FC>
... so the encoded characters get 32 added to them somehow, somewhere.
I've attached your patch with a few changes on my end.
-- c
=== include/parrot/charset.h
==================================================================
--- include/parrot/charset.h (revision 3072)
+++ include/parrot/charset.h (local)
@@ -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 *, int, STRING *source_string, UINTVAL offset);
+typedef INTVAL (*charset_find_cclass_t)(Interp *, int, STRING *source_string, UINTVAL offset, UINTVAL count);
+typedef INTVAL (*charset_find_not_cclass_t)(Interp *, int, 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);
=== include/parrot/embed.h
==================================================================
--- include/parrot/embed.h (revision 3072)
+++ include/parrot/embed.h (local)
@@ -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, int);
+PARROT_API void Parrot_clear_flag(Parrot_Interp, int);
+PARROT_API Parrot_Int Parrot_test_flag(Parrot_Interp, int);
PARROT_API void Parrot_set_trace(Parrot_Interp, Parrot_UInt);
PARROT_API void Parrot_clear_trace(Parrot_Interp, Parrot_UInt);
=== include/parrot/exceptions.h
==================================================================
--- include/parrot/exceptions.h (revision 3072)
+++ include/parrot/exceptions.h (local)
@@ -153,14 +153,14 @@
/* Right now there's nothing special for the jump buffer, but there might be one later, so we wrap it in a struct so that we can expand it later */
struct parrot_exception_t {
- Parrot_jump_buff destination; /* jmp_buf */
- exception_severity severity; /* s. above */
- long error; /* exception_type_enum */
- STRING *msg; /* may be NULL */
- void *resume; /* opcode_t* for resume or NULL */
- struct parrot_exception_t *prev; /* interpreters handler stack */
- long language; /* what is this? */
- long system; /* what is this? */
+ Parrot_jump_buff destination; /* jmp_buf */
+ int severity; /* s. above */
+ long error; /* exception_type_enum */
+ STRING *msg; /* may be NULL */
+ void *resume; /* opcode_t* for resume or NULL */
+ struct parrot_exception_t *prev; /* interpreter's handler stack */
+ long language; /* what is this? */
+ long system; /* what is this? */
};
typedef struct parrot_exception_t Parrot_exception;
@@ -181,7 +181,7 @@
/*
* internal exception handling
*/
-PARROT_API void do_exception(Parrot_Interp, exception_severity severity, long error);
+PARROT_API void do_exception(Parrot_Interp, int severity, long error);
PARROT_API void new_internal_exception(Parrot_Interp);
PARROT_API void free_internal_exception(Parrot_Interp);
=== include/parrot/interpreter.h
==================================================================
--- include/parrot/interpreter.h (revision 3072)
+++ include/parrot/interpreter.h (local)
@@ -303,18 +303,24 @@
op_lib_t *op_lib; /* Opcode library */
size_t op_count; /* The number of ops */
- op_info_t *op_info_table; /* Opcode info table (name, nargs, arg types) */
+ op_info_t *op_info_table; /* Opcode info table
+ * (name, nargs, arg types) */
- op_func_t *op_func_table; /* opcode dispatch table (functios, labels,
- * or nothing (e.g. switched core), which
- * the interpreter is currently running */
- op_func_t *evc_func_table; /* opcode dispatch for event checking */
+ op_func_t *op_func_table; /* opcode dispatch table
+ * (functions, labels, or nothing
+ * e.g., switched core), which
+ * the interpreter is currently
+ * running */
+
+ op_func_t *evc_func_table; /* opcode dispatch for event
+ * checking */
+
op_func_t *save_func_table; /* for restoring op_func_table */
int n_libs; /* count of libs below */
op_lib_t **all_op_libs; /* all loaded opcode libraries */
- Interp_flags flags; /* Various interpreter flags that
+ int flags; /* Various interpreter flags that
* signal that runops should do
* something */
@@ -323,8 +329,8 @@
Run_Cores 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
- * profile counters */
+ RunProfile *profile; /* The structure and array where
+ * we keep the profile counters */
INTVAL resume_flag;
size_t resume_offset;
@@ -334,14 +340,16 @@
struct _imc_info_t *imc_info; /* imcc data */
- const char* output_file; /* The file into which output is written */
+ const char* output_file; /* The file into which output is
+ * written */
PDB_t *pdb; /* Debug system */
Interp * debugger; /* trace / debug interpreter */
struct Stack_Chunk *dynamic_env; /* current dynamic environment */
- void *lo_var_ptr; /* Pointer to memory on runops system stack */
+ void *lo_var_ptr; /* Pointer to memory on runops
+ * system stack */
Interp * parent_interpreter;
@@ -360,9 +368,12 @@
/* 8: PMC *PBC_Libs Hash of load_bytecode cde */
/* 9: PMC *Executable String PMC with name from argv[0]. */
- PMC* DOD_registry; /* registered PMCs added to the root set */
+ PMC* DOD_registry; /* registered PMCs added to the
+ * root set */
- PMC* HLL_info; /* storage for HLL names and types */
+ PMC* HLL_info; /* storage for HLL names and
+ * types */
+
PMC* HLL_namespace; /* cache of HLL toplevel ns */
PMC *root_namespace; /* namespace hash */
@@ -375,7 +386,7 @@
STRING **const_cstring_table; /* CONST_STRING(x) items */
struct QUEUE* task_queue; /* per interpreter queue */
- struct _handler_node_t *exit_handler_list; /* exit.c */
+ struct _handler_node_t *exit_handler_list; /* exit.c */
int sleeping; /* used during sleep in events */
struct parrot_exception_t *exceptions; /* internal exception stack */
@@ -391,17 +402,30 @@
UINTVAL gc_generation; /* GC generation number */
- opcode_t *current_args; /* ptr into code with set_args opcode */
- opcode_t *current_params; /* ptr into code with get_params opcode */
- opcode_t *current_returns; /* ptr into code with get_returns opcode */
- PMC *args_signature; /* args signature pmc if it is non-const */
- PMC *params_signature; /* params signature pmc if it is non-const */
- PMC *returns_signature; /* returns signature pmc if it is non-const */
- /* during a call sequencer the caller fills these objects
+ opcode_t *current_args; /* ptr into code with set_args
+ * opcode */
+
+ opcode_t *current_params; /* ptr into code with get_params
+ * opcode */
+
+ opcode_t *current_returns; /* ptr into code with get_returns
+ * opcode */
+
+ PMC *args_signature; /* args signature pmc if it is
+ * non-const */
+
+ PMC *params_signature; /* params signature pmc if it is
+ * non-const */
+
+ PMC *returns_signature; /* returns signature pmc if it is
+ * non-const */
+
+ /* during a call sequence the caller fills these objects
* inside the invoke these get moved to the context structure
*/
PMC *current_cont; /* the return continuation PMC */
- PMC *current_object; /* current object if a method call */
+ PMC *current_object; /* current object if a method
+ * call */
};
/* typedef struct parrot_interp_t Interp; done in parrot.h so that
@@ -459,7 +483,7 @@
/* &end_gen */
-PARROT_API Interp *make_interpreter(Interp * parent, Interp_flags);
+PARROT_API Interp *make_interpreter(Interp * parent, int);
PARROT_API void Parrot_init(Interp *);
PARROT_API void Parrot_destroy(Interp *);
@@ -528,7 +552,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, int flags);
PARROT_API void enter_nci_method(Interp *, const int type,
void *func, const char *name, const char *proto);
=== include/parrot/misc.h
==================================================================
--- include/parrot/misc.h (revision 3072)
+++ include/parrot/misc.h (local)
@@ -141,9 +141,9 @@
typedef struct spfinfo_t {
UINTVAL width;
UINTVAL prec;
- FLAG flags;
- TYPE type;
- PHASE phase;
+ int flags;
+ int type;
+ int phase;
} *SpfInfo;
/* SPRINTF ARGUMENT OBJECT */
=== include/parrot/packfile.h
==================================================================
--- include/parrot/packfile.h (revision 3072)
+++ include/parrot/packfile.h (local)
@@ -76,8 +76,8 @@
PackFile_Segment_dump_func_t dump;
};
-PARROT_API INTVAL PackFile_funcs_register(Interp*, struct PackFile *, UINTVAL type,
- struct PackFile_funcs);
+PARROT_API INTVAL PackFile_funcs_register(Interp*, struct PackFile *,
+ UINTVAL type, struct PackFile_funcs);
typedef enum {
PF_DIR_SEG,
@@ -322,10 +322,10 @@
/* create new fixup entry */
PARROT_API void PackFile_FixupTable_new_entry(Interp *, char *label,
- enum_fixup_t, opcode_t offs);
+ int, opcode_t offs);
/* find entry */
PARROT_API struct PackFile_FixupEntry * PackFile_find_fixup_entry(Interp *,
- enum_fixup_t type, char *);
+ int type, char *);
/*
** PackFile_ByteCode Functions:
=== include/parrot/pmc_freeze.h
==================================================================
--- include/parrot/pmc_freeze.h (revision 3072)
+++ include/parrot/pmc_freeze.h (local)
@@ -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 */
+ int extra_flags; /* concerning to extra */
PMC* thaw_result; /* 1st thawed */
IMAGE_IO *image_io;
} visit_info;
=== include/parrot/pobj.h
==================================================================
--- include/parrot/pobj.h (revision 3072)
+++ include/parrot/pobj.h (local)
@@ -78,7 +78,7 @@
struct parrot_string_t {
pobj_t obj;
UINTVAL bufused;
- void *strstart;
+ char *strstart;
UINTVAL strlen;
/* parrot_string_representation_t representation;*/
void *encoding; /* These should be of type ENCODING * and CHARSET *
=== include/parrot/string_funcs.h
==================================================================
--- include/parrot/string_funcs.h (revision 3072)
+++ include/parrot/string_funcs.h (local)
@@ -112,11 +112,11 @@
PARROT_API void string_downcase_inplace(Interp *, STRING *);
PARROT_API void string_titlecase_inplace(Interp *, STRING *);
-PARROT_API INTVAL Parrot_string_is_cclass(Interp *, PARROT_CCLASS_FLAGS,
+PARROT_API INTVAL Parrot_string_is_cclass(Interp *, int,
STRING *, UINTVAL offset);
-PARROT_API INTVAL Parrot_string_find_cclass(Interp *, PARROT_CCLASS_FLAGS,
+PARROT_API INTVAL Parrot_string_find_cclass(Interp *, int,
STRING *, UINTVAL offset, UINTVAL count);
-PARROT_API INTVAL Parrot_string_find_not_cclass(Interp *, PARROT_CCLASS_FLAGS,
+PARROT_API INTVAL Parrot_string_find_not_cclass(Interp *, int,
STRING *, UINTVAL offset, UINTVAL count);
PARROT_API INTVAL Parrot_string_is_whitespace(Interp *, STRING *, INTVAL offset);
PARROT_API INTVAL Parrot_string_is_digit(Interp *, STRING *, INTVAL offset);
=== include/parrot/thread.h
==================================================================
--- include/parrot/thread.h (revision 3072)
+++ include/parrot/thread.h (local)
@@ -84,31 +84,31 @@
* per interpreter thread data structure
*/
typedef struct _Thread_data {
- Parrot_thread thread; /* pthread_t or such */
- thread_state_enum state;
- int wants_shared_gc; /* therad is trying to
+ Parrot_thread thread; /* pthread_t or such */
+ int state;
+ int wants_shared_gc; /* thread is trying to
do a shared GC run */
- UINTVAL tid; /* 0.. n-1 idx in interp array */
+ UINTVAL tid; /* 0.. n-1 idx in interp array */
- Parrot_Interp joiner; /* thread that is trying to join this */
+ Parrot_Interp joiner; /* thread that is trying to join this */
- /* for wr access to interpreter e.g. for DOD/GC
+ /* for write access to interpreter e.g. for DOD/GC
* if only used for DOD/GC the lock could be in the arena
* instead here, or in the interpreter, with negative size impact
* for the non-threaded case
*/
- Parrot_mutex interp_lock;
+ Parrot_mutex interp_lock;
/* for waking up the interpreter from various sorts
* of sleeping
*/
- Parrot_cond interp_cond;
+ Parrot_cond interp_cond;
/* STM transaction log */
- void *stm_log;
+ void *stm_log;
/* COW'd constant tables */
- Hash *const_tables;
+ Hash *const_tables;
} Thread_data;
# define LOCK_INTERPRETER(interp) \
=== src/charset/ascii.c
==================================================================
--- src/charset/ascii.c (revision 3072)
+++ src/charset/ascii.c (local)
@@ -85,7 +85,7 @@
{
String_iter iter;
UINTVAL c, len, offs;
- unsigned char *p;
+ char *p;
len = src->strlen;
if (dest) {
@@ -355,8 +355,7 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset)
+is_cclass(Interp *interp, int flags, STRING *source_string, UINTVAL offset)
{
UINTVAL codepoint;
@@ -372,7 +371,7 @@
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_cclass(Interp *interp, int flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
@@ -391,7 +390,7 @@
}
static INTVAL
-find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_not_cclass(Interp *interp, int flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
=== src/charset/binary.c
==================================================================
--- src/charset/binary.c (revision 3072)
+++ src/charset/binary.c (local)
@@ -125,21 +125,20 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset)
+is_cclass(Interp *interp, int flags, STRING *source_string, UINTVAL offset)
{
return 0;
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_cclass(Interp *interp, int 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, int flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
return offset + count;
=== src/charset/iso-8859-1.c
==================================================================
--- src/charset/iso-8859-1.c (revision 3072)
+++ src/charset/iso-8859-1.c (local)
@@ -134,7 +134,7 @@
static void
upcase(Interp *interp, STRING *source_string)
{
- unsigned char *buffer;
+ char *buffer;
UINTVAL offset = 0;
if (!source_string->strlen) {
@@ -157,7 +157,7 @@
downcase(Interp *interp, STRING *source_string)
{
UINTVAL offset = 0;
- unsigned char *buffer;
+ char *buffer;
if (!source_string->strlen) {
return;
}
@@ -176,7 +176,7 @@
static void
titlecase(Interp *interp, STRING *source_string)
{
- unsigned char *buffer;
+ char *buffer;
unsigned int c;
UINTVAL offset;
@@ -205,7 +205,7 @@
static void
upcase_first(Interp *interp, STRING *source_string)
{
- unsigned char *buffer;
+ char *buffer;
unsigned int c;
if (!source_string->strlen) {
@@ -224,7 +224,7 @@
static void
downcase_first(Interp *interp, STRING *source_string)
{
- unsigned char *buffer;
+ char *buffer;
unsigned int c;
if (!source_string->strlen) {
@@ -262,8 +262,7 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset)
+is_cclass(Interp *interp, int flags, STRING *source_string, UINTVAL offset)
{
UINTVAL codepoint;
@@ -278,7 +277,7 @@
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_cclass(Interp *interp, int flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
@@ -297,7 +296,7 @@
}
static INTVAL
-find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_not_cclass(Interp *interp, int flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
=== src/charset/tables.c
==================================================================
--- src/charset/tables.c (revision 3072)
+++ src/charset/tables.c (local)
@@ -14,7 +14,7 @@
*/
#include "tables.h"
-const PARROT_CCLASS_FLAGS Parrot_ascii_typetable[256] = {
+const int 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 +48,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 int 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 */
=== src/charset/tables.h
==================================================================
--- src/charset/tables.h (revision 3072)
+++ src/charset/tables.h (local)
@@ -20,8 +20,8 @@
#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 int Parrot_ascii_typetable[256];
+extern const int Parrot_iso_8859_1_typetable[256];
#endif /* PARROT_CHARSET_TABLES_H_GUARD */
/*
=== src/charset/unicode.c
==================================================================
--- src/charset/unicode.c (revision 3072)
+++ src/charset/unicode.c (local)
@@ -362,7 +362,7 @@
}
static int
-u_iscclass(Interp *interp, UINTVAL codepoint, PARROT_CCLASS_FLAGS flags)
+u_iscclass(Interp *interp, UINTVAL codepoint, int flags)
{
#if PARROT_HAS_ICU
/* XXX which one
@@ -429,8 +429,7 @@
}
static INTVAL
-is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *source_string, UINTVAL offset)
+is_cclass(Interp *interp, int flags, STRING *source_string, UINTVAL offset)
{
UINTVAL codepoint;
@@ -444,7 +443,7 @@
}
static INTVAL
-find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_cclass(Interp *interp, int flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
@@ -469,7 +468,7 @@
}
static INTVAL
-find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+find_not_cclass(Interp *interp, int flags,
STRING *source_string, UINTVAL offset, UINTVAL count)
{
UINTVAL pos = offset;
=== src/embed.c
==================================================================
--- src/embed.c (revision 3072)
+++ src/embed.c (local)
@@ -97,7 +97,7 @@
/*
-=item C<void Parrot_set_flag(Interp *interp, Parrot_Interp_flag flag)>
+=item C<void Parrot_set_flag(Interp *interp, int 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, int 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 *, int 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, int 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*, int 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, int flag)
{
return Interp_flags_TEST(interp, flag);
}
=== src/events.c
==================================================================
--- src/events.c (revision 3072)
+++ src/events.c (local)
@@ -107,7 +107,7 @@
* a structure to communicate with the io_thread
*/
typedef struct {
- io_thread_msg_type command;
+ int command;
parrot_event *ev;
} io_thread_msg;
=== src/exceptions.c
==================================================================
--- src/exceptions.c (revision 3072)
+++ src/exceptions.c (local)
@@ -646,8 +646,7 @@
*/
void
-do_exception(Interp *interp,
- exception_severity severity, long error)
+do_exception(Interp *interp, int severity, long error)
{
Parrot_exception * const the_exception = interp->exceptions;
=== src/inter_create.c
==================================================================
--- src/inter_create.c (revision 3072)
+++ src/inter_create.c (local)
@@ -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, int flags)
{
Interp *interp;
#if EXEC_CAPABLE
@@ -102,7 +102,7 @@
interp = &interpre;
else
#endif
- interp = mem_sys_allocate_zeroed(sizeof (Interp));
+ interp = mem_allocate_zeroed_typed(Interp);
/*
* the last interpreter (w/o) parent has to cleanup globals
=== src/io/io.c
==================================================================
--- src/io/io.c (revision 3072)
+++ src/io/io.c (local)
@@ -1283,7 +1283,7 @@
PIOOFF_T
PIO_make_offset32(INTVAL hi, INTVAL lo)
{
- return ((PIOOFF_T)hi << 32) | lo;
+ return ((PIOOFF_T)hi << 31) | lo;
}
/*
=== src/io/io_buf.c
==================================================================
--- src/io/io_buf.c (revision 3072)
+++ src/io/io_buf.c (local)
@@ -384,7 +384,7 @@
{
ParrotIOLayer *l = layer;
ParrotIOBuf *b;
- unsigned char *out_buf;
+ char *out_buf;
STRING *s;
size_t len;
size_t current = 0;
@@ -538,8 +538,8 @@
STRING **buf)
{
size_t l;
- unsigned char *out_buf;
- unsigned char *buf_start;
+ char *out_buf;
+ char *buf_start;
ParrotIOBuf * const b = &io->b;
size_t len;
STRING *s;
@@ -578,7 +578,7 @@
Parrot_allocate_string(interp, s, l);
}
}
- out_buf = (unsigned char*)s->strstart + s->strlen;
+ out_buf = s->strstart + s->strlen;
memcpy(out_buf, buf_start, len);
s->strlen = s->bufused = l;
if (PIO_buf_fill_readbuf(interp, layer, io, b) == 0)
@@ -594,7 +594,7 @@
Parrot_allocate_string(interp, s, l);
}
}
- out_buf = (unsigned char*)s->strstart + s->strlen;
+ out_buf = s->strstart + s->strlen;
len = b->next - buf_start;
memcpy(out_buf, buf_start, len);
s->strlen = s->bufused = l;
=== src/io/io_private.h
==================================================================
--- src/io/io_private.h (revision 3072)
+++ src/io/io_private.h (local)
@@ -97,9 +97,9 @@
struct _ParrotIOBuf {
INTVAL flags; /* Buffer specific flags */
size_t size;
- unsigned char *startb; /* Start of buffer */
- unsigned char *endb; /* End of buffer */
- unsigned char *next; /* Current read/write pointer */
+ char *startb; /* Start of buffer */
+ char *endb; /* End of buffer */
+ char *next; /* Current read/write pointer */
};
struct _ParrotIO {
=== src/jit.c
==================================================================
--- src/jit.c (revision 3072)
+++ src/jit.c (local)
@@ -1349,9 +1349,8 @@
*/
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)
+parrot_build_asm(Interp *interp, opcode_t *code_start, opcode_t *code_end,
+ void *objfile, int jit_type)
{
UINTVAL i;
char *new_arena;
=== src/jit.h
==================================================================
--- src/jit.h (revision 3072)
+++ src/jit.h (local)
@@ -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;
+ int code_type;
int flags;
const struct jit_arch_info_t *arch_info;
int n_args;
@@ -312,9 +312,8 @@
* interface to create JIT code
*/
Parrot_jit_info_t *
-parrot_build_asm(Interp *interp,
- opcode_t *code_start, opcode_t *code_end,
- void *objfile, enum_jit_code_type);
+parrot_build_asm(Interp *interp, opcode_t *code_start, opcode_t *code_end,
+ void *objfile, int);
/*
* NCI interface
*/
=== src/ops/io.ops
==================================================================
--- src/ops/io.ops (revision 3072)
+++ src/ops/io.ops (local)
@@ -509,7 +509,7 @@
if ($3) {
PIOOFF_T pos;
pos = PIO_tell(interp, $3);
- $1 = (INTVAL)(pos >> 32);
+ $1 = (INTVAL)(pos >> 31);
$2 = (INTVAL)(pos & 0xffffffff);
}
goto NEXT();
=== src/packfile.c
==================================================================
--- src/packfile.c (revision 3072)
+++ src/packfile.c (local)
@@ -2839,7 +2839,7 @@
void
PackFile_FixupTable_new_entry(Interp *interp,
- char *label, enum_fixup_t type, opcode_t offs)
+ char *label, int type, opcode_t offs)
{
struct PackFile_FixupTable *self = interp->code->fixups;
opcode_t i;
@@ -2943,8 +2943,7 @@
*/
struct PackFile_FixupEntry *
-PackFile_find_fixup_entry(Interp *interp, enum_fixup_t type,
- char * name)
+PackFile_find_fixup_entry(Interp *interp, int type, char *name)
{
/* TODO make a hash of all fixups */
struct PackFile_Directory *dir = interp->code->base.dir;
=== src/pmc/default.pmc
==================================================================
--- src/pmc/default.pmc (revision 3072)
+++ src/pmc/default.pmc (local)
@@ -952,7 +952,7 @@
b = parrot_hash_get_bucket(INTERP, (Hash*) PMC_metadata(SELF),
name);
if (b)
- p = b->value;
+ p = (PMC *)b->value;
}
if (PMC_IS_NULL(p)) {
/* may be NCI? */
=== src/pmc/eval.pmc
==================================================================
--- src/pmc/eval.pmc (revision 3072)
+++ src/pmc/eval.pmc (local)
@@ -252,7 +252,7 @@
See RT #40410 for example of the problem (note on line that
segfaults, it is *cursor that is pointing to dealloced memory). */
Parrot_block_DOD(INTERP);
- PackFile_pack(INTERP, pf, res->strstart);
+ PackFile_pack(INTERP, pf, (opcode_t *)res->strstart);
Parrot_unblock_DOD(INTERP);
/* now remove all segments from directory again and destroy
* the packfile
@@ -309,7 +309,8 @@
SUPER(info);
sub = PMC_sub(SELF);
pf = PackFile_new(INTERP, 0);
- if (!PackFile_unpack(INTERP, pf, packed->strstart, packed->strlen))
+ if (!PackFile_unpack(INTERP, pf, (opcode_t *)packed->strstart,
+ packed->strlen))
real_exception(INTERP, NULL, E_IOError,
"couldn't unpack packfile");
do_sub_pragmas(INTERP, pf->cur_cs, PBC_PBC, SELF);
=== src/pmc/key.pmc
==================================================================
--- src/pmc/key.pmc (revision 3072)
+++ src/pmc/key.pmc (local)
@@ -435,7 +435,7 @@
void thawfinish(visit_info *info) {
PMC *key = SELF, *next;
while (1) {
- next = PMC_data(key);
+ next = (PMC *)PMC_data(key);
if (PMC_IS_NULL(next)) {
PMC_data(key) = NULL;
break;
=== src/pmc/parrotinterpreter.pmc
==================================================================
--- src/pmc/parrotinterpreter.pmc (revision 3072)
+++ src/pmc/parrotinterpreter.pmc (local)
@@ -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, int 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;
+ int flag = 0;
Parrot_Interp new_interp;
if (self->vtable->base_type == enum_class_ParrotThread)
=== src/pmc/string.pmc
==================================================================
--- src/pmc/string.pmc (revision 3072)
+++ src/pmc/string.pmc (local)
@@ -836,7 +836,7 @@
METHOD void trans(STRING* src, PMC* table) {
INTVAL i, len;
- unsigned char *p, ch;
+ char *p, ch;
INTVAL *tr_data;
len = string_length(interp, src);
@@ -868,7 +868,7 @@
METHOD void reverse(STRING* src) {
INTVAL i, len;
- unsigned char *p, ch;
+ char *p, ch;
len = string_length(interp, src);
if (!len)
@@ -898,7 +898,7 @@
METHOD INTVAL is_integer(STRING* src) {
INTVAL i, len;
- unsigned char *p;
+ char *p;
len = string_length(interp, src);
if (!len)
=== src/pmc_freeze.c
==================================================================
--- src/pmc_freeze.c (revision 3072)
+++ src/pmc_freeze.c (local)
@@ -1432,7 +1432,7 @@
*/
LVALUE_CAST(char *, image->strstart) -= bufused;
image->bufused = bufused;
- assert(image->strstart >= PObj_bufstart(image));
+ assert(image->strstart >= (char *)PObj_bufstart(image));
if (dod_block) {
Parrot_unblock_DOD(interp);
=== src/string.c
==================================================================
--- src/string.c (revision 3072)
+++ src/string.c (local)
@@ -971,14 +971,15 @@
if (replace_dest && *d) {
assert(src->encoding == Parrot_fixed_8_encoding_ptr);
dest = *d;
+
dest->encoding = src->encoding;
- dest->charset = src->charset;
+ dest->charset = src->charset;
- dest->strstart = (char *)src->strstart + true_offset ;
- dest->bufused = true_length;
+ dest->strstart = src->strstart + true_offset;
+ dest->bufused = true_length;
- dest->strlen = true_length;
- dest->hashval = 0;
+ dest->strlen = true_length;
+ dest->hashval = 0;
}
else
dest = CHARSET_GET_CODEPOINTS(interp, src, true_offset,
@@ -2005,13 +2006,12 @@
*/
STRING *
-string_escape_string_delimited(Interp *interp,
- STRING *src, UINTVAL limit)
+string_escape_string_delimited(Interp *interp, STRING *src, UINTVAL limit)
{
STRING *result, *hex;
UINTVAL i, len, charlen;
String_iter iter;
- unsigned char *dp;
+ char *dp;
if (!src)
return NULL;
@@ -2359,8 +2359,7 @@
*/
INTVAL
-Parrot_string_is_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
- STRING *s, UINTVAL offset)
+Parrot_string_is_cclass(Interp *interp, int flags, STRING *s, UINTVAL offset)
{
if (!string_length(interp, s))
return 0;
@@ -2368,7 +2367,7 @@
}
INTVAL
-Parrot_string_find_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+Parrot_string_find_cclass(Interp *interp, int flags,
STRING *s, UINTVAL offset, UINTVAL count)
{
if (!s)
@@ -2377,7 +2376,7 @@
}
INTVAL
-Parrot_string_find_not_cclass(Interp *interp, PARROT_CCLASS_FLAGS flags,
+Parrot_string_find_not_cclass(Interp *interp, int flags,
STRING *s, UINTVAL offset, UINTVAL count)
{
if (!s)