From: Daniel Stenberg Date: Mon, 16 Dec 2019 07:50:46 +0000 (+0100) Subject: lib: remove ASSIGNWITHINCONDITION exceptions, use our code style X-Git-Tag: curl-7_68_0~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bdb5b6dd5b91a7960b778a2a6e76af028fc5596a;p=thirdparty%2Fcurl.git lib: remove ASSIGNWITHINCONDITION exceptions, use our code style ... even for macros Reviewed-by: Daniel Gustafsson Reviewed-by: Jay Satiro Reported-by: Jay Satiro Fixes #4683 Closes #4722 --- diff --git a/lib/curl_multibyte.h b/lib/curl_multibyte.h index 5225e1811b..3becf41cfa 100644 --- a/lib/curl_multibyte.h +++ b/lib/curl_multibyte.h @@ -61,8 +61,13 @@ char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w); #define Curl_convert_UTF8_to_tchar(ptr) Curl_convert_UTF8_to_wchar((ptr)) #define Curl_convert_tchar_to_UTF8(ptr) Curl_convert_wchar_to_UTF8((ptr)) -#define Curl_unicodefree(ptr) \ - do {if((ptr)) {free((ptr)); (ptr) = NULL;}} while(0) +#define Curl_unicodefree(ptr) \ + do { \ + if(ptr) { \ + free(ptr); \ + (ptr) = NULL; \ + } \ + } while(0) typedef union { unsigned short *tchar_ptr; diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index cad8b37864..62a7f1960c 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -97,9 +97,13 @@ /* A recent macro provided by libssh. Or make our own. */ #ifndef SSH_STRING_FREE_CHAR -/* !checksrc! disable ASSIGNWITHINCONDITION 1 */ -#define SSH_STRING_FREE_CHAR(x) \ - do { if((x) != NULL) { ssh_string_free_char(x); x = NULL; } } while(0) +#define SSH_STRING_FREE_CHAR(x) \ + do { \ + if(x) { \ + ssh_string_free_char(x); \ + x = NULL; \ + } \ + } while(0) #endif /* Local functions: */