Subject: Re: PATCH: psiconv on Mac (was: Psiconv compilation)
From: Hubert Figuiere (hfiguiere@teaser.fr)
Date: Sat Jan 20 2001 - 07:00:16 CST
At 13:32 +0100 20/01/01, Frodo Looijaard wrote:
>Hubert Figuiere wrote:
>>
>> At 11:23 +0100 20/01/01, Hubert Figuiere wrote:
>>
>> >Lines 266-267 are
>> > if
>> >(decode_byte(lev+3,off+len+datanr,*result,&pixelnr,temp,bits_per_pixel,
>> > linelen,&linepos,picsize)) {
>> >
>> >decodebyte take a int * as a last parameter while picsize is
>> >declared as psiconv_u32.
>> >
>> >Basically, this is a type problem, and since there is no guarantee
>> >that 'int' be a 32-bits value (it is in the present case, ie PowerPC
>> >code, but in 68k it may not be), I think that this should be
>> >avoided. What shall I do (instead of a mad wild typecase) ?
>>
>> I messed up. It is not picsize but pixelnr. But the problem is
>>still the same.
>
>Ah. That's exactly the kind of problem that only turns up when you compile
>on an entirely different architecture. I have attached a small patch
>that fixes this; but you may encounter more of these problems. I tried to
>keep it as type-clean as possible, but without a rigorous test like yours,
>it is very difficult to catch all cases.
I changed the function prototype and it works. :-)
I commit parse_image.c to abiword CVS
/cvsroot/psiconv/psiconv/parse_image.c,v <-- parse_image.c
new revision: 1.2; previous revision: 1.1
BTW, in abiword, in the ie_exp_Psion.cpp, you make use of index()
function, that I can't find the CodeWarrior C Library that I have to
use on MacOS. Since it is a function that is not in ANSI C, why not
using strstr () that does the same ?
Hub
This archive was generated by hypermail 2b25 : Sat Jan 20 2001 - 06:57:21 CST