[XviD-devel] ptr_t signed?

Edouard Gomez ed.gomez at free.fr
Wed Mar 5 20:27:02 CET 2003


Christoph Lampert (chl at math.uni-bonn.de) wrote:
> Hi, 
> 
> is there any reason why ptr_t type was chosen _unsigned_.  I wanted to use
> is as memory offset and loop counter, so signed type would suit me better. 
> (Loops running backwards with check for >= are not possible otherwise).
> 
> C99 has two types: intptr_t is signed, uintptr_t is unsigned, we could
> also introduce those to make it clearer.

There is a reason:

ptr_t was introduced to be an integer representation of a pointer. As a
pointer is nothing more than an address, the unsigned type seemed
logical.

Btw memory offsets in XviD are rather small (the actual maximum is an
offset image of 2048x2048 bytes, thus this can be casted to natural int
without much trouble... as long as it is used as an offset and not
converted back to ptr_t)

-- 
Edouard Gomez-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://edu.bnhof.de/pipermail/xvid-devel/attachments/20030305/bcc1f3e3/attachment.bin


More information about the XviD-devel mailing list