pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] pdf-i64 macros


From: Aleksander Morgado
Subject: Re: [pdf-devel] pdf-i64 macros
Date: Wed, 25 Jun 2008 00:11:33 +0200
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Yep, due to the error report they are not fully compatible (the macros don't return a pdf_status_t as the functions do).

What about forgetting the errors in the 64bit module and set all functions returning void?

Errors can happens in the pdf-64t code, so we definitely dont want to
ignore the error conditions.

Maybe we could use one of the values of the 64bit integers (such as
the larger one) and to recognize an error condition when that special
value is found in a result.

So:

   pdf_i64_add(&bignum1, bignum2, bignum3);
   if (pdf_i64_invalid_p(bignum1))
   {
    /* An error occurred */
   }


As talked in the irc, could be better to pass a reference to the status variable to the function so that it can safely return void:

void
pdf_i64_sum(pdf_i64_t *result,
            pdf_i64_t num1,
            pdf_i64_t num2,
            pdf_status_t *p_status)

In this way, the macros will directly place PDF_OK in *p_status.

Then we can check the status value to see if the operation went ok or not.




reply via email to

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