[sane-devel] maximum image size for a scan for Canon pixma backend

m. allan noah kitno455 at gmail.com
Mon Jan 3 12:43:25 UTC 2011


I'm not sure these new types will work on all platforms sane builds
on. Of course, we've also not heard from any AIX or IRIX users in
years, so I'm not sure how much of a problem that really is :)

allan

On Sun, Jan 2, 2011 at 2:46 PM, Eddy De Greef <eddy_de_greef at scarlet.be> wrote:
> On 01-01-11 00:49, Gernot Hassenpflug wrote:
>>
>> I had a report that %lu might be better than %llu for the debug
>> statements, so I would like to confirm that %llu was not a typing
>> error? Should I use %llu or %lu for the debug statements when uint64_t
>> is the declared type?
>
> Hi Gernot,
>
> on a 32-bit platform, uint64_t is a "long long unsigned int" and therefore,
> %llu should be used in printf. On a 64-bit platform, however, uint64_t is
> (usually) a "long unsigned int", requiring %lu as format specifier.
>
> These fixed-size types are part of the C99 standard, and to solve the
> ambiguity problem, they have also introduced some portable printf format
> macros in inttypes.h. The one that you need here is PRIu64, i.e. something
> like
>
>  PDBG(pixma_dbg(4, "*calc_raw_width***** width %lu extended by %lu and
> rounded to %u *****\n", param->w, param->xs, raw_width));
>
> should be written as
>
>  PDBG(pixma_dbg(4, "*calc_raw_width***** width "PRIu64" extended by "PRIu64"
> and rounded to %u *****\n", param->w, param->xs, raw_width));
>
> in order to be fully portable (provided that the compiler supports C99).
> You'll also have to include <inttypes.h>, obviously (e.g. in pixma.h):
>
> #ifdef HAVE_INTTYPES_H
> # include <inttypes.h>          /* available in ISO C99 */
> #endif /* HAVE_INTTYPES_H */
>
> Best regards,
> Eddy
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>            to sane-devel-request at lists.alioth.debian.org
>



-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list