Generate conversion code for return values from callbacks.