From 6979e8e7dfbda7bac6e50e0e3d443261fe2a714c Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Mon, 9 Oct 2023 22:29:40 +0200 Subject: [PATCH] Fix compiler warning when compling NSFontAssetRequest.m in libs-gui Cast the result type of CALL_NON_NULL_BLOCK to void to satisfy the ? operator. ``` NSFontAssetRequest.m:48:3: error: incompatible operand types ('int' and 'id') 48 | CALL_BLOCK(completionHandler, error); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/tools/msys64/ucrt64/include/GNUstepBase/GSBlocks.h:110:53: note: expanded from macro 'CALL_BLOCK' 110 | #define CALL_BLOCK(block, args...) ((NULL != block) ? CALL_NON_NULL_BLOCK(block, args) : nil) | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ 1 error generated. ``` --- Headers/GNUstepBase/GSBlocks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Headers/GNUstepBase/GSBlocks.h b/Headers/GNUstepBase/GSBlocks.h index ea0a20343a..234bf4f52a 100644 --- a/Headers/GNUstepBase/GSBlocks.h +++ b/Headers/GNUstepBase/GSBlocks.h @@ -107,8 +107,8 @@ typedef retTy(^name)() #endif /* __has_feature(blocks) */ -#define CALL_BLOCK(block, args...) ((NULL != block) ? CALL_NON_NULL_BLOCK(block, args) : nil) -#define CALL_BLOCK_NO_ARGS(block) ((NULL != block) ? CALL_NON_NULL_BLOCK_NO_ARGS(block) : nil) +#define CALL_BLOCK(block, args...) ((NULL != block) ? (void)CALL_NON_NULL_BLOCK(block, args) : nil) +#define CALL_BLOCK_NO_ARGS(block) ((NULL != block) ? (void)CALL_NON_NULL_BLOCK_NO_ARGS(block) : nil) #if __has_include() # include