diff options
author | Dmitry V. Levin <ldv@strace.io> | 2021-11-05 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2021-11-05 08:00:00 +0000 |
commit | 462fa296714f22e1ad96b4c794387306e6c060e1 (patch) | |
tree | e87b74048eb8b292a316fb6f02d48ab7a66d3b2c /src/signal.c | |
parent | 0af66720e603050ae9d24a432487f72b72036f74 (diff) | |
download | strace-462fa296714f22e1ad96b4c794387306e6c060e1.tar.gz |
Use loop initial declarations
This make the code easier to read.
* src/bpf.c (decode_attr_extra_data): Use "for" loop initial
declarations.
* src/count.c (call_summary): Likewise.
* src/dm.c (dm_decode_dm_target_spec, dm_decode_dm_name_list,
dm_decode_dm_target_versions): Likewise.
* src/dyxlat.c (dyxlat_free, dyxlat_add_pair): Likewise.
* src/filter_qualify.c (parse_poke_token): Likewise.
* src/filter_seccomp.c (check_seccomp_order_tracer): Likewise.
* src/ipc.c (SYS_FUNC(ipc)): Likewise.
* src/kexec.c (print_seg): Likewise.
* src/kvm.c (kvm_vcpu_info_free): Likewise.
* src/linux/alpha/get_syscall_args.c (arch_get_syscall_args): Likewise.
* src/linux/arc/get_syscall_args.c (arch_get_syscall_args): Likewise.
* src/linux/bfin/get_syscall_args.c (arch_get_syscall_args): Likewise.
* src/linux/ia64/get_syscall_args.c (arch_get_syscall_args): Likewise.
* src/linux/metag/get_syscall_args.c (arch_get_syscall_args): Likewise.
* src/linux/microblaze/get_syscall_args.c (arch_get_syscall_args):
Likewise.
* src/mmap_notify.c (mmap_notify_report): Likewise.
* src/mmsghdr.c (dumpiov_in_mmsghdr): Likewise.
* src/nlattr.c (decode_nlattr): Likewise.
* src/number_set.c (clear_number_set_array, invert_number_set_array):
Likewise.
* src/pathtrace.c (pathmatch, pathtrace_match_set): Likewise.
* src/poll.c (decode_poll_exiting): Likewise.
* src/signal.c (sprintsigmask_n): Likewise.
* src/sockaddr.c (print_sockaddr_data_ll): Likewise.
* src/socketutils.c (unix_parse_response, get_proto_by_name,
get_sockaddr_by_inode_uncached, genl_parse_families_response): Likewise.
* src/strace.c (expand_tcbtab, alloctcb, droptcb, startup_attach,
redirect_standard_fds, cleanup): Likewise.
* src/syscall.c (decode_socket_subcall, decode_ipc_subcall): Likewise.
* src/term.c (decode_termio): Likewise.
* src/util.c (dumpiov_upto): Likewise.
* src/v4l2.c (print_pixelformat): Likewise.
* tests/add_key.c (main): Likewise.
* tests/attach-f-p.c (main): Likewise.
* tests/btrfs.c (max_flags_plus_one, btrfs_print_qgroup_inherit,
btrfs_test_subvol_ioctls, btrfs_print_tree_search_buf,
btrfs_test_space_info_ioctl, btrfs_test_ino_path_ioctls,
btrfs_test_get_dev_stats_ioctl, btrfs_test_read_ioctls): Likewise.
* tests/count-f.c (thread, process, main): Likewise.
* tests/fanotify_init.c (main): Likewise.
* tests/fanotify_mark.c (main): Likewise.
* tests/file_handle.c (main): Likewise.
* tests/fill_memory.c (fill_memory_ex, fill_memory16_ex,
fill_memory32_ex): Likewise.
* tests/filter-unavailable.c (process, main): Likewise.
* tests/futex.c (invalid_op, main): Likewise.
* tests/get_mempolicy.c (print_nodes): Likewise.
* tests/group_req.c (main): Likewise.
* tests/hexdump_strdup.c (hexdump_memdup): Likewise.
* tests/hexquote_strndup.c (hexquote_strndup): Likewise.
* tests/inet-cmsg.c (print_opts, main): Likewise.
* tests/init_delete_module.h (print_str): Likewise.
* tests/ioctl_block.c (main): Likewise.
* tests/ioctl_dm.c (main): Likewise.
* tests/ioctl_evdev.c (main): Likewise.
* tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise.
* tests/ip_mreq.c (main): Likewise.
* tests/ipc.c (main): Likewise.
* tests/kcmp.c (main): Likewise.
* tests/kexec_file_load.c (main): Likewise.
* tests/kexec_load.c (main): Likewise.
* tests/keyctl.c (do_keyctl, main): Likewise.
* tests/ksysent.c (main): Likewise.
* tests/list_sigaction_signum.c (main): Likewise.
* tests/mincore.c (print_mincore): Likewise.
* tests/mmsg_name.c (test_mmsg_name): Likewise.
* tests/move_pages.c (print_page_array, print_node_array,
print_status_array): Likewise.
* tests/mq_sendrecv.c (printstr, dumpstr): Likewise.
* tests/msg_control.c (print_fds, test_scm_rights3, test_sol_socket,
print_ip_opts, test_ip_opts): Likewise.
* tests/netlink_protocol.c (send_query): Likewise.
* tests/nlattr.c (test_nlattr): Likewise.
* tests/nlattr_ifla_linkinfo.c (TEST_UNKNOWN_TUNNELS): Likewise.
* tests/nlattr_rtmsg.c (print_quoted_hex_ellipsis): Likewise.
* tests/perf_event_open.c (main): Likewise.
* tests/perf_event_open_nonverbose.c (main): Likewise.
* tests/pkey_alloc.c (main): Likewise.
* tests/pkey_free.c (main): Likewise.
* tests/pkey_mprotect.c (main): Likewise.
* tests/poll.c (print_pollfd_array_entering,
print_pollfd_array_exiting): Likewise.
* tests/prctl-arg2-intptr.c (main): Likewise.
* tests/prctl-name.c (main): Likewise.
* tests/pread64-pwrite64.c (dump_str, print_hex, test_dump, main):
Likewise.
* tests/preadv.c (print_iov, print_iovec): Likewise.
* tests/print_quoted_string.c (print_quoted_memory_ex,
print_quoted_hex): Likewise.
* tests/process_vm_readv_writev.c (print_iov): Likewise.
* tests/pwritev.c (print_iovec, main): Likewise.
* tests/qual_fault.c (main): Likewise.
* tests/qual_signal.c (main): Likewise.
* tests/read-write.c (dump_str_ex, print_hex, test_dump, main):
Likewise.
* tests/readahead.c (main): Likewise.
* tests/redirect-fds.c (main): Likewise.
* tests/request_key.c (main): Likewise.
* tests/rt_sigsuspend.c (iterate): Likewise.
* tests/s390_pci_mmio_read_write.c (main): Likewise.
* tests/s390_runtime_instr.c (main): Likewise.
* tests/seccomp-filter-v.c (main): Likewise.
* tests/seccomp_get_action_avail.c (main): Likewise.
* tests/set_mempolicy.c (print_nodes): Likewise.
* tests/setfsugid.c (main): Likewise.
* tests/setns.c (main): Likewise.
* tests/setresugid.c (main): Likewise.
* tests/setreugid.c (main): Likewise.
* tests/setugid.c (main): Likewise.
* tests/socketcall.c (main): Likewise.
* tests/sockopt-sol_netlink.c (main): Likewise.
* tests/test_nlattr.h (print_sockfd): Likewise.
* tests/test_printpath.c (test_printpath_at, test_printpath): Likewise.
* tests/test_printstrn.c (test_printstrn_at, test_efault,
test_printstrn): Likewise.
* tests/unix-pair-send-recv.c (transpose): Likewise.
* tests/unix-pair-sendto-recvfrom.c (transpose): Likewise.
* tests/unshare.c (main): Likewise.
* tests/xchownx.c (main): Likewise.
Diffstat (limited to 'src/signal.c')
-rw-r--r-- | src/signal.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/signal.c b/src/signal.c index 165fdb95c..fc13a6613 100644 --- a/src/signal.c +++ b/src/signal.c @@ -154,7 +154,6 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) const uint32_t *mask; uint32_t inverted_mask[NSIG_BYTES / 4]; unsigned int size; - int i; char sep; s = stpcpy(outstr, prefix); @@ -166,15 +165,14 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) /* check whether 2/3 or more bits are set */ if (popcount32(mask, size) >= size * (4 * 8) * 2 / 3) { /* show those signals that are NOT in the mask */ - unsigned int j; - for (j = 0; j < size; ++j) + for (unsigned int j = 0; j < size; ++j) inverted_mask[j] = ~mask[j]; mask = inverted_mask; *s++ = '~'; } sep = '['; - for (i = 0; (i = next_set_bit(mask, i, size * (4 * 8))) >= 0; ) { + for (int i = 0; (i = next_set_bit(mask, i, size * (4 * 8))) >= 0; ) { ++i; *s++ = sep; if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) |