It occurs all of the time, you track internal business function success or failure as an integer, and then you finally want to return it to NER / ER / TER as a char, but a double byte char because it’s unicode.
This is somewhat painful, but I have the remedy. It also uses the crazy ?: operator, which is sure to confuse all of your friends.
In this case if i is non 0, it’ll return 1, else it’ll return 0 – nice.
This could be written:
if (i != 0)