[HarfBuzz] enum issue

Behdad Esfahbod behdad at behdad.org
Tue Mar 4 14:45:12 PST 2014


On 14-03-04 02:29 PM, Richard Wordingham wrote:
> On Tue, 04 Mar 2014 10:47:47 -0800
> Behdad Esfahbod <behdad at behdad.org> wrote:
> 
>> That negates the reason we added that line to begin with, which was
>> to ensure all hb_tag_t's fit in hb_script_t.  How about:
>>
>>   _HB_SCRIPT_DUMMY1 = 0x7FFFFFFF,
>>   _HB_SCRIPT_DUMMY2
>>
>> The idea being that DUMMY2 gets value of 0x80000000, ensuring that
>> hb_script_t can represent up to 0xFFFFFFFF.
> 
> But the value of DUMMY2 is not a value of (32-bit) int!

Read again what Jonathan wrote:

"""
ISO C says:

  Each enumerated type shall be compatible with char, a signed
  integer type, or an unsigned integer type. The choice of type is
  implementation-defined, but shall be capable of representing the
  values of all the members of the enumeration.

which is fine, but it also says:

  The expression that defines the value of an enumeration constant
  shall be an integer constant expression that has a value
  representable as an int.
"""


More information about the HarfBuzz mailing list