Author: chromatic
Date: Fri Jun  1 18:10:38 2007
New Revision: 18744

Modified:
   trunk/compilers/imcc/imc.c
   trunk/compilers/imcc/imcc.l
   trunk/compilers/imcc/imcc.y
   trunk/compilers/imcc/imcparser.c
   trunk/compilers/imcc/instructions.c
   trunk/compilers/imcc/main.c
   trunk/compilers/imcc/parser.h
   trunk/compilers/imcc/symreg.c
   trunk/include/parrot/pic.h
   trunk/lib/Parrot/OpTrans/C.pm
   trunk/lib/Parrot/OpTrans/CGP.pm
   trunk/lib/Parrot/OpTrans/CGoto.pm
   trunk/lib/Parrot/OpTrans/CPrederef.pm
   trunk/lib/Parrot/OpTrans/CSwitch.pm
   trunk/src/encodings/utf8.c
   trunk/src/interpreter.c
   trunk/src/io/io_buf.c
   trunk/src/io/io_mmap.c
   trunk/src/io/io_string.c
   trunk/src/io/io_utf8.c
   trunk/src/jit/i386/jit_emit.h
   trunk/src/mmd.c
   trunk/src/pic.c
   trunk/src/pmc.c
   trunk/src/pmc/class.pmc
   trunk/src/pmc/lexinfo.pmc
   trunk/src/pmc/namespace.pmc
   trunk/src/pmc/parrotobject.pmc
   trunk/src/stm/backend.c
   trunk/src/stm/stm_waitlist.h

Log:
Make Perl compile with g++ part one (Steve Peters, RT #43108).

Modified: trunk/compilers/imcc/imc.c
==============================================================================
--- trunk/compilers/imcc/imc.c  (original)
+++ trunk/compilers/imcc/imc.c  Fri Jun  1 18:10:38 2007
@@ -79,7 +79,7 @@
 static IMC_Unit *
 imc_new_unit(IMC_Unit_Type t)
 {
-   IMC_Unit * unit = calloc(1, sizeof (IMC_Unit));
+   IMC_Unit * unit = (IMC_Unit *)calloc(1, sizeof (IMC_Unit));
    create_symhash(&unit->hash);
    unit->type = t;
    return unit;

Modified: trunk/compilers/imcc/imcc.l
==============================================================================
--- trunk/compilers/imcc/imcc.l (original)
+++ trunk/compilers/imcc/imcc.l Fri Jun  1 18:10:38 2007
@@ -147,7 +147,7 @@
         /* Newline in the heredoc. Realloc and cat on. */
         IMCC_INFO(interp)->line++;
         IMCC_INFO(interp)->heredoc_content =
-            mem_sys_realloc(IMCC_INFO(interp)->heredoc_content,
+            (char*)mem_sys_realloc(IMCC_INFO(interp)->heredoc_content,
                             strlen(IMCC_INFO(interp)->heredoc_content) +
                             strlen(yytext) + 2);
         strcpy(IMCC_INFO(interp)->heredoc_content +
@@ -174,7 +174,7 @@
         {
             /* Part of the heredoc. Realloc and cat the line on. */
             IMCC_INFO(interp)->heredoc_content =
-                mem_sys_realloc(IMCC_INFO(interp)->heredoc_content,
+                (char*)mem_sys_realloc(IMCC_INFO(interp)->heredoc_content,
                                 strlen(IMCC_INFO(interp)->heredoc_content) +
                                 strlen(yytext) + 2);
             strcpy(IMCC_INFO(interp)->heredoc_content +
@@ -404,7 +404,7 @@
 
             if (!IMCC_INFO(interp)->frames || 
!IMCC_INFO(interp)->frames->label)
                 IMCC_fataly(interp, E_SyntaxError, "missing space?");
-        label = mem_sys_allocate(yyleng+10);
+        label = (char*)mem_sys_allocate(yyleng+10);
         sprintf(label, "%s%d", yytext, IMCC_INFO(interp)->frames->label);
 
         valp->s = label;
@@ -423,7 +423,7 @@
             if (!IMCC_INFO(interp)->frames || 
!IMCC_INFO(interp)->frames->label)
                 IMCC_fataly(interp, E_SyntaxError, "missing space?");
 
-            label = mem_sys_allocate(yyleng+10);
+            label = (char*)mem_sys_allocate(yyleng+10);
             sprintf(label, "%s%d", yytext, IMCC_INFO(interp)->frames->label);
 
             valp->s = label;
@@ -444,7 +444,7 @@
         int type = pmc_type(interp, string_from_cstring(interp, macro_name, 
0));
 
         if (type > 0) {
-            char *buf = malloc(16);
+            char *buf = (char*)malloc(16);
             sprintf(buf, "%d", type);
             valp->s = buf;
             free(macro_name);
@@ -515,7 +515,7 @@
         frame->s.next = (struct parser_state_t*) IMCC_INFO(interp)->frames;
         IMCC_INFO(interp)->frames = frame;
         /* Start slurping up the heredoc. */
-        IMCC_INFO(interp)->heredoc_content = mem_sys_allocate(2);
+        IMCC_INFO(interp)->heredoc_content = (char*)mem_sys_allocate(2);
         IMCC_INFO(interp)->heredoc_content[0] = yytext[2];        /* preserve 
delim */
         IMCC_INFO(interp)->heredoc_content[1] = 0;                /* eos */
         yy_push_state(heredoc1, yyscanner);
@@ -572,7 +572,7 @@
     if (valp) {
         YYCHOP();
 
-        label = mem_sys_allocate(strlen(IMCC_INFO(interp)->cur_macro_name) + 
yyleng + 15);
+        label = 
(char*)mem_sys_allocate(strlen(IMCC_INFO(interp)->cur_macro_name) + yyleng + 
15);
         sprintf(label, "local__%s__%s__$:", IMCC_INFO(interp)->cur_macro_name, 
yytext+1);
 
         valp->s = label;
@@ -585,7 +585,7 @@
     char *label;
 
     if (valp) {
-        label = mem_sys_allocate(strlen(IMCC_INFO(interp)->cur_macro_name) + 
yyleng + 15);
+        label = 
(char*)mem_sys_allocate(strlen(IMCC_INFO(interp)->cur_macro_name) + yyleng + 
15);
         sprintf(label, "local__%s__%s__$", IMCC_INFO(interp)->cur_macro_name, 
yytext+2);
 
         valp->s = label;

Modified: trunk/compilers/imcc/imcc.y
==============================================================================
--- trunk/compilers/imcc/imcc.y (original)
+++ trunk/compilers/imcc/imcc.y Fri Jun  1 18:10:38 2007
@@ -108,7 +108,7 @@
     if (ascii) {
         /* strip delimiters */
         len = strlen(constant);
-        name = mem_sys_allocate(len);
+        name = (char *)mem_sys_allocate(len);
         constant[len - 1] = '\0';
         strcpy(name, constant + 1);
         free(constant);
@@ -182,7 +182,7 @@
     Instruction *i;
     i =  iLABEL(interp, unit, r);
     r->type = (r->type & VT_ENCODED) ? VT_PCC_SUB|VT_ENCODED : VT_PCC_SUB;
-    r->pcc_sub = calloc(1, sizeof(struct pcc_sub_t));
+    r->pcc_sub = (pcc_sub_t*)calloc(1, sizeof(struct pcc_sub_t));
     IMCC_INFO(interp)->cur_call = r;
     i->line = IMCC_INFO(interp)->line;
     add_namespace(interp, unit);
@@ -1048,7 +1048,7 @@
 id_list_id :
      IDENTIFIER UNIQUE_REG
      {
-         IdList* l = malloc(sizeof(IdList));
+         IdList* l = (IdList*)malloc(sizeof(IdList));
          l->id = $1;
          l->unique_reg = 1;
          $$ = l;
@@ -1056,7 +1056,7 @@
 
    | IDENTIFIER
      {
-         IdList* l = malloc(sizeof(IdList));
+         IdList* l = (IdList*)malloc(sizeof(IdList));
          l->id = $1;
          l->unique_reg = 0;
          $$ = l;

Modified: trunk/compilers/imcc/imcparser.c
==============================================================================
--- trunk/compilers/imcc/imcparser.c    (original)
+++ trunk/compilers/imcc/imcparser.c    Fri Jun  1 18:10:38 2007
@@ -419,7 +419,7 @@
     if (ascii) {
         /* strip delimiters */
         len = strlen(constant);
-        name = mem_sys_allocate(len);
+        name = (char *)mem_sys_allocate(len);
         constant[len - 1] = '\0';
         strcpy(name, constant + 1);
         free(constant);
@@ -493,7 +493,7 @@
     Instruction *i;
     i =  iLABEL(interp, unit, r);
     r->type = (r->type & VT_ENCODED) ? VT_PCC_SUB|VT_ENCODED : VT_PCC_SUB;
-    r->pcc_sub = calloc(1, sizeof(struct pcc_sub_t));
+    r->pcc_sub = (pcc_sub_t*)calloc(1, sizeof(struct pcc_sub_t));
     IMCC_INFO(interp)->cur_call = r;
     i->line = IMCC_INFO(interp)->line;
     add_namespace(interp, unit);
@@ -3482,7 +3482,7 @@
   case 166:
 #line 1056 "compilers/imcc/imcc.y"
     {
-         IdList* l = malloc(sizeof(IdList));
+         IdList* l = (IdList*)malloc(sizeof(IdList));
          l->id = (yyvsp[(1) - (2)].s);
          l->unique_reg = 1;
          (yyval.idlist) = l;
@@ -3492,7 +3492,7 @@
   case 167:
 #line 1064 "compilers/imcc/imcc.y"
     {
-         IdList* l = malloc(sizeof(IdList));
+         IdList* l = (IdList*)malloc(sizeof(IdList));
          l->id = (yyvsp[(1) - (1)].s);
          l->unique_reg = 0;
          (yyval.idlist) = l;

Modified: trunk/compilers/imcc/instructions.c
==============================================================================
--- trunk/compilers/imcc/instructions.c (original)
+++ trunk/compilers/imcc/instructions.c Fri Jun  1 18:10:38 2007
@@ -63,7 +63,7 @@
     reg_space = 0;
     if (n > 1)
         reg_space = sizeof (SymReg *) * (n - 1);
-    ins = calloc(sizeof (Instruction) + reg_space, 1);
+    ins = (Instruction*)calloc(sizeof (Instruction) + reg_space, 1);
     if (ins == NULL) {
         fprintf(stderr, "Memory error at mk_instruction\n");
         abort();

Modified: trunk/compilers/imcc/main.c
==============================================================================
--- trunk/compilers/imcc/main.c (original)
+++ trunk/compilers/imcc/main.c Fri Jun  1 18:10:38 2007
@@ -198,6 +198,7 @@
 {
     struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
     int   status;
+    extern int yydebug;
     if (*argc == 1) {
         usage(stderr);
         exit(1);
@@ -709,7 +710,7 @@
         IMCC_INFO(interp)->state->pasm_file = pasm_file;
         IMCC_TRY(IMCC_INFO(interp)->jump_buf,
                  IMCC_INFO(interp)->error_code) {
-            if (yyparse(yyscanner, (void *) interp))
+            if (yyparse(yyscanner, interp))
                 exit(1);
 
             imc_compile_all_units(interp);

Modified: trunk/compilers/imcc/parser.h
==============================================================================
--- trunk/compilers/imcc/parser.h       (original)
+++ trunk/compilers/imcc/parser.h       Fri Jun  1 18:10:38 2007
@@ -24,9 +24,6 @@
 /* short ranged globals for lexer state */
 EXTERN int is_def;
 
-/* bison */
-PARROT_API EXTERN int yydebug;
-
 #define KEY_BIT(argnum) (1 << (argnum))
 
 /* An opaque pointer. */

Modified: trunk/compilers/imcc/symreg.c
==============================================================================
--- trunk/compilers/imcc/symreg.c       (original)
+++ trunk/compilers/imcc/symreg.c       Fri Jun  1 18:10:38 2007
@@ -80,7 +80,7 @@
         free(name);
         return r;
     }
-    r = calloc(1, sizeof (SymReg));
+    r = (SymReg *)calloc(1, sizeof (SymReg));
     if (r==NULL) {
         fprintf(stderr, "Memory error at mk_symreg\n");
         abort();
@@ -145,7 +145,7 @@
     IMC_Unit *unit = IMCC_INFO(interp)->last_unit;
     SymReg *r = _mk_symreg(&unit->hash, name, proto);
     r->type = VT_PCC_SUB;
-    r->pcc_sub = calloc(1, sizeof (struct pcc_sub_t));
+    r->pcc_sub = (pcc_sub_t*)calloc(1, sizeof (struct pcc_sub_t));
     return r;
 }
 
@@ -182,9 +182,9 @@
 add_pcc_arg(SymReg *r, SymReg * arg)
 {
     int n = r->pcc_sub->nargs;
-    r->pcc_sub->args = realloc(r->pcc_sub->args, (n + 1) * sizeof (SymReg *));
+    r->pcc_sub->args = (SymReg**)realloc(r->pcc_sub->args, (n + 1) * sizeof 
(SymReg *));
     r->pcc_sub->args[n] = arg;
-    r->pcc_sub->arg_flags = realloc(r->pcc_sub->arg_flags, (n+1) * sizeof 
(int));
+    r->pcc_sub->arg_flags = (int*)realloc(r->pcc_sub->arg_flags, (n+1) * 
sizeof (int));
     r->pcc_sub->arg_flags[n] = arg->type;
     arg->type &= ~(VT_FLAT|VT_OPTIONAL|VT_OPT_FLAG|VT_NAMED);
     r->pcc_sub->nargs++;
@@ -200,12 +200,12 @@
 add_pcc_result(SymReg *r, SymReg * arg)
 {
     int n = r->pcc_sub->nret;
-    r->pcc_sub->ret = realloc(r->pcc_sub->ret, (n + 1) * sizeof (SymReg *));
+    r->pcc_sub->ret = (SymReg **)realloc(r->pcc_sub->ret, (n + 1) * sizeof 
(SymReg *));
     r->pcc_sub->ret[n] = arg;
     /* we can't keep the flags in the SymReg as the SymReg
      * maybe used with different flags for different calls
      */
-    r->pcc_sub->ret_flags = realloc(r->pcc_sub->ret_flags, (n+1) * sizeof 
(int));
+    r->pcc_sub->ret_flags = (int*)realloc(r->pcc_sub->ret_flags, (n+1) * 
sizeof (int));
     r->pcc_sub->ret_flags[n] = arg->type;
     arg->type &= ~(VT_FLAT|VT_OPTIONAL|VT_OPT_FLAG|VT_NAMED);
     r->pcc_sub->nret++;
@@ -215,7 +215,7 @@
 add_pcc_multi(SymReg *r, SymReg * arg)
 {
     int n = r->pcc_sub->nmulti;
-    r->pcc_sub->multi = realloc(r->pcc_sub->multi, (n + 1) * sizeof (SymReg 
*));
+    r->pcc_sub->multi = (SymReg **)realloc(r->pcc_sub->multi, (n + 1) * sizeof 
(SymReg *));
     r->pcc_sub->multi[n] = arg;
     r->pcc_sub->nmulti++;
 }
@@ -280,7 +280,7 @@
     Identifier * ident;
     SymReg * r;
     if (_namespace) {
-        ident = calloc(1, sizeof (struct ident_t));
+        ident = (Identifier *)calloc(1, sizeof (struct ident_t));
         ident->name = fullname;
         ident->next = _namespace->idents;
         _namespace->idents = ident;
@@ -413,7 +413,7 @@
         return name;
     /* TODO keyed syntax */
     len = strlen(name) + l  + 4;
-    ns_name = mem_sys_allocate(len);
+    ns_name = (char*)mem_sys_allocate(len);
     strcpy(ns_name, IMCC_INFO(interp)->cur_namespace->name);
     *ns_name = '_';
     ns_name[l - 1] = '\0';
@@ -437,7 +437,7 @@
     SymReg * r;
     if (uniq == U_add_all) {
 
-        r = calloc(1, sizeof (SymReg));
+        r = (SymReg *)calloc(1, sizeof (SymReg));
         r->type = VTADDRESS;
         r->name = name;
         _store_symreg(hsh,r);
@@ -598,7 +598,7 @@
     }
     if (any_slice && !(keys[0]->type & VT_SLICE_BITS))
         keys[0]->type |= (VT_START_SLICE|VT_END_SLICE);
-    key_str = malloc(len);
+    key_str = (char*)malloc(len);
     *key_str = 0;
     /* first look, if we already have this exact key chain */
     for (i = 0; i < nargs; i++) {
@@ -612,7 +612,7 @@
         return keychain;
     }
     /* no, need a new one */
-    keychain = mem_sys_allocate_zeroed(sizeof (SymReg));
+    keychain = mem_allocate_zeroed_typed(SymReg);
     keychain->type = VTCONST;
     ++keychain->use_count;
     key = keychain;
@@ -668,7 +668,7 @@
 void
 create_symhash(SymHash *hash)
 {
-   hash->data = mem_sys_allocate_zeroed(16 * sizeof (SymReg*));
+   hash->data = (SymReg**)mem_sys_allocate_zeroed(16 * sizeof (SymReg*));
    hash->size = 16;
    hash->entries = 0;
 }
@@ -683,9 +683,9 @@
     SymReg ** next_r;
     int n_next, j, k;
 
-    nh.data = mem_sys_allocate_zeroed(new_size * sizeof (SymReg*));
+    nh.data = (SymReg**)mem_sys_allocate_zeroed(new_size * sizeof (SymReg*));
     n_next = 16;
-    next_r =  mem_sys_allocate_zeroed(n_next   * sizeof (SymReg*));
+    next_r =  (SymReg**)mem_sys_allocate_zeroed(n_next   * sizeof (SymReg*));
     for (i = 0; i < hsh->size; i++) {
         j = 0;
         for (r = hsh->data[i]; r; r = next) {
@@ -696,7 +696,7 @@
              */
             if (j >= n_next) {
                 n_next <<= 1;
-                next_r = mem_sys_realloc(next_r, n_next * sizeof (SymReg*));
+                next_r = (SymReg**)mem_sys_realloc(next_r, n_next * sizeof 
(SymReg*));
             }
             r->next = NULL;
             next_r[j++] = r;

Modified: trunk/include/parrot/pic.h
==============================================================================
--- trunk/include/parrot/pic.h  (original)
+++ trunk/include/parrot/pic.h  Fri Jun  1 18:10:38 2007
@@ -74,7 +74,7 @@
 Parrot_PIC* parrot_PIC_alloc_pic(Interp*);
 
 void parrot_pic_find_infix_v_pp(Interp *, PMC *left, PMC *right,
-                Parrot_MIC *mic, void **cur_opcode);
+                Parrot_MIC *mic, opcode_t *cur_opcode);
 void * parrot_pic_opcode(Interp *, INTVAL op);
 
 typedef int (*arg_pass_f)(Interp *, PMC *sig,

Modified: trunk/lib/Parrot/OpTrans/C.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/C.pm       (original)
+++ trunk/lib/Parrot/OpTrans/C.pm       Fri Jun  1 18:10:38 2007
@@ -52,7 +52,7 @@
 sub defines {
     return <<END;
 #undef CONST
-#define REL_PC     ((size_t)(cur_opcode - interp->code->base.data))
+#define REL_PC     ((size_t)(cur_opcode - (opcode_t *)interp->code->base.data))
 #define CUR_OPCODE cur_opcode
 #define IREG(i) REG_INT(cur_opcode[i])
 #define NREG(i) REG_NUM(cur_opcode[i])

Modified: trunk/lib/Parrot/OpTrans/CGP.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CGP.pm     (original)
+++ trunk/lib/Parrot/OpTrans/CGP.pm     Fri Jun  1 18:10:38 2007
@@ -68,7 +68,7 @@
     return $pred_def . <<END;
 /* defines - $0 -> $type */
 #  define opcode_to_prederef(i, op)   \\
-     (void**) (op   - CONTEXT(i->ctx)->pred_offset)
+     (opcode_t *) (op   - CONTEXT(i->ctx)->pred_offset)
 END
 }
 
@@ -132,10 +132,10 @@
      * (gdb) disas l_ops_addr[1191] l_ops_addr[1192]
      */
 #if defined(__GNUC__) && defined(I386) && defined(PARROT_CGP_REGS)
-    register void **   cur_opcode __asm__ ("esi") = cur_op;
+    register opcode_t *   cur_opcode __asm__ ("esi") = cur_op;
     register char *   _reg_base   __asm__ ("edi");
 #else
-    void **cur_opcode = cur_op;
+    opcode_t *cur_opcode = cur_op;
     char * _reg_base;
 #endif
 

Modified: trunk/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CGoto.pm   (original)
+++ trunk/lib/Parrot/OpTrans/CGoto.pm   Fri Jun  1 18:10:38 2007
@@ -64,7 +64,7 @@
 sub defines {
     return <<END;
 #undef CONST
-#define REL_PC     ((size_t)(cur_opcode - interp->code->base.data))
+#define REL_PC     ((size_t)(cur_opcode - (opcode_t*)interp->code->base.data))
 #define CUR_OPCODE cur_opcode
 #define IREG(i) REG_INT(cur_opcode[i])
 #define NREG(i) REG_NUM(cur_opcode[i])

Modified: trunk/lib/Parrot/OpTrans/CPrederef.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CPrederef.pm       (original)
+++ trunk/lib/Parrot/OpTrans/CPrederef.pm       Fri Jun  1 18:10:38 2007
@@ -36,7 +36,7 @@
     my $type = __PACKAGE__;
     return <<END;
 /* defines - $0 -> $type */
-#define REL_PC ((size_t)(cur_opcode - interp->code->prederef.code))
+#define REL_PC ((size_t)(cur_opcode - (opcode_t*)interp->code->prederef.code))
 #define CUR_OPCODE \\
     ((opcode_t*)cur_opcode + CONTEXT(interp->ctx)->pred_offset)
 #define OP_AS_OFFS(o) (_reg_base + ((opcode_t*)cur_opcode)[o])
@@ -76,7 +76,7 @@
     my $prefix = $self->core_prefix;
     return <<END;
 /* run_core_func_decl - $0 -> $type */
-void ** $prefix$core(void **cur_op, Parrot_Interp interp)
+opcode_t * $prefix$core(opcode_t *cur_op, Parrot_Interp interp)
 END
 }
 

Modified: trunk/lib/Parrot/OpTrans/CSwitch.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CSwitch.pm (original)
+++ trunk/lib/Parrot/OpTrans/CSwitch.pm Fri Jun  1 18:10:38 2007
@@ -76,7 +76,7 @@
     return $pred_def . <<END;
 /* defines - $0 -> $type */
 #  define opcode_to_prederef(i, op)   (op ? \\
-     (void**) (op   - CONTEXT(i->ctx)->pred_offset) : NULL)
+     (opcode_t*) (op   - CONTEXT(i->ctx)->pred_offset) : (opcode_t*)NULL)
 /*
  * if we are using CHECK_EVENTS elsewhere this macro should (again)
  * be in includes/parrot/event.h
@@ -87,7 +87,7 @@
 #undef  CHECK_EVENTS
 #define CHECK_EVENTS(i, n)   \\
         interp->task_queue->head ?  \\
-                Parrot_do_check_events(i, n) : n
+                (opcode_t*)Parrot_do_check_events(i, n) : n
 END
 }
 
@@ -153,10 +153,10 @@
     return <<END_C;
 /* run_core_func_start - $0 -> $type */
 #if defined(__GNUC__) && defined(I386) && defined(PARROT_SWITCH_REGS)
-    register void **   cur_opcode __asm__ ("esi") = cur_op;
+    register opcode_t *   cur_opcode __asm__ ("esi") = cur_op;
     register char *   _reg_base   __asm__ ("edi");
 #else
-    void ** cur_opcode = cur_op;
+    opcode_t * cur_opcode = cur_op;
     char * _reg_base;
 #endif
 
@@ -164,7 +164,7 @@
     _reg_base = (char*)interp->ctx.bp.regs_i;
     do {
 SWITCH_AGAIN:
-    cur_opcode = CHECK_EVENTS(interp, *cur_opcode);
+    cur_opcode = CHECK_EVENTS(interp, cur_opcode);
     if (!cur_opcode)
         break;
     switch (*(opcode_t*)cur_opcode) {

Modified: trunk/src/encodings/utf8.c
==============================================================================
--- trunk/src/encodings/utf8.c  (original)
+++ trunk/src/encodings/utf8.c  Fri Jun  1 18:10:38 2007
@@ -60,7 +60,7 @@
 */
 
 static UINTVAL
-utf8_characters(const void *ptr, UINTVAL byte_len)
+utf8_characters(const utf8_t *ptr, UINTVAL byte_len)
 {
     const utf8_t *u8ptr = ptr;
     const utf8_t *u8end = u8ptr + byte_len;
@@ -90,7 +90,7 @@
 */
 
 static UINTVAL
-utf8_decode(const void *ptr)
+utf8_decode(const utf8_t *ptr)
 {
     const utf8_t *u8ptr = ptr;
     UINTVAL c = *u8ptr;
@@ -265,7 +265,7 @@
     unsigned char *new_pos, *pos;
 
     pos = (unsigned char *)s->strstart + i->bytepos;
-    new_pos = utf8_encode(pos, c);
+    new_pos = (unsigned char *)utf8_encode(pos, c);
     i->bytepos += (new_pos - pos);
     /* XXX possible buffer overrun exception? */
     assert(i->bytepos <= PObj_buflen(s));
@@ -327,7 +327,7 @@
 
     if (in_place) {
         /* need intermediate memory */
-        p = mem_sys_allocate(src_len);
+        p = (unsigned char *)mem_sys_allocate(src_len);
     }
     else {
         Parrot_reallocate_string(interp, dest, src_len);
@@ -350,7 +350,7 @@
                     need = 16;
                 dest_len += need;
                 if (in_place)
-                    p = mem_sys_realloc(p, dest_len);
+                    p = (unsigned char *)mem_sys_realloc(p, dest_len);
                 else {
                     result->bufused = dest_pos;
                     Parrot_reallocate_string(interp, dest, dest_len);
@@ -359,7 +359,7 @@
             }
 
             pos = p + dest_pos;
-            new_pos = utf8_encode(pos, c);
+            new_pos = (unsigned char *)utf8_encode(pos, c);
             dest_pos += (new_pos - pos);
         }
         result->bufused = dest_pos;
@@ -375,7 +375,7 @@
 static UINTVAL
 get_codepoint(Interp *interp, const STRING *src, UINTVAL offset)
 {
-    const void * const start = utf8_skip_forward(src->strstart, offset);
+    const utf8_t * const start = (utf8_t *)utf8_skip_forward(src->strstart, 
offset);
     return utf8_decode(start);
 }
 

Modified: trunk/src/interpreter.c
==============================================================================
--- trunk/src/interpreter.c     (original)
+++ trunk/src/interpreter.c     Fri Jun  1 18:10:38 2007
@@ -635,10 +635,10 @@
 {
 #ifdef HAVE_COMPUTED_GOTO
     opcode_t *code_start = (opcode_t *)interp->code->base.data;
-    void **pc_prederef;
+    opcode_t *pc_prederef;
     init_prederef(interp, PARROT_CGP_CORE);
-    pc_prederef = interp->code->prederef.code + (pc - code_start);
-    pc = (opcode_t*) cgp_core(pc_prederef, interp);
+    pc_prederef = (opcode_t*)interp->code->prederef.code + (pc - code_start);
+    pc = cgp_core(pc_prederef, interp);
     return pc;
 #else
     PIO_eprintf(interp,
@@ -663,10 +663,10 @@
 runops_switch(Interp *interp, opcode_t *pc)
 {
     opcode_t * const code_start = (opcode_t *)interp->code->base.data;
-    void **pc_prederef;
+    opcode_t *pc_prederef;
     init_prederef(interp, PARROT_SWITCH_CORE);
-    pc_prederef = interp->code->prederef.code + (pc - code_start);
-    pc = (opcode_t*) switch_core(pc_prederef, interp);
+    pc_prederef = (opcode_t*)interp->code->prederef.code + (pc - code_start);
+    pc = switch_core(pc_prederef, interp);
     return pc;
 }
 

Modified: trunk/src/io/io_buf.c
==============================================================================
--- trunk/src/io/io_buf.c       (original)
+++ trunk/src/io/io_buf.c       Fri Jun  1 18:10:38 2007
@@ -483,6 +483,7 @@
     ParrotIOLayer *l = layer;
     ParrotIOBuf *b;
     size_t len = 1;
+    size_t avail = 0;
 
     STRING * const s = PIO_make_io_string(interp, buf, 1);
 
@@ -495,7 +496,7 @@
 
     /* read Data from buffer */
     if (b->flags & PIO_BF_READBUF) {
-        const size_t avail = b->endb - b->next;
+        avail = b->endb - b->next;
 
         /* if we have data available, copy out the next byte */
         if (avail) {

Modified: trunk/src/io/io_mmap.c
==============================================================================
--- trunk/src/io/io_mmap.c      (original)
+++ trunk/src/io/io_mmap.c      Fri Jun  1 18:10:38 2007
@@ -25,8 +25,49 @@
 #include "parrot/parrot.h"
 #include "io_private.h"
 
-/* Defined at bottom */
-static const ParrotIOLayerAPI pio_mmap_layer_api;
+static ParrotIO *
+PIO_mmap_open(Interp *interp, ParrotIOLayer *layer,
+               const char *path, INTVAL flags);
+static size_t
+PIO_mmap_read(Interp *interp, ParrotIOLayer *layer, ParrotIO *io,
+              STRING **buf);
+static INTVAL
+PIO_mmap_close(Interp *interp, ParrotIOLayer *layer, ParrotIO *io);
+
+static const ParrotIOLayerAPI pio_mmap_layer_api = {
+    PIO_null_init,
+    PIO_base_new_layer,
+    PIO_base_delete_layer,
+    PIO_null_push_layer,
+    PIO_null_pop_layer,
+    PIO_mmap_open,
+    PIO_null_open2,
+    PIO_null_open3,
+    PIO_null_open_async,
+    PIO_null_fdopen,
+    PIO_mmap_close,
+    PIO_null_write,
+    PIO_null_write_async,
+    PIO_mmap_read,
+    PIO_null_read_async,
+    PIO_null_flush,
+    PIO_null_peek,
+    PIO_null_seek,
+    PIO_null_tell,
+    PIO_null_setbuf,
+    PIO_null_setlinebuf,
+    PIO_null_getcount,
+    PIO_null_fill,
+    PIO_null_eof,
+    0, /* no poll */
+    0, /* no socket */
+    0, /* no connect */
+    0, /* no send */
+    0, /* no recv */
+    0, /* no bind */
+    0, /* no listen */
+    0  /* no accept */
+};
 
 ParrotIOLayer pio_mmap_layer = {
     NULL,
@@ -152,41 +193,6 @@
     return ret;
 }
 
-static const ParrotIOLayerAPI pio_mmap_layer_api = {
-    PIO_null_init,
-    PIO_base_new_layer,
-    PIO_base_delete_layer,
-    PIO_null_push_layer,
-    PIO_null_pop_layer,
-    PIO_mmap_open,
-    PIO_null_open2,
-    PIO_null_open3,
-    PIO_null_open_async,
-    PIO_null_fdopen,
-    PIO_mmap_close,
-    PIO_null_write,
-    PIO_null_write_async,
-    PIO_mmap_read,
-    PIO_null_read_async,
-    PIO_null_flush,
-    PIO_null_peek,
-    PIO_null_seek,
-    PIO_null_tell,
-    PIO_null_setbuf,
-    PIO_null_setlinebuf,
-    PIO_null_getcount,
-    PIO_null_fill,
-    PIO_null_eof,
-    0, /* no poll */
-    0, /* no socket */
-    0, /* no connect */
-    0, /* no send */
-    0, /* no recv */
-    0, /* no bind */
-    0, /* no listen */
-    0  /* no accept */
-};
-
 /*
 
 =back

Modified: trunk/src/io/io_string.c
==============================================================================
--- trunk/src/io/io_string.c    (original)
+++ trunk/src/io/io_string.c    Fri Jun  1 18:10:38 2007
@@ -25,8 +25,45 @@
 #include "parrot/parrot.h"
 #include "io_private.h"
 
-/* Defined at bottom */
-static const ParrotIOLayerAPI pio_string_layer_api;
+static size_t
+PIO_string_read(Interp *interp, ParrotIOLayer *l, ParrotIO *io, STRING **buf);
+static size_t
+PIO_string_write(Interp *interp, ParrotIOLayer *l, ParrotIO *io, STRING *s);
+
+static const ParrotIOLayerAPI pio_string_layer_api = {
+    PIO_null_init,
+    PIO_base_new_layer,
+    PIO_base_delete_layer,
+    PIO_null_push_layer,
+    PIO_null_pop_layer,
+    PIO_null_open,
+    PIO_null_open2,
+    PIO_null_open3,
+    PIO_null_open_async,
+    PIO_null_fdopen,
+    PIO_null_close,
+    PIO_string_write,
+    PIO_null_write_async,
+    PIO_string_read,
+    PIO_null_read_async,
+    PIO_null_flush,
+    PIO_null_peek,
+    PIO_null_seek,
+    PIO_null_tell,
+    PIO_null_setbuf,
+    PIO_null_setlinebuf,
+    PIO_null_getcount,
+    PIO_null_fill,
+    PIO_null_eof,
+    0, /* no poll */
+    0, /* no socket */
+    0, /* no connect */
+    0, /* no send */
+    0, /* no recv */
+    0, /* no bind */
+    0, /* no listen */
+    0  /* no accept */
+};
 
 ParrotIOLayer pio_string_layer = {
     NULL,
@@ -72,41 +109,6 @@
     return string_length(interp, (STRING *)l->self);
 }
 
-static const ParrotIOLayerAPI pio_string_layer_api = {
-    PIO_null_init,
-    PIO_base_new_layer,
-    PIO_base_delete_layer,
-    PIO_null_push_layer,
-    PIO_null_pop_layer,
-    PIO_null_open,
-    PIO_null_open2,
-    PIO_null_open3,
-    PIO_null_open_async,
-    PIO_null_fdopen,
-    PIO_null_close,
-    PIO_string_write,
-    PIO_null_write_async,
-    PIO_string_read,
-    PIO_null_read_async,
-    PIO_null_flush,
-    PIO_null_peek,
-    PIO_null_seek,
-    PIO_null_tell,
-    PIO_null_setbuf,
-    PIO_null_setlinebuf,
-    PIO_null_getcount,
-    PIO_null_fill,
-    PIO_null_eof,
-    0, /* no poll */
-    0, /* no socket */
-    0, /* no connect */
-    0, /* no send */
-    0, /* no recv */
-    0, /* no bind */
-    0, /* no listen */
-    0  /* no accept */
-};
-
 /*
 
 =back

Modified: trunk/src/io/io_utf8.c
==============================================================================
--- trunk/src/io/io_utf8.c      (original)
+++ trunk/src/io/io_utf8.c      Fri Jun  1 18:10:38 2007
@@ -27,8 +27,47 @@
 #include "io_private.h"
 #include "../unicode.h"
 
-/* Defined at bottom */
-static const ParrotIOLayerAPI pio_utf8_layer_api;
+static size_t
+PIO_utf8_write(Interp *interp, ParrotIOLayer *l, ParrotIO *io, STRING *s);
+
+static size_t
+PIO_utf8_read(Interp *interp, ParrotIOLayer *layer, ParrotIO *io,
+              STRING **buf);
+
+static const ParrotIOLayerAPI pio_utf8_layer_api = {
+    PIO_null_init,
+    PIO_base_new_layer,
+    PIO_base_delete_layer,
+    PIO_null_push_layer,
+    PIO_null_pop_layer,
+    PIO_null_open,
+    PIO_null_open2,
+    PIO_null_open3,
+    PIO_null_open_async,
+    PIO_null_fdopen,
+    PIO_null_close,
+    PIO_utf8_write,
+    PIO_null_write_async,
+    PIO_utf8_read,
+    PIO_null_read_async,
+    PIO_null_flush,
+    PIO_null_peek,
+    PIO_null_seek,
+    PIO_null_tell,
+    PIO_null_setbuf,
+    PIO_null_setlinebuf,
+    PIO_null_getcount,
+    PIO_null_fill,
+    PIO_null_eof,
+    0, /* no poll */
+    0, /* no socket */
+    0, /* no connect */
+    0, /* no send */
+    0, /* no recv */
+    0, /* no bind */
+    0, /* no listen */
+    0  /* no accept */
+};
 
 ParrotIOLayer pio_utf8_layer = {
     NULL,
@@ -101,41 +140,6 @@
     return PIO_write_down(interp, l->down, io, dest);
 }
 
-static const ParrotIOLayerAPI pio_utf8_layer_api = {
-    PIO_null_init,
-    PIO_base_new_layer,
-    PIO_base_delete_layer,
-    PIO_null_push_layer,
-    PIO_null_pop_layer,
-    PIO_null_open,
-    PIO_null_open2,
-    PIO_null_open3,
-    PIO_null_open_async,
-    PIO_null_fdopen,
-    PIO_null_close,
-    PIO_utf8_write,
-    PIO_null_write_async,
-    PIO_utf8_read,
-    PIO_null_read_async,
-    PIO_null_flush,
-    PIO_null_peek,
-    PIO_null_seek,
-    PIO_null_tell,
-    PIO_null_setbuf,
-    PIO_null_setlinebuf,
-    PIO_null_getcount,
-    PIO_null_fill,
-    PIO_null_eof,
-    0, /* no poll */
-    0, /* no socket */
-    0, /* no connect */
-    0, /* no send */
-    0, /* no recv */
-    0, /* no bind */
-    0, /* no listen */
-    0  /* no accept */
-};
-
 /*
 
 =back

Modified: trunk/src/jit/i386/jit_emit.h
==============================================================================
--- trunk/src/jit/i386/jit_emit.h       (original)
+++ trunk/src/jit/i386/jit_emit.h       Fri Jun  1 18:10:38 2007
@@ -2798,7 +2798,7 @@
     else
 #  endif
     {
-        call_func(jit_info, (void (*)(void))pmc_new_noinit);
+        call_func(jit_info, (void*)pmc_new_noinit);
     }
     /* result = eax push pmc */
     emitm_pushl_r(jit_info->native_ptr, emit_EAX);

Modified: trunk/src/mmd.c
==============================================================================
--- trunk/src/mmd.c     (original)
+++ trunk/src/mmd.c     Fri Jun  1 18:10:38 2007
@@ -632,7 +632,7 @@
     new_size = sizeof (funcptr_t) * table->x * new_y;
 
     if (table->mmd_funcs)
-        table->mmd_funcs = mem_sys_realloc(table->mmd_funcs, new_size);
+        table->mmd_funcs = (funcptr_t *)mem_sys_realloc(table->mmd_funcs, 
new_size);
     else
         table->mmd_funcs = (funcptr_t *)mem_sys_allocate(new_size);
 

Modified: trunk/src/pic.c
==============================================================================
--- trunk/src/pic.c     (original)
+++ trunk/src/pic.c     Fri Jun  1 18:10:38 2007
@@ -632,7 +632,7 @@
 
 void
 parrot_pic_find_infix_v_pp(Interp *interp, PMC *left, PMC *right,
-                Parrot_MIC *mic, void **cur_opcode)
+                Parrot_MIC *mic, opcode_t *cur_opcode)
 {
     funcptr_t func;
     int is_pmc;
@@ -660,10 +660,10 @@
     func = get_mmd_dispatch_type(interp,
             mic->m.func_nr, left_type, right_type, &is_pmc);
     if (is_pmc) {
-        const size_t offs = cur_opcode - interp->code->prederef.code;
-        opcode_t* const real_op = interp->code->base.data + offs + 1;
-
-        /* set prederef code address to orig slot for now */
+        const size_t offs = cur_opcode - (opcode_t 
*)interp->code->prederef.code;
+        opcode_t* real_op = interp->code->base.data + offs + 1;
+        /* set prederef code address to orig slot for now
+         */
         ((void**)cur_opcode)[0] =
             parrot_pic_opcode(interp, PARROT_OP_infix_ic_p_p);
         /* restore 1st operand i.e. .MMD_func_nr */

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c     (original)
+++ trunk/src/pmc.c     Fri Jun  1 18:10:38 2007
@@ -402,7 +402,7 @@
 pmc_type(Interp* interp, const STRING *name)
 {
     PMC * const classname_hash = interp->class_hash;
-    const PMC * const item = (PMC *)VTABLE_get_pointer_keyed_str(interp, 
classname_hash, name);
+    PMC * item = (PMC *)VTABLE_get_pointer_keyed_str(interp, classname_hash, 
name);
 
     /* nested namespace with same name */
     if (item->vtable->base_type == enum_class_NameSpace)

Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc     (original)
+++ trunk/src/pmc/class.pmc     Fri Jun  1 18:10:38 2007
@@ -929,7 +929,7 @@
 =cut
 
 */
-    PCCMETHOD void pmc_namespace(PMC *namespace :optional, int got_name 
:opt_flag) {
+    PCCMETHOD void pmc_namespace(PMC *_namespace :optional, int got_name 
:opt_flag) {
         Parrot_Class *_class = PARROT_CLASS(SELF);
         PMC *ret_namespace = _class->_namespace;
         PCCRETURN(PMC *ret_namespace);

Modified: trunk/src/pmc/lexinfo.pmc
==============================================================================
--- trunk/src/pmc/lexinfo.pmc   (original)
+++ trunk/src/pmc/lexinfo.pmc   Fri Jun  1 18:10:38 2007
@@ -74,7 +74,7 @@
         assert(PObj_constant_TEST(SELF));
         PMC_pmc_val(SELF) = sub;
         parrot_new_pmc_hash_x(INTERP, SELF,
-            enum_hash_int,
+            (PARROT_DATA_TYPES)enum_hash_int,
             Hash_key_type_STRING,
             (hash_comp_fn)string_equal,     /* STRING compare */
             key_hash_STRING);    /*        hash */

Modified: trunk/src/pmc/namespace.pmc
==============================================================================
--- trunk/src/pmc/namespace.pmc (original)
+++ trunk/src/pmc/namespace.pmc Fri Jun  1 18:10:38 2007
@@ -52,8 +52,8 @@
 /* We store extra information about the namespace in a struct, which we will
  * hang off the PMC_data slot. */
 typedef struct Parrot_NSInfo {
-    STRING *name; /* Name of this namespace part. */
-    PMC *class;   /* The class or role attached to this namespace. */
+    STRING *name;  /* Name of this namespace part. */
+    PMC *_class;   /* The class or role attached to this namespace. */
 } Parrot_NSInfo;
 
 /* Macro for easy access to the namespcae info. */
@@ -95,8 +95,8 @@
             pobject_lives(INTERP, (PObj*)PMC_pmc_val(SELF));
         if (nsinfo->name)
             pobject_lives(INTERP, (PObj*)nsinfo->name);
-        if (nsinfo->class)
-            pobject_lives(INTERP, (PObj*)nsinfo->class);
+        if (nsinfo->_class)
+            pobject_lives(INTERP, (PObj*)nsinfo->_class);
     }
 
 /*
@@ -740,7 +740,7 @@
     PCCMETHOD void get_class()
     {
         Parrot_NSInfo *nsinfo = PARROT_NSINFO(SELF);
-        PMC *ret_class = nsinfo->class;
+        PMC *ret_class = nsinfo->_class;
         PCCRETURN(PMC *ret_class);
     }
 
@@ -757,7 +757,7 @@
     PCCMETHOD void set_class(PMC *class_or_role)
     {
         Parrot_NSInfo *nsinfo = PARROT_NSINFO(SELF);
-        nsinfo->class = class_or_role;
+        nsinfo->_class        = class_or_role;
     }
 
 }

Modified: trunk/src/pmc/parrotobject.pmc
==============================================================================
--- trunk/src/pmc/parrotobject.pmc      (original)
+++ trunk/src/pmc/parrotobject.pmc      Fri Jun  1 18:10:38 2007
@@ -521,18 +521,18 @@
 
     PMC* share_ro() {
         PMC *ret;
-        PMC *true;
+        PMC *_true;
         PMC **data;
         INTVAL i, n;
 
         if (PObj_is_PMC_shared_TEST(SELF))
             return SELF;
 
-        ret  = pt_shared_fixup(INTERP, SELF);
-        true = pmc_new(INTERP, enum_class_Integer);
+        ret   = pt_shared_fixup(INTERP, SELF);
+        _true = pmc_new(INTERP, enum_class_Integer);
 
-        VTABLE_set_integer_native(INTERP, true, 1);
-        VTABLE_setprop(INTERP, ret, CONST_STRING(interp, "_ro"), true);
+        VTABLE_set_integer_native(INTERP, _true, 1);
+        VTABLE_setprop(INTERP, ret, CONST_STRING(interp, "_ro"), _true);
         PObj_is_PMC_shared_SET(SELF);
 
         n    = PMC_int_val(ret);

Modified: trunk/src/stm/backend.c
==============================================================================
--- trunk/src/stm/backend.c     (original)
+++ trunk/src/stm/backend.c     Fri Jun  1 18:10:38 2007
@@ -47,7 +47,7 @@
 static STM_tx_log *Parrot_STM_tx_log_alloc(Interp *interp, size_t size) {
     int i;
     STM_tx_log *log;
-    log = mem_sys_allocate_zeroed(size);
+    log = (STM_tx_log *)mem_sys_allocate_zeroed(size);
 
     interp->thread_data->stm_log = (void *) log;
 
@@ -62,9 +62,9 @@
     log->inner[0].first_read = log->inner[0].first_write = 0;
 
     log->writes =
-        mem_sys_allocate(sizeof (STM_write_record) * STM_START_RECORDS);
+        (STM_write_record*)mem_sys_allocate(sizeof (STM_write_record) * 
STM_START_RECORDS);
     log->writes_alloced = STM_START_RECORDS;
-    log->reads = mem_sys_allocate(sizeof (STM_read_record) * 
STM_START_RECORDS);
+    log->reads = (STM_read_record*)mem_sys_allocate(sizeof (STM_read_record) * 
STM_START_RECORDS);
     log->reads_alloced = STM_START_RECORDS;
 
     log->last_read = log->last_write = -1;
@@ -89,7 +89,7 @@
     if (!interp->thread_data || !interp->thread_data->stm_log)
         return;
 
-    log = interp->thread_data->stm_log;
+    log = (STM_tx_log *)interp->thread_data->stm_log;
     mem_sys_free(log->writes);
     mem_sys_free(log->reads);
     Parrot_STM_waitlist_destroy_thread(interp);
@@ -99,7 +99,7 @@
 
 
 STM_tx_log *Parrot_STM_tx_log_get(Interp *interp) {
-    STM_tx_log *log = interp->thread_data->stm_log; /* FIXME */
+    STM_tx_log *log = (STM_tx_log *)interp->thread_data->stm_log; /* FIXME */
     if (!log)
         log = Parrot_STM_tx_log_alloc(interp, sizeof (STM_tx_log));
 
@@ -122,7 +122,7 @@
     STM_TRACE("Parrot_STM_alloc");
 
     make_bufferlike_pool(interp, sizeof (handle_data));
-    handle = new_bufferlike_header(interp, sizeof (handle_data));
+    handle = (handle_data *)new_bufferlike_header(interp, sizeof 
(handle_data));
     PObj_external_SET(&handle->buf);
     PObj_is_shared_SET(&handle->buf);
     PARROT_ATOMIC_PTR_INIT(handle->owner_or_version);
@@ -174,7 +174,7 @@
     int i = ++log->last_write;
     if (i >= log->writes_alloced) {
         log->writes_alloced *= 2;
-        log->writes = mem_sys_realloc(log->writes,
+        log->writes = (STM_write_record *)mem_sys_realloc(log->writes,
             sizeof (*log->writes) * log->writes_alloced);
     }
     write = get_write(interp, log, i);
@@ -187,7 +187,7 @@
     int i = ++log->last_read;
     if (i >= log->reads_alloced) {
         log->reads_alloced *= 2;
-        log->reads = mem_sys_realloc(log->reads,
+        log->reads = (STM_read_record *)mem_sys_realloc(log->reads,
             sizeof (*log->reads) * log->reads_alloced);
     }
     read = get_read(interp, log, i);
@@ -878,7 +878,7 @@
          * FIXME XXX race if other log goes away
          */
         assert(n_interpreters > 1);
-        other = version;
+        other = (STM_tx_log_sub*)version;
         assert(other < &log->inner[0] || other > 
&log->inner[STM_MAX_TX_DEPTH]);
         curlog = get_sublog(log, log->depth);
         PARROT_ATOMIC_INT_GET(other_wait_len, other->wait_length);
@@ -1242,11 +1242,11 @@
 
     cursub = get_sublog(log, log->depth);
 
-    saved = mem_sys_allocate(sizeof (*saved));
+    saved = (STM_saved_tx_log *)mem_sys_allocate(sizeof (*saved));
     saved->num_reads = log->last_read - cursub->first_read + 1;
     saved->num_writes = log->last_write - cursub->first_write + 1;
-    saved->reads = mem_sys_allocate(sizeof (*saved->reads) * saved->num_reads);
-    saved->writes =
+    saved->reads = (STM_read_record*)mem_sys_allocate(sizeof (*saved->reads) * 
saved->num_reads);
+    saved->writes = (STM_write_record*)
         mem_sys_allocate(sizeof (*saved->writes) * saved->num_writes);
     memcpy(saved->reads, &log->reads[cursub->first_read],
         sizeof (*saved->reads) * saved->num_reads);
@@ -1279,7 +1279,7 @@
     if (saved_log_data == NULL)
         return;
 
-    saved = saved_log_data;
+    saved = (STM_saved_tx_log *)saved_log_data;
 
     log = Parrot_STM_tx_log_get(interp);
 
@@ -1320,7 +1320,7 @@
     if (saved_log_data == NULL)
         return;
 
-    saved = saved_log_data;
+    saved = (STM_saved_tx_log *)saved_log_data;
 
     for (i = 0; i < saved->num_reads; ++i)
         mark_read_record(interp, &saved->reads[i]);
@@ -1343,7 +1343,7 @@
     if (saved_log_data == NULL)
         return;
 
-    saved = saved_log_data;
+    saved = (STM_saved_tx_log *)saved_log_data;
     mem_sys_free(saved->reads);
     mem_sys_free(saved->writes);
     mem_sys_free(saved);

Modified: trunk/src/stm/stm_waitlist.h
==============================================================================
--- trunk/src/stm/stm_waitlist.h        (original)
+++ trunk/src/stm/stm_waitlist.h        Fri Jun  1 18:10:38 2007
@@ -5,21 +5,21 @@
 
 #define WAITLIST_DEBUG 0
 
-struct waitlist_entry {
+typedef struct waitlist_entry {
     /* next entry in the waitlist */
     struct waitlist_entry *next;
     /* the thread that will need to be signaled to wake it up */
     struct waitlist_thread_data *thread;
     /* the head of this waitlist */
     struct waitlist_head *head;
-};
+} waitlist_entry;
 
-struct waitlist_head {
+typedef struct waitlist_head {
     Parrot_atomic_pointer first;
     Parrot_mutex remove_mutex;
-};
+} waitlist_head;
 
-struct waitlist_thread_data {
+typedef struct waitlist_thread_data {
     /* this mutex must be locked before setting signaled_p to true */
     Parrot_mutex signal_mutex;
 
@@ -40,7 +40,7 @@
 #if WAITLIST_DEBUG
     Interp *interp;
 #endif
-};
+} waitlist_thread_data;
 
 typedef struct waitlist_head STM_waitlist;
 
@@ -51,6 +51,7 @@
 void Parrot_STM_waitlist_remove_all(Parrot_Interp);
 void Parrot_STM_waitlist_wait(Parrot_Interp);
 void Parrot_STM_waitlist_destroy_thread(Parrot_Interp);
+static waitlist_thread_data * get_thread(Parrot_Interp interp);
 
 #endif /* PARROT_STM_WAITLIST_H_GUARD */
 

Reply via email to