From 6833b4cd915e72ca84c9cdfcf99ee35856352de2 Mon Sep 17 00:00:00 2001 From: assar Date: Sun, 22 Jul 2001 00:12:22 +0000 Subject: get rid of some printf and pointer type warnings --- share/mk/bsd.kern.mk | 6 +----- sys/compat/svr4/imgact_svr4.c | 12 +++++++----- sys/compat/svr4/svr4_fcntl.c | 2 +- sys/compat/svr4/svr4_ioctl.c | 6 +++--- sys/compat/svr4/svr4_misc.c | 2 +- sys/compat/svr4/svr4_signal.c | 2 +- sys/compat/svr4/svr4_stream.c | 6 +++--- sys/compat/svr4/svr4_termios.c | 2 +- sys/conf/kern.mk | 6 +----- 9 files changed, 19 insertions(+), 25 deletions(-) diff --git a/share/mk/bsd.kern.mk b/share/mk/bsd.kern.mk index d81fd7c..ba78e3b 100644 --- a/share/mk/bsd.kern.mk +++ b/share/mk/bsd.kern.mk @@ -3,12 +3,8 @@ # # Warning flags for compiling the kernel and components of the kernel. # -# Note that the newly added -Wcast-qual is responsible for generating -# most of the remaining warnings. Warnings introduced with -Wall will -# also pop up, but are easier to fix. -# CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ - -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ + -Wmissing-prototypes -Wpointer-arith -Winline \ -fformat-extensions -ansi # # The following flags are next up for working on: diff --git a/sys/compat/svr4/imgact_svr4.c b/sys/compat/svr4/imgact_svr4.c index 75c3c57..6692c98 100644 --- a/sys/compat/svr4/imgact_svr4.c +++ b/sys/compat/svr4/imgact_svr4.c @@ -88,7 +88,7 @@ exec_svr4_imgact(imgp) } bss_size = round_page(a_out->a_bss); #ifdef DEBUG - printf("imgact: text: %08x, data: %08x, bss: %08x\n", a_out->a_text, a_out->a_data, bss_size); + printf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", a_out->a_text, a_out->a_data, bss_size); #endif /* @@ -129,7 +129,7 @@ exec_svr4_imgact(imgp) */ if (file_offset & PAGE_MASK) { #ifdef DEBUG - printf("imgact: Non page aligned binary %d\n", file_offset); + printf("imgact: Non page aligned binary %lu\n", file_offset); #endif /* * Map text+data+bss read/write/execute @@ -170,7 +170,7 @@ exec_svr4_imgact(imgp) } else { #ifdef DEBUG - printf("imgact: Page aligned binary %d\n", file_offset); + printf("imgact: Page aligned binary %lu\n", file_offset); #endif /* * Map text+data read/execute @@ -186,7 +186,8 @@ exec_svr4_imgact(imgp) return (error); #ifdef DEBUG - printf("imgact: startaddr=%08x, length=%08x\n", vmaddr, a_out->a_text + a_out->a_data); + printf("imgact: startaddr=%08lx, length=%08lx\n", (u_long)vmaddr, + a_out->a_text + a_out->a_data); #endif /* * allow read/write of data @@ -209,7 +210,8 @@ exec_svr4_imgact(imgp) if (error) return (error); #ifdef DEBUG - printf("imgact: bssaddr=%08x, length=%08x\n", vmaddr, bss_size); + printf("imgact: bssaddr=%08lx, length=%08lx\n", + (u_long)vmaddr, bss_size); #endif } diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index 4fe760f..afa62b7 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -588,7 +588,7 @@ svr4_sys_fcntl(p, uap) long cmd; int flags; - DPRINTF(("Setting flags 0x%x\n", SCARG(uap, arg))); + DPRINTF(("Setting flags %p\n", SCARG(uap, arg))); cmd = SCARG(&fa, cmd); /* save it for a while */ SCARG(&fa, cmd) = F_GETFL; diff --git a/sys/compat/svr4/svr4_ioctl.c b/sys/compat/svr4/svr4_ioctl.c index 55465d1..d93e2b8 100644 --- a/sys/compat/svr4/svr4_ioctl.c +++ b/sys/compat/svr4/svr4_ioctl.c @@ -96,7 +96,7 @@ svr4_sys_ioctl(p, uap) svr4_decode_cmd(SCARG(uap, com), dir, &c, &num, &argsiz); - DPRINTF(("svr4_ioctl[%x](%d, _IO%s(%c, %d, %d), %p);\n", SCARG(uap, com), SCARG(uap, fd), + DPRINTF(("svr4_ioctl[%lx](%d, _IO%s(%c, %d, %d), %p);\n", SCARG(uap, com), SCARG(uap, fd), dir, c, num, argsiz, SCARG(uap, data))); #endif retval = p->p_retval; @@ -112,7 +112,7 @@ svr4_sys_ioctl(p, uap) #if defined(DEBUG_SVR4) if (fp->f_type == DTYPE_SOCKET) { - struct socket *so = fp->f_data; + struct socket *so = (struct socket *)fp->f_data; DPRINTF(("<<< IN: so_state = 0x%x\n", so->so_state)); } #endif @@ -153,7 +153,7 @@ svr4_sys_ioctl(p, uap) } #if defined(DEBUG_SVR4) if (fp->f_type == DTYPE_SOCKET) { - struct socket *so = fp->f_data; + struct socket *so = (struct socket *)fp->f_data; DPRINTF((">>> OUT: so_state = 0x%x\n", so->so_state)); } #endif diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index a92e8a4..6865880 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -921,7 +921,7 @@ svr4_sys_ulimit(p, uap) return error; SCARG(&srl, which) = RLIMIT_FSIZE; - SCARG(&srl, rlp) = (struct orlimit *)url; + SCARG(&srl, rlp) = url; error = setrlimit(p, &srl); if (error) diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c index 8a855bf..0273a7a 100644 --- a/sys/compat/svr4/svr4_signal.c +++ b/sys/compat/svr4/svr4_signal.c @@ -299,7 +299,7 @@ svr4_sys_sigaction(p, uap) for (i = 0; i < 4; i++) DPRINTF(("\tssa_mask[%d] = %lx\n", i, nisa->ssa_mask.bits[i])); - DPRINTF(("\tssa_handler = %lx\n", nisa->ssa_handler)); + DPRINTF(("\tssa_handler = %p\n", nisa->ssa_handler)); } #endif diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index ed7c8fa..45a2a5e 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -1549,9 +1549,9 @@ svr4_stream_ioctl(fp, p, retval, fd, cmd, dat) return i_nread(fp, p, retval, fd, cmd, dat); case SVR4_I_PUSH: - DPRINTF(("I_PUSH %x\n", dat)); + DPRINTF(("I_PUSH %p\n", dat)); #if defined(DEBUG_SVR4) - show_strbuf(dat); + show_strbuf((struct svr4_strbuf *)dat); #endif return 0; @@ -2270,7 +2270,7 @@ svr4_sys_sendto(p, uap) SCARG(&sa, buf) = SCARG(uap, buf); SCARG(&sa, len) = SCARG(uap, len); SCARG(&sa, flags) = SCARG(uap, flags); - SCARG(&sa, to) = SCARG(uap, to); + SCARG(&sa, to) = (caddr_t)SCARG(uap, to); SCARG(&sa, tolen) = SCARG(uap, tolen); DPRINTF(("calling sendto()\n")); diff --git a/sys/compat/svr4/svr4_termios.c b/sys/compat/svr4/svr4_termios.c index bd3ac78..d50f97f 100644 --- a/sys/compat/svr4/svr4_termios.c +++ b/sys/compat/svr4/svr4_termios.c @@ -493,7 +493,7 @@ svr4_term_ioctl(fp, p, retval, fd, cmd, data) *retval = 0; - DPRINTF(("TERM ioctl %x\n", cmd)); + DPRINTF(("TERM ioctl %lx\n", cmd)); switch (cmd) { case SVR4_TCGETA: diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index d81fd7c..ba78e3b 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -3,12 +3,8 @@ # # Warning flags for compiling the kernel and components of the kernel. # -# Note that the newly added -Wcast-qual is responsible for generating -# most of the remaining warnings. Warnings introduced with -Wall will -# also pop up, but are easier to fix. -# CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ - -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ + -Wmissing-prototypes -Wpointer-arith -Winline \ -fformat-extensions -ansi # # The following flags are next up for working on: -- cgit v1.1