> > > Hi, > thanks for the patch. I applied it as [r2047]. >
Actually that patch is not correct. Here we want to reinterpret bits but static_cast here will perform modulo 2^N arithmetics (which is coincidentally the "same" thing on two's complement architectures). But for example on one's complement architecture value -1 in a 16 bit big endian is stored as "11111110 11111111" which is interpreted as -256 which when converted to unsigned short will give 65280 in binary "11111111 00000000" after swapping bytes "00000000 11111111" which is 255 as either signed and unsigned short. So -1 would be read as 255 (if I did not make some mistake). Actually podofo would not work on one's complement architecture even if this part was done correctly because I suppose font file format has defined that negative numbers are stored as two's complement so it would need to perform additional conversions (in other case value -1 would be read as "-0"). Proposed quick patch using reinterpred_cast attached. Bye, > zyx > > [r2047] http://sourceforge.net/p/podofo/code/2047 > > > _______________________________________________ > Podofo-users mailing list > Podofo-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/podofo-users >
patch.diff
Description: Binary data
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users