Module Name: src Committed By: christos Date: Wed Dec 3 13:10:49 UTC 2014
Modified Files: src/tests/sys/netinet: t_print.c src/tests/sys/netinet6: t_print.c Log Message: Add casts for big endian machines To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/sys/netinet/t_print.c cvs rdiff -u -r1.1 -r1.2 src/tests/sys/netinet6/t_print.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/sys/netinet/t_print.c diff -u src/tests/sys/netinet/t_print.c:1.1 src/tests/sys/netinet/t_print.c:1.2 --- src/tests/sys/netinet/t_print.c:1.1 Tue Dec 2 14:48:21 2014 +++ src/tests/sys/netinet/t_print.c Wed Dec 3 08:10:49 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: t_print.c,v 1.1 2014/12/02 19:48:21 christos Exp $ */ +/* $NetBSD: t_print.c,v 1.2 2014/12/03 13:10:49 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_print.c,v 1.1 2014/12/02 19:48:21 christos Exp $"); +__RCSID("$NetBSD: t_print.c,v 1.2 2014/12/03 13:10:49 christos Exp $"); #include "netinet/in_print.c" @@ -109,7 +109,7 @@ ATF_TC_BODY(sin_print, tc) for (size_t i = 0; i < __arraycount(tst); i++) { sin.sin_addr = tst[i].ia; - sin.sin_port = htons(i); + sin.sin_port = (in_port_t)htons(i); r = sin_print(buf, l, &sin); if (i == 0) e = snprintf(res, sizeof(res), "%s", tst[i].str); @@ -123,7 +123,7 @@ ATF_TC_BODY(sin_print, tc) l = 14; for (size_t i = 0; i < __arraycount(tst); i++) { sin.sin_addr = tst[i].ia; - sin.sin_port = htons(i); + sin.sin_port = (in_port_t)htons(i); r = sin_print(buf, l, &sin); if (i == 0) e = snprintf(res, l, "%s", tst[i].str); Index: src/tests/sys/netinet6/t_print.c diff -u src/tests/sys/netinet6/t_print.c:1.1 src/tests/sys/netinet6/t_print.c:1.2 --- src/tests/sys/netinet6/t_print.c:1.1 Tue Dec 2 14:48:21 2014 +++ src/tests/sys/netinet6/t_print.c Wed Dec 3 08:10:49 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: t_print.c,v 1.1 2014/12/02 19:48:21 christos Exp $ */ +/* $NetBSD: t_print.c,v 1.2 2014/12/03 13:10:49 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_print.c,v 1.1 2014/12/02 19:48:21 christos Exp $"); +__RCSID("$NetBSD: t_print.c,v 1.2 2014/12/03 13:10:49 christos Exp $"); #include "netinet6/in6_print.c" #include "netinet/in_print.c" @@ -118,7 +118,7 @@ ATF_TC_BODY(sin6_print, tc) for (size_t i = 0; i < __arraycount(tst); i++) { sin6.sin6_addr = tst[i].ia; - sin6.sin6_port = htons(i); + sin6.sin6_port = (in_port_t)htons(i); r = sin6_print(buf, l, &sin6); if (i == 0) e = snprintf(res, sizeof(res), "%s", tst[i].str); @@ -133,7 +133,7 @@ ATF_TC_BODY(sin6_print, tc) l = 14; for (size_t i = 0; i < __arraycount(tst); i++) { sin6.sin6_addr = tst[i].ia; - sin6.sin6_port = htons(i); + sin6.sin6_port = (in_port_t)htons(i); r = sin6_print(buf, l, &sin6); if (i == 0) e = snprintf(res, l, "%s", tst[i].str);