mirror of
https://github.com/curl/curl.git
synced 2025-03-19 15:40:42 +08:00
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
This commit is contained in:
parent
7282093458
commit
bdb5b6dd5b
@ -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;
|
||||
|
@ -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: */
|
||||
|
Loading…
x
Reference in New Issue
Block a user