> -----Original Message----- > From: Stefan Fuhrmann [mailto:stefanfuhrm...@alice-dsl.de] > Sent: donderdag 4 november 2010 0:21 > To: Subversion Development > Subject: [Patch] Make svn_tristate_t compatible with svn_boolean_t > > Hi there, > > after stumbling twice over this issue, I ran grep > and found that the current usage of svn_tristate_t > does not depend on the actual numerical values > used for its states. > > Therefore, I propose to define svn_tristate_false > equal to FALSE and svn_tristate_true equal to > TRUE. That way, we can compare booleans with > tristates and assign booleans to tristates. Without > that, we need to write code like > > if ((get_some_bool() ? svn_tristate_true : svn_tristate_false) == > get_a_tristate()) > ... > > Also, the following will compile without warning but > requires the patch to do what was intended: > > // FALSE becomes "unknown", TRUE becomes "false" > svn_tristate_t my_tristate = get_some_bool();
What do you try to get as result here? I'm not 100% sure if tests like (12 == 12) really always return the defined value TRUE and we most likely have other functions that return just some != 0 value as svn_boolean_t. And what if TRUE happens to be defined as -1? (In that case unknown and FALSE would have the same value) I don't think this change makes it easier to use the trystate. You still have to perform the checks yourself. Bert