[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] Use of ILNativeUInt vs. unsigned long in pointer c

From: Peter Colson
Subject: Re: [Pnet-developers] Use of ILNativeUInt vs. unsigned long in pointer casting and manipulation
Date: Fri, 24 Sep 2004 11:40:34 +1000

On 23/09/2004, at 7:57 AM, Rhys Weatherley wrote:

On Wednesday 22 September 2004 03:35 pm, Peter Colson wrote:

In include/il_types.h, though, the various IL_TypeFrom/To macros use
unsigned long as the intermediate type. This resolves to a 4 byte
entity in my environment, so an obvious problem here.

Probably a bug that we haven't noticed till now.  Easy to fix.

Yep. Fixed it here too.

When I look through the code I see other instances of, say,
ILType_FromElement being used on a 'value' var that is returned as an
unsigned long from ILMetaUncompressData().

ILType_FromElement takes an integer value and converts it into a pointer. It doesn't really matter what integer type is used as long as it is at least 32-bits. This one is probably the more correct of those macros. An explicit
cast to ILNativeUInt may be warranted to get around dingbat compilers.

OK. I just want to understand how the resultant pointer can be used as a
real 'type' pointer in an environment that uses 8 byte pointers, if it's sourced
from a 32 bit integral?

Peter Colson.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]