From f39efbfaef55d5a320eec6763aff5f496a8355e9 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 24 Oct 2011 10:15:37 +1100 Subject: [PATCH] fix g++ build breakage introduced in 03d9f026ae25 C++ requires a cast to convert from void * to other types. --- ext/arybase/arybase.xs | 6 +++--- ext/arybase/ptable.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/arybase/arybase.xs b/ext/arybase/arybase.xs index 3151d31..b5d007b 100644 --- a/ext/arybase/arybase.xs +++ b/ext/arybase/arybase.xs @@ -28,7 +28,7 @@ STATIC const ab_op_info *ab_map_fetch(const OP *o, ab_op_info *oi) { MUTEX_LOCK(&ab_op_map_mutex); #endif - val = ptable_fetch(ab_op_map, o); + val = (ab_op_info *)ptable_fetch(ab_op_map, o); if (val) { *oi = *val; val = oi; @@ -48,8 +48,8 @@ STATIC const ab_op_info *ab_map_store_locked( ab_map_store_locked(aPTBLMS_ (O), (PP), (B)) ab_op_info *oi; - if (!(oi = ptable_fetch(ab_op_map, o))) { - oi = PerlMemShared_malloc(sizeof *oi); + if (!(oi = (ab_op_info *)ptable_fetch(ab_op_map, o))) { + oi = (ab_op_info *)PerlMemShared_malloc(sizeof *oi); ptable_map_store(ab_op_map, o, oi); } diff --git a/ext/arybase/ptable.h b/ext/arybase/ptable.h index e492e2f..de6d816 100644 --- a/ext/arybase/ptable.h +++ b/ext/arybase/ptable.h @@ -75,10 +75,10 @@ typedef struct ptable { #ifndef ptable_new STATIC ptable *ptable_new(pPTBLMS) { #define ptable_new() ptable_new(aPTBLMS) - ptable *t = PerlMemShared_malloc(sizeof *t); + ptable *t = (ptable *)PerlMemShared_malloc(sizeof *t); t->max = 63; t->items = 0; - t->ary = PerlMemShared_calloc(t->max + 1, sizeof *t->ary); + t->ary = (ptable_ent **)PerlMemShared_calloc(t->max + 1, sizeof *t->ary); return t; } #endif /* !ptable_new */ @@ -121,7 +121,7 @@ STATIC void ptable_split(pPTBLMS_ ptable * const t) { UV newsize = oldsize * 2; UV i; - ary = PerlMemShared_realloc(ary, newsize * sizeof(*ary)); + ary = (ptable_ent **)PerlMemShared_realloc(ary, newsize * sizeof(*ary)); Zero(&ary[oldsize], newsize - oldsize, sizeof(*ary)); t->max = --newsize; t->ary = ary; @@ -153,7 +153,7 @@ STATIC void PTABLE_PREFIX(_store)(pPTBL_ ptable * const t, const void * const ke ent->val = val; } else if (val) { const UV i = PTABLE_HASH(key) & t->max; - ent = PerlMemShared_malloc(sizeof *ent); + ent = (ptable_ent *)PerlMemShared_malloc(sizeof *ent); ent->key = key; ent->val = val; ent->next = t->ary[i]; -- 2.7.4