Robin Barker wrote:
> FPTR2DPTR in perl.h is defined as (t)PTR2UV(p)
> if UVSIZE > PTRSIZE this gives a compiler warning.
> 
> We could use INT2PTR(t,PTR2UV(p)) but this could
> expand to 
>       (t)(unsigned long)(UV)(unsigned long)(p)
> which is a bit unnecessary.
> 
> What is needed is an unsigned integer the same size 
> as a pointer.  We already have this (PTRV)! 
> 
> Robin 
> 
> --- /perl-current/perl.h
> +++ perl.h      Mon Jun 20 13:35:08 2005

Thanks, applied as #24915 to bleadperl

> @@ -1514,8 +1514,8 @@
>   * The only feasible use is probably temporarily storing
>   * function pointers in a data pointer (such as a void pointer). */
>  
> -#define DPTR2FPTR(t,p) ((t)PTR2UV(p)) /* data pointer to function pointer */
> -#define FPTR2DPTR(t,p) ((t)PTR2UV(p)) /* function pointer to data pointer */
> +#define DPTR2FPTR(t,p) ((t)(PTRV)(p)) /* data pointer to function pointer */
> +#define FPTR2DPTR(t,p) ((t)(PTRV)(p)) /* function pointer to data pointer */

Reply via email to