On Wed, 23 Jan 2019 at 15:39, zyx <z...@gmx.us> wrote:
>
> I gave you a counter-example, where the committed change will break
> things (when the Unknown would be changed to -1 instead). For the
> consistency, the None is set to -1, the (other) Unknown-s to 0xff. Why
> not make them consistent in a way to declare Unknown/None as the first
> value of the enum with the value -1? Would that work for you? If not,
> why not? I kind of miss what you are aiming for. Is it anything else
> than having all Unknown being 0xff, which can eventually cause waste of
> memory in combination with -fshort-enums (while the switch is
> potentially dangerous, it can be useful for someone whom bundles PoDoFo
> into his/her own project and doesn't expose it into the public)?
>
>

All you say makes sense but I'm gasping on inconsistencies all around
the library and I genuinely tried to follow the most used convention
by putting Unknown on 0xff. Actually, I follow this personal "golden
rule" for *my* enums:

0       : UNKNOWN or a enumeration value with a semantic that make
           sense in a default initialization (both fit very well with zero
           initialization)
1...x  : Actual values of the enumeration to be specified voluntarily
-1      : NONE or ANY: values with special meaning to be specified voluntarily

Of course I am not pushing such change because it would require review of all
the enums in the library.

For EPdfDataType particular case I would also be fine to have Unknown = -1
but I didn't do it this way as said because I tried to follow what is done in
other enums.


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

Reply via email to