optimize UNUSED macro

Signed-off-by: liyi <liyi25@xiaomi.com>
This commit is contained in:
liyi 2022-08-04 14:54:31 +08:00 committed by Xiang Xiao
parent 8582a12388
commit 0083a2e4f2
1 changed files with 5 additions and 5 deletions

View File

@ -385,7 +385,7 @@
/* Indicate that a local variable is not used */ /* Indicate that a local variable is not used */
# define UNUSED(a) ((void)(1 || (a))) # define UNUSED(a) ((void)(1 || &(a)))
# if defined(__clang__) # if defined(__clang__)
# define no_builtin(n) __attribute__((no_builtin(n))) # define no_builtin(n) __attribute__((no_builtin(n)))
@ -485,7 +485,7 @@
/* Indicate that a local variable is not used */ /* Indicate that a local variable is not used */
# define UNUSED(a) ((void)(1 || (a))) # define UNUSED(a) ((void)(1 || &(a)))
/* It is assumed that the system is build using the small /* It is assumed that the system is build using the small
* data model with storage defaulting to internal RAM. * data model with storage defaulting to internal RAM.
@ -654,7 +654,7 @@
/* Indicate that a local variable is not used */ /* Indicate that a local variable is not used */
# define UNUSED(a) ((void)(1 || (a))) # define UNUSED(a) ((void)(1 || &(a)))
/* Older Zilog compilers support both types double and long long, but the /* Older Zilog compilers support both types double and long long, but the
* size is 32-bits (same as long and single precision) so it is safer to say * size is 32-bits (same as long and single precision) so it is safer to say
@ -721,7 +721,7 @@
/* Indicate that a local variable is not used */ /* Indicate that a local variable is not used */
# define UNUSED(a) ((void)(1 || (a))) # define UNUSED(a) ((void)(1 || &(a)))
# define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ # define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */
# define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ # define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */
@ -783,7 +783,7 @@
# undef CONFIG_HAVE_DOUBLE # undef CONFIG_HAVE_DOUBLE
# undef CONFIG_HAVE_LONG_DOUBLE # undef CONFIG_HAVE_LONG_DOUBLE
# define UNUSED(a) ((void)(1 || (a))) # define UNUSED(a) ((void)(1 || &(a)))
# define offsetof(a, b) ((size_t)(&(((a *)(0))->b))) # define offsetof(a, b) ((size_t)(&(((a *)(0))->b)))