Module Name: src
Committed By: christos
Date: Sun Aug 14 12:58:16 UTC 2011
Modified Files:
src/usr.bin/ftp: Makefile ftp.c main.c
Log Message:
fix gcc-4.5 warnings
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/ftp/Makefile
cvs rdiff -u -r1.160 -r1.161 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.117 -r1.118 src/usr.bin/ftp/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/ftp/Makefile
diff -u src/usr.bin/ftp/Makefile:1.34 src/usr.bin/ftp/Makefile:1.35
--- src/usr.bin/ftp/Makefile:1.34 Tue Jun 21 22:49:44 2011
+++ src/usr.bin/ftp/Makefile Sun Aug 14 08:58:15 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2011/06/22 02:49:44 mrg Exp $
+# $NetBSD: Makefile,v 1.35 2011/08/14 12:58:15 christos Exp $
# from: @(#)Makefile 8.2 (Berkeley) 4/3/94
.include <bsd.own.mk>
@@ -28,9 +28,3 @@
main.o: ftp_var.h
.include <bsd.prog.mk>
-
-# XXX
-.if ${HAVE_GCC} == 45
-COPTS.main.c+= -Wno-error
-COPTS.ftp.c+= -Wno-error
-.endif
Index: src/usr.bin/ftp/ftp.c
diff -u src/usr.bin/ftp/ftp.c:1.160 src/usr.bin/ftp/ftp.c:1.161
--- src/usr.bin/ftp/ftp.c:1.160 Fri Mar 5 02:41:10 2010
+++ src/usr.bin/ftp/ftp.c Sun Aug 14 08:58:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp.c,v 1.160 2010/03/05 07:41:10 lukem Exp $ */
+/* $NetBSD: ftp.c,v 1.161 2011/08/14 12:58:15 christos Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-__RCSID("$NetBSD: ftp.c,v 1.160 2010/03/05 07:41:10 lukem Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.161 2011/08/14 12:58:15 christos Exp $");
#endif
#endif /* not lint */
@@ -1591,18 +1591,25 @@
UC(p[0]), UC(p[1]));
break;
#ifdef INET6
- case AF_INET6:
- a = (char *)&data_addr.si_su.su_sin6.sin6_addr;
- p = (char *)&data_addr.su_port;
+ case AF_INET6: {
+ uint8_t ua[sizeof(data_addr.si_su.su_sin6.sin6_addr)];
+ uint8_t up[sizeof(data_addr.su_port)];
+
+ memcpy(ua, &data_addr.si_su.su_sin6.sin6_addr,
+ sizeof(ua));
+ memcpy(up, &data_addr.su_port, sizeof(up));
+
result = command(
"LPRT %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
6, 16,
- UC(a[0]),UC(a[1]),UC(a[2]),UC(a[3]),
- UC(a[4]),UC(a[5]),UC(a[6]),UC(a[7]),
- UC(a[8]),UC(a[9]),UC(a[10]),UC(a[11]),
- UC(a[12]),UC(a[13]),UC(a[14]),UC(a[15]),
- 2, UC(p[0]), UC(p[1]));
+ ua[0], ua[1], ua[2], ua[3],
+ ua[4], ua[5], ua[6], ua[7],
+ ua[8], ua[9], ua[10], ua[11],
+ ua[12], ua[13], ua[14], ua[15],
+ 2,
+ up[0], up[1]);
break;
+ }
#endif
default:
result = COMPLETE + 1; /* xxx */
Index: src/usr.bin/ftp/main.c
diff -u src/usr.bin/ftp/main.c:1.117 src/usr.bin/ftp/main.c:1.118
--- src/usr.bin/ftp/main.c:1.117 Mon Jul 13 15:05:41 2009
+++ src/usr.bin/ftp/main.c Sun Aug 14 08:58:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.117 2009/07/13 19:05:41 roy Exp $ */
+/* $NetBSD: main.c,v 1.118 2011/08/14 12:58:15 christos Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: main.c,v 1.117 2009/07/13 19:05:41 roy Exp $");
+__RCSID("$NetBSD: main.c,v 1.118 2011/08/14 12:58:15 christos Exp $");
#endif
#endif /* not lint */
@@ -737,7 +737,7 @@
*/
if (strchr(margv[0], ':') != NULL ||
!editing ||
- el_parse(el, margc, (const char **)margv) != 0)
+ el_parse(el, margc, (void *)margv) != 0)
#endif /* !NO_EDITCOMPLETE */
fputs("?Invalid command.\n", ttyout);
continue;