On 06/07/2017 02:53 PM, Bruno Haible wrote:
I don't really mind the name of the type - as long as it's a typedef.
I've been leaning towards a name that doesn't start with 'w', since the type is not specific to the walloc module family. The name I'm currently thinking of is 'in_t', short for "index type". That's an easy-to-remember name (the type is like 'int', but possibly wider).
One other advantage of having our own signed type is that we can guarantee that it's at least as wide as int (something that is not true for ptrdiff_t). That way, some of my current code that says 'MIN (INT_MAX, PTRDIFF_MAX)' can be simplified to the more-natural INT_MAX. This is helpful for traditional interfaces that use int counters.