On Mon, 2019-01-14 at 23:08 +0100, Francesco Pretto wrote:
> Fixes warnings in linux since the maximum value of EPdfDataType is
> 255

        Hi,
I do not see that warning, and the maximum value of EPdfDataType is 10,
not 255 (11 values in the enum, 0 .. 10 inclusive). Maybe it's shown in
combination with other compiler options?

I do not like mabri's change [2] to pdf_uint8 personally. Enums can
have negative numbers, like the ePdfFilter_None is, thus if anyone ever
considers changing ePdfDataType_Unknown the same way, which would make
sense, then the switch to unsigned integer breaks the code.

On Tue, 2019-01-22 at 23:16 +0100, Francesco Pretto wrote:
> I think having enum as instance member is a
> non issue when using gcc and clang unless one is using "
> -fshort-enums" [1]. Only switching to C++11 type safe enums can
> enforce size of enums in the standard. Personally, I don't like the
> choice of using fixed size integers instead of enums when the problem
> of predicable ABI is completely ignored everywhere else in the
> library.

I'm not sure if you followed the whole history behind the change. As
mabri said, the main aim is a reduction of memory usage for an object
which is instantiated a lot of times (the other objects with enums are
not created that many times as the PdfVariant). The initial change was
to make the enum smaller by the compiler when certain C++ standard had
been used. That led to issues when the library had been compiled with
it on, but the library user had it off (used older C++ standard for
compilation), or vice versa. Usage of -fshort-enums has the same
effect, both the library builder and the library user should use it or
not, not only one of them. If I understand it correctly.
        Bye,
        zyx

P.S.: it would be nice to keep conversation on specific patch proposal,
not on random mail, where only its subject is changed, but the
threading is all wrong

[2] http://sourceforge.net/p/podofo/code/1959



_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to