From: Nicholas Clark Date: Wed, 6 Apr 2005 15:05:32 +0000 (+0000) Subject: Casting to/from (void *) sufficient to make a C++ compiler happy. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f77bfdb1ccc695676a1e8260398001deb0b18cf;p=p5sagit%2Fp5-mst-13.2.git Casting to/from (void *) sufficient to make a C++ compiler happy. p4raw-id: //depot/perl@24175 --- diff --git a/ext/File/Glob/bsd_glob.c b/ext/File/Glob/bsd_glob.c index c01e75a..31d3aa4 100644 --- a/ext/File/Glob/bsd_glob.c +++ b/ext/File/Glob/bsd_glob.c @@ -1141,7 +1141,7 @@ g_opendir(register Char *str, glob_t *pglob) } if (pglob->gl_flags & GLOB_ALTDIRFUNC) - return((*pglob->gl_opendir)(buf)); + return((DIR*)(*pglob->gl_opendir)(buf)); return(PerlDir_open(buf)); } diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs index f922242..1ac3dce 100644 --- a/ext/threads/shared/shared.xs +++ b/ext/threads/shared/shared.xs @@ -304,7 +304,7 @@ Perl_sharedsv_associate(pTHX_ SV **psv, SV *ssv, shared_sv *data) ssv = newSV(0); SvREFCNT(ssv) = 0; } - data = PerlMemShared_malloc(sizeof(shared_sv)); + data = (shared_sv *) PerlMemShared_malloc(sizeof(shared_sv)); Zero(data,1,shared_sv); SHAREDSvPTR(data) = ssv; /* Tag shared side SV with data pointer */ diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 00ef0aa..693c922 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -388,7 +388,7 @@ Perl_ithread_create(pTHX_ SV *obj, char* classname, SV* init_function, SV* param MUTEX_LOCK(&create_destruct_mutex); - thread = PerlMemShared_malloc(sizeof(ithread)); + thread = (ithread *) PerlMemShared_malloc(sizeof(ithread)); if (!thread) { MUTEX_UNLOCK(&create_destruct_mutex); PerlLIO_write(PerlIO_fileno(Perl_error_log), @@ -760,7 +760,7 @@ BOOT: MUTEX_INIT(&create_destruct_mutex); MUTEX_LOCK(&create_destruct_mutex); PL_threadhook = &Perl_ithread_hook; - thread = PerlMemShared_malloc(sizeof(ithread)); + thread = (ithread *) PerlMemShared_malloc(sizeof(ithread)); if (!thread) { PerlLIO_write(PerlIO_fileno(Perl_error_log), PL_no_mem, strlen(PL_no_mem)); diff --git a/pad.h b/pad.h index e839042..daaa509 100644 --- a/pad.h +++ b/pad.h @@ -256,7 +256,7 @@ Clone the state variables associated with running and compiling pads. * sub's CV or padlist. */ #define PAD_CLONE_VARS(proto_perl, param) \ - PL_comppad = ptr_table_fetch(PL_ptr_table, proto_perl->Icomppad); \ + PL_comppad = (AV *) ptr_table_fetch(PL_ptr_table, proto_perl->Icomppad); \ PL_curpad = PL_comppad ? AvARRAY(PL_comppad) : Null(SV**); \ PL_comppad_name = av_dup(proto_perl->Icomppad_name, param); \ PL_comppad_name_fill = proto_perl->Icomppad_name_fill; \ diff --git a/sv.c b/sv.c index df7e7fa..d5528b1 100644 --- a/sv.c +++ b/sv.c @@ -11030,7 +11030,7 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param) if (CvCONST(sstr)) { CvXSUBANY(dstr).any_ptr = GvUNIQUE(CvGV(sstr)) ? SvREFCNT_inc(CvXSUBANY(sstr).any_ptr) : - sv_dup_inc(CvXSUBANY(sstr).any_ptr, param); + sv_dup_inc((SV *)CvXSUBANY(sstr).any_ptr, param); } /* don't dup if copying back - CvGV isn't refcounted, so the * duped GV may never be freed. A bit of a hack! DAPM */