pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] Assigning a 64-bit value to pdf_i64_t


From: Aleksander Morgado
Subject: Re: [pdf-devel] Assigning a 64-bit value to pdf_i64_t
Date: Sun, 22 Feb 2009 22:42:32 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Hi there,

> 
>    We have a function that can be used to initialize a pdf_i64_t with a 
>    pdf_i32_t:
> 
>    void
>    pdf_i64_assign_quick (pdf_i64_t *bignum,
>                           const pdf_i32_t value,
>                           pdf_status_t *p_status);
> 
>    But, what if I am in a OS with built-in 64-bit support (like I guess we 
>    all are) and I want to assign a 64-bit value (coming from system 
>    functions for example) into a pdf_i64_t?
> 
>    Well, we can also use `pdf_i64_assign_quick' for that, as in those types 
>    of OS that function will just be a macro, which doesn't take care of 
>    type sizes. Note that we can't use "=" for that, as it would break our 
>    built-in 64-bit support.
> 
>    But, I don't think it's clear from the API document point of view, as it 
>    seems that only 32-bit integers are allowed. How can we explain this in 
>    the document? Just with a note saying... "hey, you can also use a 64-bit 
>    value in this function instead of a pdf_i32_t"... or what?
> 
> I just added a note about this to the documentation of
> 'pdf_i64_assign_quick', but it still may be confusing.

What does the note say?

> 
> Maybe the use of those macros was not a good idea after all. The most
> I think about it the most I am sure we should let the user to check
> for the availability of 64bit numbers and then explicitly use the
> scalar type or the bignums implementation...
> 

So you think it's better to use #ifdefs all over the code? At the end,
if you must do it for both system-scalar and our builtin-bignums, then
why not just leave those macros and use only the macros for both directly?





reply via email to

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