fix g++ build breakage introduced in 03d9f026ae25
authorTony Cook <tony@develop-help.com>
Sun, 23 Oct 2011 23:15:37 +0000 (10:15 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 23 Oct 2011 23:15:37 +0000 (10:15 +1100)
C++ requires a cast to convert from void * to other types.

ext/arybase/arybase.xs
ext/arybase/ptable.h

index 3151d31..b5d007b 100644 (file)
@@ -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);
  }
 
index e492e2f..de6d816 100644 (file)
@@ -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];