[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pdf-devel] pdf-i64 macros
From: |
Daniel Vidal |
Subject: |
[pdf-devel] pdf-i64 macros |
Date: |
Tue, 24 Jun 2008 14:04:30 +0200 |
Hi All,
Finally did something about the macros regarding systems that have 64
bit support. To be honest I don't like much the result. In the sense
that macros can be helpful sometimes, but also terribly messy and
tricky (e.g. not so fantastic regarding error support). In this case,
I think it doesn't really solve the issue of transparent 64 bit
support for the client regarding the pdf_i64 functions. If the pdf_i64
functions aren't going to be used much through out the code (e.g. time
module), I find it better to go back to the original suggestion by
jemarch and make the support directly on the code using the functions.
e.g.:
#ifdef int64_t
#define PDF_USE_BUILTIN_64BIT_SUPPORT
#endif
pdf_i64_t dest;
int addend_1 = 1;
int addend_2 = 2;
#ifndef PDF_USE_BUILTIN_64BIT_SUPPORT
pdf_i64_add(&dest, addend_1, addend_2);
#else
dest = addend_1 + addend_2;
#endif
Anyhow, I've committed the sources (pdf-types.c , pdf-types.h) with
the new macros and their associated test files. From my side,
everything compiles and works with and without macros. If we change
our minds regarding this issue, we can always go back to previous
versions of the sources.
Files changed, added and committed:
src/base/pdf-types.c
src/base/pdf-types.h
torture/unit/Makefile.am
torture/unit/base/types/pdf-i64-add.c
torture/unit/base/types/pdf-i64-assign-quick.c
torture/unit/base/types/pdf-i64-assign.c
torture/unit/base/types/pdf-i64-copy.c
torture/unit/base/types/pdf-i64-new.c
torture/unit/base/types/tsuite-types.c
torture/unit/base/types/pdf-i64-abs.c
torture/unit/base/types/pdf-i64-cmp.c
torture/unit/base/types/pdf-i64-neg.c
cheers
Dan
- [pdf-devel] pdf-i64 macros,
Daniel Vidal <=
- Re: [pdf-devel] pdf-i64 macros, Aleksander Morgado, 2008/06/24
- Re: [pdf-devel] pdf-i64 macros, jemarch, 2008/06/24
- Re: [pdf-devel] pdf-i64 macros, Aleksander Morgado, 2008/06/24
- Re: [pdf-devel] pdf-i64 macros, jemarch, 2008/06/24
- Re: [pdf-devel] pdf-i64 macros, Aleksander Morgado, 2008/06/24
- Re: [pdf-devel] pdf-i64 macros, Daniel Vidal, 2008/06/25
- Re: [pdf-devel] pdf-i64 macros, Aleksander Morgado, 2008/06/25
Re: [pdf-devel] pdf-i64 macros, Aleksander Morgado, 2008/06/24