Am 10.11.22 um 10:23 schrieb Allan McRae:
On 10/11/22 18:57, bp wrote:
I think you (Allan) overlooked that those processing functions return boolean true for success, false for error, instead of the (usual?) int == 0 for success and int != 0 for error.
I had not missed it... we started allowing bool usage in the lead up to 6.0 (in the parallel download patches).
I guess not using it in the codebase is a hangover of more limited C99 support when pacman was starting to be written. I think we now require C11(? - it appears this check got lost in the transition to meson...), so I see no reason to continue requiring 0/-1 returns for binary return states.
Allan
ah, I didn't mean "missed to change" in the sense of requiring C99-style or C11-style. I meant when trying to understand the loop you missed that when using booleans the condition in the if() is the other way round for the usual ints, which lead you to believe the code was bailing out on success? Sorry, if that wasn't as clear as it could have been. -- regards, bp