pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] From pdf_i64_t to pdf_i32_t?


From: Cirilo Bernardo
Subject: Re: [pdf-devel] From pdf_i64_t to pdf_i32_t?
Date: Sun, 15 Jun 2008 09:13:24 +1000

On Sun, Jun 15, 2008 at 4:44 AM, Aleksander Morgado
<address@hidden> wrote:
> Which would be the cleanest way of converting a pdf_i64_t into a pdf_i32_t?
>
> We may need new functions in the bignum implementation to maintain the
> pdf_i64_t as a blackbox.
>
> What do you all think?
>
The cleanest way is to use a mask to retrieve the least significant 4
bytes.  However, the upper 32 bits MUST be all zero (positive 32-bit
value) or all 1 (negative) - otherwise the conversion must fail.

What problems do you encounter with the pdf_i64_t implementation?
Compilers often do all the maths; you just have to choose the keyword
that means "this is a 64-bit int regardless of the CPU").  I think it
is C99 which specifies the keywords for those types, but even in 2005
I found it very unportable, so I suspect the "best" way involves a lot
of #ifdef/#ifndef directives.

- Cirilo




reply via email to

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