Add UINTPTR type into parrot. #378

Closed
bacek opened this Issue Nov 18, 2010 · 2 comments

3 participants

@bacek
Parrot Virtual Machine member

Hello.

For bit manipulations on pointers we do need integral type to hold it. In C99 it's declared as uintval_t. Unfortunately we have to support C89 which doesn't have such declaration. Solution is to provide own define.

Example of usage is in parrot/parrot.h:

 * NOTE!  UINTVAL is incorrect below.  It should be UINTPTR or something like
 * that. The equivalent of C99's uintptr_t- a non-pointer data type that can
 * hold a pointer.
 */
#define D2FPTR(x) UINTVAL2PTR(funcptr_t, PTR2UINTVAL(x))
#define F2DPTR(x) UINTVAL2PTR(void *, PTR2UINTVAL((funcptr_t) (x)))

Originally http://trac.parrot.org/parrot/ticket/1855

@gerdr

my cleanup branch (pull request #704) makes ptrcast_t the Parrot-specific equivalent of uintptr_t

@gerdr gerdr added a commit to gerdr/parrot that referenced this issue Mar 18, 2012
@gerdr gerdr Add temporary fix for issue #378 ecaac1a
@gerdr gerdr added a commit to gerdr/parrot that referenced this issue May 13, 2012
@gerdr gerdr Fix issue #378
There probably are more pointer to integer conversions which need to be fixed.
4baeaff
@zhuomingliang
Parrot Virtual Machine member

Pull Request #704 has been merged, close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment