From d905bcbba92d530f4fc057a29b74755a8ae49382 Mon Sep 17 00:00:00 2001 From: des Date: Sat, 8 Oct 2011 12:28:06 +0000 Subject: I appreciate the logic behind using a (void) cast to indicate that the return value is intentionally ignored, but frankly, all it does is get in the way of the code. Also fix a few other incorrect casts, such as (void *)malloc(foo) and passing signed values to %x. --- usr.bin/kdump/mksubr | 78 ++++++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'usr.bin/kdump/mksubr') diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr index a3df6bd..1f94bf3 100644 --- a/usr.bin/kdump/mksubr +++ b/usr.bin/kdump/mksubr @@ -84,7 +84,7 @@ _EOF_ cat <<_EOF_ printf(">"); if (or == 0) - (void)printf("%jd", arg); + printf("%jd", arg); } _EOF_ @@ -113,10 +113,10 @@ _EOF_ if ($i ~ /define/) \ break; \ ++i; \ - printf "\tcase %s:\n\t\t(void)printf(\"%s\");\n\t\tbreak;\n", $i, $i }' + printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }' cat <<_EOF_ default: /* Should not reach */ - (void)printf("", arg); + printf("", arg); } } @@ -147,7 +147,7 @@ _EOF_ printf "if (arg == %s) \n\t\tprintf(\"%s\");\n", $2, $2 }' cat <<_EOF_ else /* Should not reach */ - (void)printf("", arg); + printf("", arg); } _EOF_ @@ -211,9 +211,9 @@ void signame(int sig) { if (sig > 0 && sig < NSIG) - (void)printf("SIG%s",signames[sig]); + printf("SIG%s",signames[sig]); else - (void)printf("SIG %d", sig); + printf("SIG %d", sig); } /* MANUAL */ @@ -222,37 +222,37 @@ semctlname(int cmd) { switch (cmd) { case GETNCNT: - (void)printf("GETNCNT"); + printf("GETNCNT"); break; case GETPID: - (void)printf("GETPID"); + printf("GETPID"); break; case GETVAL: - (void)printf("GETVAL"); + printf("GETVAL"); break; case GETALL: - (void)printf("GETALL"); + printf("GETALL"); break; case GETZCNT: - (void)printf("GETZCNT"); + printf("GETZCNT"); break; case SETVAL: - (void)printf("SETVAL"); + printf("SETVAL"); break; case SETALL: - (void)printf("SETALL"); + printf("SETALL"); break; case IPC_RMID: - (void)printf("IPC_RMID"); + printf("IPC_RMID"); break; case IPC_SET: - (void)printf("IPC_SET"); + printf("IPC_SET"); break; case IPC_STAT: - (void)printf("IPC_STAT"); + printf("IPC_STAT"); break; default: /* Should not reach */ - (void)printf("", cmd); + printf("", cmd); } } @@ -262,16 +262,16 @@ shmctlname(int cmd) { switch (cmd) { case IPC_RMID: - (void)printf("IPC_RMID"); + printf("IPC_RMID"); break; case IPC_SET: - (void)printf("IPC_SET"); + printf("IPC_SET"); break; case IPC_STAT: - (void)printf("IPC_STAT"); + printf("IPC_STAT"); break; default: /* Should not reach */ - (void)printf("", cmd); + printf("", cmd); } } @@ -300,14 +300,14 @@ void flagsandmodename(int flags, int mode, int decimal) { flagsname(flags); - (void)putchar(','); + putchar(','); if ((flags & O_CREAT) == O_CREAT) { modename (mode); } else { if (decimal) { - (void)printf("%d", mode); + printf("%d", mode); } else { - (void)printf("%#x", (unsigned int)mode); + printf("%#x", (unsigned int)mode); } } } @@ -323,12 +323,12 @@ void sockoptlevelname(int level, int decimal) { if (level == SOL_SOCKET) { - (void)printf("SOL_SOCKET"); + printf("SOL_SOCKET"); } else { if (decimal) { - (void)printf("%d", level); + printf("%d", level); } else { - (void)printf("%#x", (unsigned int)level); + printf("%#x", (unsigned int)level); } } } @@ -391,33 +391,33 @@ egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z]+[[:space:]]+[0-9]+[[:space:]]*" \ break; \ ++i; \ if (o <= $(i+1)) \ - printf "\tcase %s:\n\t\t(void)printf(\"%s\");\n\t\tbreak;\n", $i, $i; \ + printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i; \ else \ exit; \ o = $(i+1) }' cat <<_EOF_ default: /* Should not reach */ - (void)printf("", cmd); + printf("", cmd); } - (void)putchar(','); + putchar(','); if (cmd == F_GETFD || cmd == F_SETFD) { if (arg == FD_CLOEXEC) - (void)printf("FD_CLOEXEC"); + printf("FD_CLOEXEC"); else if (arg == 0) - (void)printf("0"); + printf("0"); else { if (decimal) - (void)printf("%d", arg); + printf("%d", arg); else - (void)printf("%#x", (unsigned int)arg); + printf("%#x", (unsigned int)arg); } } else if (cmd == F_SETFL) { flagsname(arg); } else { if (decimal) - (void)printf("%d", arg); + printf("%d", arg); else - (void)printf("%#x", (unsigned int)arg); + printf("%#x", (unsigned int)arg); } } @@ -439,10 +439,10 @@ egrep "^#[[:space:]]*define[[:space:]]+RTP_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]] if ($i ~ /define/) \ break; \ ++i; \ - printf "\tcase %s:\n\t\t(void)printf(\"%s\");\n\t\tbreak;\n", $i, $i }' + printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }' cat <<_EOF_ default: /* Should not reach */ - (void)printf("", func); + printf("", func); } } @@ -459,7 +459,7 @@ sendrecvflagsname(int flags) int or = 0; if (flags == 0) { - (void)printf("0"); + printf("0"); return; } -- cgit v1.1