[Libreoffice] [PATCH] Removed dependencies on tools/solar.h
nthiebaud at gmail.com
Mon Jan 3 23:57:20 PST 2011
On Mon, Jan 3, 2011 at 10:36 PM, Kohei Yoshida <kyoshida at novell.com> wrote:
> On Mon, 2011-01-03 at 21:47 +0100, Soeren Moeller wrote:
>> I have removed dependencies on tools/solar.h in some files in sc
>> (according to http://wiki.documentfoundation.org/Easy_Hacks#write_tools.2F_pieces_out
>> ) please review and commit.
> Thanks, pushed!
> BTW, we generally prefer the standard bool over sal_Bool, so I replaced
> sal_Bool with bool in your patch. The only place we need to use
> sal_Bool is when dealing with the UNO API. Other than that, the
> standard boolean type is preferred.
> Also, it's a bit weird to use sal_uIntPtr which isn't used much in our
> code base. So I replaced that with sal_uInt32.
I have not read the related code, but in principle uintptr_t and
int32_t are not interchangeable.
int32_t is 32 bit long, uintptr_t is supposed to be the same size
than void* (that is 32 or 64 bits)
in our sources,
ULONG is typedef'ed as sal_uIntPrt (in tools/solar.h) , which is wrong (*)
but that explain why Soeren used sal_uIntPtr.
(*) it is wrong because there are multiple model of 64 bits support.
Notoriously, Microsoft, as usual, instead of fixing their 64 bits
support bugs, have, once again, turn their bugs into a standard and
use the so-called LLP64 model, in which sizeof(long) != sizeof(void*)
Note that ULONG is defined at multiple place, most of them as unsigned
long (which conflict with the main definition of ULONG = sal_uIntPtr).
Which raise the following question: has anyone successfully built
LibreOffice for Win64 ?
C99 has been a standard for quite a while now. why are we not using
the standardized type for these. that is:
int8_t uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t,
uint64_t, intptr_t, uintptr_t,...
Yes, I know, Microsoft still do not have a compiler compliant with the
C-standard published 10 years ago... but that can be worked around
with a compat.h header to hide Microsoft's screw-ups, without
'uglyfying' the rest of the code.
> Kohei Yoshida, LibreOffice hacker, Calc
> <kyoshida at novell.com>
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
More information about the LibreOffice