summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-11-02 18:32:41 +0100
committerAlejandro Colomar <alx@kernel.org>2023-11-03 01:08:19 +0100
commit40cd1aa36d7a789090ac7799f71356d3d6e07c94 (patch)
treee2d8f3e06f32f2528077139a2fa9ce44e6fbcb01
parentb93de355779f548e47cfcd5e05c1cb36b32a399a (diff)
bin/grepc: Transform some if's to simpler test&&
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rwxr-xr-xbin/grepc65
1 files changed, 26 insertions, 39 deletions
diff --git a/bin/grepc b/bin/grepc
index 2ab0abb..374915b 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -448,45 +448,32 @@ grepc_use_type()
grepc_search()
{
- if [ "$t_enum" = 'yes' ]; then
- grepc_enum_constant "$1";
- fi;
- if [ "$t_func_proto" = 'yes' ]; then
- grepc_func_proto "$1";
- fi;
- if [ "$t_func_def" = 'yes' ]; then
- grepc_func_def "$1";
- fi;
- if [ "$t_func_syscall_proto" = 'yes' ]; then
- grepc_linux_func_syscall_proto "$1";
- fi;
- if [ "$t_func_syscall_def" = 'yes' ]; then
- grepc_linux_func_syscall_def "$1";
- fi;
- if [ "$t_func_glibc_proto" = 'yes' ]; then
- grepc_glibc_func_proto "$1";
- fi;
- if [ "$t_func_glibc_def" = 'yes' ]; then
- grepc_glibc_func_def "$1";
- fi;
- if [ "$t_macro" = 'yes' ]; then
- grepc_macro "$1";
- fi;
- if [ "$t_type" = 'yes' ]; then
- grepc_type "$1";
- fi;
- if [ "$t_use_enum" = 'yes' ]; then
- grepc_use_enum "$1";
- fi;
- if [ "$t_use_func" = 'yes' ]; then
- grepc_use_func "$1";
- fi;
- if [ "$t_use_macro" = 'yes' ]; then
- grepc_use_macro "$1";
- fi;
- if [ "$t_use_type" = 'yes' ]; then
- grepc_use_type "$1";
- fi;
+ test "$t_enum" = 'yes' \
+ && grepc_enum_constant "$1";
+ test "$t_func_proto" = 'yes' \
+ && grepc_func_proto "$1";
+ test "$t_func_def" = 'yes' \
+ && grepc_func_def "$1";
+ test "$t_func_syscall_proto" = 'yes' \
+ && grepc_linux_func_syscall_proto "$1";
+ test "$t_func_syscall_def" = 'yes' \
+ && grepc_linux_func_syscall_def "$1";
+ test "$t_func_glibc_proto" = 'yes' \
+ && grepc_glibc_func_proto "$1";
+ test "$t_func_glibc_def" = 'yes' \
+ && grepc_glibc_func_def "$1";
+ test "$t_macro" = 'yes' \
+ && grepc_macro "$1";
+ test "$t_type" = 'yes' \
+ && grepc_type "$1";
+ test "$t_use_enum" = 'yes' \
+ && grepc_use_enum "$1";
+ test "$t_use_func" = 'yes' \
+ && grepc_use_func "$1";
+ test "$t_use_macro" = 'yes' \
+ && grepc_use_macro "$1";
+ test "$t_use_type" = 'yes' \
+ && grepc_use_type "$1";
}