tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: prop_number(3) and portability of externalized plists

On Oct 23, 2009, at 10:49 AM, Jonathan A. Kollasch wrote:

> Hi,
> I'm bothered by the unconventional (for a Apple plists anyway) encoding
> of unsigned integers in externalized proplib(3) plists.
> At least Python's plistlib is unequiped to handle internalizing and
> reexternalizing such numbers in base-16.

I am OK with changing to outputting base-10 always, but I would like to keep 
the ability to internalize base-16.  I am also OK just treating the number as 
int64_t (and thus outputting -ve numbers beyond INT64_MAX).

> Is there a reason we absolutely need to have this
> contrary-to-comment-in-Apple's-DTD encoding?
> It seems to me that the unsigned attribute does not need to be
> exposed outside of proplib.  When proplib internalizes a number
> beyond INT64_MAX it can mark it as unsigned, and thus then later
> externalize it as the same base-10 number.  The only difference I
> can see such a change making is prop_number_unsigned(3) would
> only claim a number beyond INT64_MAX was unsigned, but this
> does not seem like it would be relied upon in existing code.
>       Jonathan Kollasch

-- thorpej

Home | Main Index | Thread Index | Old Index