# New Ticket Created by Steve Peters # Please include the string: [perl #44729] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44729 >
The attached patch cleans up some problems with C++ compiling currently with Parrot. Steve Peters [EMAIL PROTECTED]
Index: src/gc/smallobject.c =================================================================== --- src/gc/smallobject.c (revision 20650) +++ src/gc/smallobject.c (working copy) @@ -202,24 +202,24 @@ NOTNULL(Small_Object_Arena *arena)) { UINTVAL i; - void *object; + PObj *object; UINTVAL num_objects = pool->objects_per_alloc; pool->total_objects += num_objects; arena->used = num_objects; /* Move all the new objects into the free list */ - object = (PObj *)((char *)arena->start_objects); + object = ((PObj *)arena->start_objects); for (i = 0; i < num_objects; i++) { - PObj_flags_SETTO((PObj *)object, PObj_on_free_list_FLAG); + PObj_flags_SETTO(object, PObj_on_free_list_FLAG); /* * during GC buflen is used to check for objects on the * free_list */ PObj_buflen((PObj*)object) = 0; pool->add_free_object(interp, pool, object); - object = (PObj *)((char *)object + pool->object_size); + object = ((PObj *)object + pool->object_size); } pool->num_free_objects += num_objects; Index: src/gc/register.c =================================================================== --- src/gc/register.c (revision 20650) +++ src/gc/register.c (working copy) @@ -298,7 +298,7 @@ CONTEXT(interp->ctx) = ctx; ctx->regs_mem_size = reg_alloc; - ctx->n_regs_used = mem_sys_allocate(sizeof (INTVAL) * 4); + ctx->n_regs_used = (INTVAL *)mem_sys_allocate(sizeof (INTVAL) * 4); ctx->n_regs_used[REGNO_INT] = old->n_regs_used[REGNO_INT]; ctx->n_regs_used[REGNO_NUM] = old->n_regs_used[REGNO_NUM]; ctx->n_regs_used[REGNO_STR] = old->n_regs_used[REGNO_STR]; @@ -395,7 +395,7 @@ const int slot = CALCULATE_SLOT_NUM(reg_alloc); /* this gets attached to the context, which should free it */ - INTVAL *n_regs_used = mem_sys_allocate(sizeof (INTVAL) * 4); + INTVAL *n_regs_used = (INTVAL *)mem_sys_allocate(sizeof (INTVAL) * 4); n_regs_used[REGNO_INT] = number_regs_used[REGNO_INT]; n_regs_used[REGNO_NUM] = number_regs_used[REGNO_NUM]; n_regs_used[REGNO_STR] = number_regs_used[REGNO_STR]; Index: src/list.c =================================================================== --- src/list.c (revision 20650) +++ src/list.c (working copy) @@ -1278,7 +1278,8 @@ multi_key = VTABLE_get_pmc_keyed_int(interp, init, val); break; case 2: - type = VTABLE_get_integer_keyed_int(interp, init, val); + type = + (PARROT_DATA_TYPE) VTABLE_get_integer_keyed_int(interp, init, val); break; case 3: item_size = VTABLE_get_integer_keyed_int(interp, init, val); Index: src/packfile.c =================================================================== --- src/packfile.c (revision 20650) +++ src/packfile.c (working copy) @@ -724,7 +724,7 @@ else if (header->uuid_type == 1) { /* Read in the UUID. We'll put it in a NULL-terminated string, just in * case pepole use it that way. */ - header->uuid_data = mem_sys_allocate(header->uuid_size + 1); + header->uuid_data = (unsigned char *)mem_sys_allocate(header->uuid_size + 1); memcpy(header->uuid_data, packed + PACKFILE_HEADER_BYTES, header->uuid_size); header->uuid_data[header->uuid_size] = 0; /* NULL terminate */ Index: src/spf_render.c =================================================================== --- src/spf_render.c (revision 20650) +++ src/spf_render.c (working copy) @@ -311,7 +311,7 @@ HUGEINTVAL sharedint = 0; /* Storage for flags, etc. */ - SpfInfo info = { 0, 0, 0, 0, 0 }; + SpfInfo info = { 0, 0, 0, 0, (PHASE)0 }; /* Reset temporaries */ tc[0] = '\0'; Index: include/parrot/dod.h =================================================================== --- include/parrot/dod.h (revision 20650) +++ include/parrot/dod.h (working copy) @@ -136,7 +136,7 @@ void parrot_gc_gms_wb( PARROT_INTERP, NOTNULL(PMC *agg), NOTNULL(void *old), - NOTNULL(void *new) ) + NOTNULL(void *_new) ) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3) @@ -146,7 +146,7 @@ NOTNULL(PMC *agg), NOTNULL(void *old), NOTNULL(void *old_key), - NOTNULL(void *new), + NOTNULL(void *_new), NOTNULL(void *new_key) ) __attribute__nonnull__(1) __attribute__nonnull__(2)