Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/systrace Fix warnings on Alpha: Cast to intptr_t to extr...



details:   https://anonhg.NetBSD.org/src/rev/a90d80823503
branches:  trunk
changeset: 533004:a90d80823503
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jun 18 21:22:45 2002 +0000

description:
Fix warnings on Alpha: Cast to intptr_t to extract ints stored in void *'s,
and pull in proper prototypes.

diffstat:

 bin/systrace/systrace-translate.c |  10 +++++-----
 bin/systrace/systrace.c           |   5 +++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (71 lines):

diff -r ea2e055e0da0 -r a90d80823503 bin/systrace/systrace-translate.c
--- a/bin/systrace/systrace-translate.c Tue Jun 18 21:21:17 2002 +0000
+++ b/bin/systrace/systrace-translate.c Tue Jun 18 21:22:45 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: systrace-translate.c,v 1.1 2002/06/17 16:29:10 christos Exp $  */
+/*     $NetBSD: systrace-translate.c,v 1.2 2002/06/18 21:22:45 thorpej Exp $   */
 /*     $OpenBSD: systrace-translate.c,v 1.2 2002/06/04 19:09:45 provos Exp $   */
 
 /*
@@ -31,7 +31,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: systrace-translate.c,v 1.1 2002/06/17 16:29:10 christos Exp $");
+__RCSID("$NetBSD: systrace-translate.c,v 1.2 2002/06/18 21:22:45 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -67,7 +67,7 @@
 print_oflags(char *buf, size_t buflen, struct intercept_translate *tl)
 {
        char str[32], *p;
-       int flags = (int)tl->trans_addr;
+       int flags = (intptr_t) tl->trans_addr;
 
        p = str;
        switch (flags & O_ACCMODE) {
@@ -139,7 +139,7 @@
 static int
 print_modeflags(char *buf, size_t buflen, struct intercept_translate *tl)
 {
-       int mode = (int)tl->trans_addr;
+       int mode = (intptr_t) tl->trans_addr;
 
        mode &= 00007777;
        snprintf(buf, buflen, "%o", mode);
@@ -150,7 +150,7 @@
 static int
 print_number(char *buf, size_t buflen, struct intercept_translate *tl)
 {
-       int number = (int)tl->trans_addr;
+       int number = (intptr_t) tl->trans_addr;
 
        snprintf(buf, buflen, "%d", number);
 
diff -r ea2e055e0da0 -r a90d80823503 bin/systrace/systrace.c
--- a/bin/systrace/systrace.c   Tue Jun 18 21:21:17 2002 +0000
+++ b/bin/systrace/systrace.c   Tue Jun 18 21:22:45 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: systrace.c,v 1.1 2002/06/17 16:29:11 christos Exp $    */
+/*     $NetBSD: systrace.c,v 1.2 2002/06/18 21:22:45 thorpej Exp $     */
 /*     $OpenBSD: systrace.c,v 1.16 2002/06/12 22:14:51 provos Exp $    */
 
 /*
@@ -31,7 +31,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: systrace.c,v 1.1 2002/06/17 16:29:11 christos Exp $");
+__RCSID("$NetBSD: systrace.c,v 1.2 2002/06/18 21:22:45 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -43,6 +43,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <string.h>
 #include <syslog.h>
 #include <err.h>
 #include <errno.h>



Home | Main Index | Thread Index | Old Index