On Mon, Mar 14, 2022 at 8:01 AM zyx <[email protected]> wrote:
> On Sat, 2022-03-12 at 19:15 +0100, Michal Sudolsky wrote:
> > How did you apply that patch?
>
> Hi,
> I applied it as always, `patch -p1 <file.patch`.
>
> > There are two places where this change can happen...
>
> Aha, I see, the `patch` applied too early:
>
> patching file doc/PdfFontTTFSubset.cpp
> Hunk #1 succeeded at 65 with fuzz 2 (offset -5 lines).
>
> I did not pay any attention to the offset, because it's quote common
> that long standing patches do not apply cleanly. I also did not expect
> this could apply on two places.
>
Maybe another reason to dislike duplications ;)
> Though the current sources have:
>
> inline short Big2Little(short big)
> {
> return Big2Little(static_cast<unsigned short>(big));
> }
>
> which is different from the patch (and which explains why the `patch`
> applied it with the offset).
>
> Is the undefined behavior fixed with the current trunk?
>
Technically before the first patch there was UB (until C++20) but probably
all major compilers will do the right thing (it may be even documented but
maybe not). First patch (current trunk) may not communicate the right
intention (until C++20, but major compilers may document that it is right)
and the second patch tries to solve that but may have its own problems (in
any C++) and union may be better (not by C++ but better guarantees by major
compilers). Probably the best is as it is now.
> Bye,
> zyx
>
>
> _______________________________________________
> Podofo-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/podofo-users
>
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users