Martin Mathieson wrote:
For the more general problem, I see 2 possible solutions: (1) have both signed and values in the union, and use the appropriate signed or unsigned parts of the union in the comparison functions (2) leave the union as it is with unsigned members, cast values in all the signed versions instead of the unsigned versions
I vote for solution 1 (and have everything that adds a signed value to the protocol tree set the signed value in the union).