Skip to content

Commit 6a0e38d

Browse files
committed
fix: correct error code assignment for boolean return type in generate_checked_function
1 parent 080b1fe commit 6a0e38d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ci/generate_checked_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def generate_checked_function(func, typedefs):
149149
if return_type == "void":
150150
new_func.append(f" res.error_code = 0;")
151151
elif return_type == "_Bool":
152-
new_func.append(f" res.error_code = 0 ? original_result : -2;")
152+
new_func.append(f" res.error_code = original_result ? 0 : -2;")
153153
new_func.append(f" res.value._Bool_value = original_result;")
154154
# if return type is a pointer or typedef from pointer
155155
elif return_pointer:

0 commit comments

Comments
 (0)