[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tip patch for -Wall
- To: tech@openbsd.org
- Subject: tip patch for -Wall
- From: Panda <panda@omatis.com>
- Date: 07 May 2002 06:55:31 +0200
- User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1
maybe a little interesting than passwd that i just posted
but tip produced a lot of warnings,
(even without -Wall)
with this patch, it is now quiet.
mostly undeclared functions used.
tip.patch is for the tip directory and
tip-aculib.patch is for the tip/aculib subdirectory
tip.patch:
---------------------------
--- acu.c.old Tue May 7 06:23:39 2002
+++ acu.c Tue May 7 06:23:54 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)acu.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)acu.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: acu.c,v 1.7 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: acu.c,v 1.7 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
#include "tip.h"
--- acutab.c.old Tue May 7 06:23:39 2002
+++ acutab.c Tue May 7 06:28:11 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)acutab.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)acutab.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: acutab.c,v 1.2 1996/06/26 05:40:41 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: acutab.c,v 1.2 1996/06/26 05:40:41 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
@@ -58,46 +58,46 @@
acu_t acutable[] = {
#if BIZ1031
- "biz31f", biz31f_dialer, biz31_disconnect, biz31_abort,
- "biz31w", biz31w_dialer, biz31_disconnect, biz31_abort,
+ { "biz31f", biz31f_dialer, biz31_disconnect, biz31_abort } ,
+ { "biz31w", biz31w_dialer, biz31_disconnect, biz31_abort },
#endif
#if BIZ1022
- "biz22f", biz22f_dialer, biz22_disconnect, biz22_abort,
- "biz22w", biz22w_dialer, biz22_disconnect, biz22_abort,
+ { "biz22f", biz22f_dialer, biz22_disconnect, biz22_abort },
+ { "biz22w", biz22w_dialer, biz22_disconnect, biz22_abort },
#endif
#if DF02
- "df02", df02_dialer, df_disconnect, df_abort,
+ { "df02", df02_dialer, df_disconnect, df_abort },
#endif
#if DF03
- "df03", df03_dialer, df_disconnect, df_abort,
+ { "df03", df03_dialer, df_disconnect, df_abort },
#endif
#if DN11
- "dn11", dn_dialer, dn_disconnect, dn_abort,
+ { "dn11", dn_dialer, dn_disconnect, dn_abort },
#endif
#ifdef VENTEL
- "ventel",ven_dialer, ven_disconnect, ven_abort,
+ { "ventel",ven_dialer, ven_disconnect, ven_abort },
#endif
#ifdef HAYES
- "hayes",hay_dialer, hay_disconnect, hay_abort,
+ { "hayes",hay_dialer, hay_disconnect, hay_abort },
#endif
#ifdef COURIER
- "courier",cour_dialer, cour_disconnect, cour_abort,
+ { "courier",cour_dialer, cour_disconnect, cour_abort },
#endif
#ifdef T3000
- "t3000",t3000_dialer, t3000_disconnect, t3000_abort,
+ { "t3000",t3000_dialer, t3000_disconnect, t3000_abort },
#endif
#ifdef V3451
#ifndef V831
- "vadic",v3451_dialer, v3451_disconnect, v3451_abort,
+ { "vadic",v3451_dialer, v3451_disconnect, v3451_abort },
#endif
- "v3451",v3451_dialer, v3451_disconnect, v3451_abort,
+ { "v3451",v3451_dialer, v3451_disconnect, v3451_abort },
#endif
#ifdef V831
#ifndef V3451
- "vadic",v831_dialer, v831_disconnect, v831_abort,
+ { "vadic",v831_dialer, v831_disconnect, v831_abort },
#endif
- "v831",v831_dialer, v831_disconnect, v831_abort,
+ { "v831",v831_dialer, v831_disconnect, v831_abort },
#endif
- 0, 0, 0, 0
+ { 0, 0, 0, 0 }
};
--- cmds.c.old Tue May 7 06:23:39 2002
+++ cmds.c Tue May 7 06:42:45 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cmds.c,v 1.13 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: cmds.c,v 1.13 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
#include "tip.h"
@@ -735,7 +735,7 @@
}
printf("%s", s);
while (--i >= 0)
- if (nums[i] || i == 0 && nums[1] == 0 && nums[2] == 0)
+ if ((nums[i] != 0) || ((i == 0) && (nums[1] == 0) && (nums[2] == 0)))
printf("%d %s%c ", nums[i], sep[i],
nums[i] == 1 ? '\0' : 's');
printf("\r\n!\r\n");
--- cmdtab.c.old Tue May 7 06:23:39 2002
+++ cmdtab.c Tue May 7 06:44:50 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.3 2001/09/09 17:58:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: cmdtab.c,v 1.3 2001/09/09 17:58:41 millert Exp $";
#endif /* not lint */
#include "tip.h"
--- cu.c.old Tue May 7 06:23:39 2002
+++ cu.c Tue May 7 06:45:14 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)cu.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)cu.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: cu.c,v 1.11 2002/02/10 23:22:10 miod Exp $";
+static const char rcsid[] = "$OpenBSD: cu.c,v 1.11 2002/02/10 23:22:10 miod Exp $";
#endif /* not lint */
#include "tip.h"
--- hunt.c.old Tue May 7 06:23:39 2002
+++ hunt.c Tue May 7 06:45:40 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)hunt.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)hunt.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: hunt.c,v 1.8 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: hunt.c,v 1.8 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
#include "tip.h"
--- log.c.old Tue May 7 06:23:39 2002
+++ log.c Tue May 7 06:46:22 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)log.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: log.c,v 1.5 2001/09/09 19:30:49 millert Exp $";
+static const char rcsid[] = "$OpenBSD: log.c,v 1.5 2001/09/09 19:30:49 millert Exp $";
#endif /* not lint */
#include "tip.h"
--- partab.c.old Tue May 7 06:23:39 2002
+++ partab.c Tue May 7 06:46:46 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)partab.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)partab.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: partab.c,v 1.3 1997/04/02 01:47:02 millert Exp $";
+static const char rcsid[] = "$OpenBSD: partab.c,v 1.3 1997/04/02 01:47:02 millert Exp $";
#endif /* not lint */
/*
--- remote.c.old Tue May 7 06:23:39 2002
+++ remote.c Tue May 7 07:02:58 2002
@@ -36,16 +36,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)remote.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: remote.c,v 1.10 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: remote.c,v 1.10 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
#include <stdio.h>
@@ -93,8 +93,8 @@
}
if ((stat = cgetent(&bp, db_array, host)) < 0) {
- if (DV ||
- host[0] == '/' && access(DV = host, R_OK | W_OK) == 0) {
+ if ((DV != NULL) ||
+ ((host[0] == '/') && (access(DV = host, R_OK | W_OK) == 0))) {
CU = DV;
HO = host;
HW = 1;
--- tip.c.old Tue May 7 06:23:39 2002
+++ tip.c Tue May 7 07:04:20 2002
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tip.c,v 1.17 2002/03/25 16:41:36 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: tip.c,v 1.17 2002/03/25 16:41:36 deraadt Exp $";
#endif /* not lint */
/*
@@ -631,5 +631,5 @@
(void) fflush(stderr);
}
for (i = 0; i < 0200; i++)
- partab[i] = (evenpartab[i] ^ flip | set) & clr;
+ partab[i] = ((evenpartab[i] ^ flip) | set) & clr;
}
--- tipout.c.old Tue May 7 06:23:39 2002
+++ tipout.c Tue May 7 07:05:35 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tipout.c,v 1.8 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: tipout.c,v 1.8 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
#include "tip.h"
--- uucplock.c.old Tue May 7 06:23:39 2002
+++ uucplock.c Tue May 7 07:06:12 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: uucplock.c,v 1.6 1998/07/13 02:11:44 millert Exp $";
+static const char rcsid[] = "$OpenBSD: uucplock.c,v 1.6 1998/07/13 02:11:44 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
--- value.c.old Tue May 7 06:23:39 2002
+++ value.c Tue May 7 07:06:34 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)value.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)value.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: value.c,v 1.7 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: value.c,v 1.7 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
#include "tip.h"
--- vars.c.old Tue May 7 06:23:39 2002
+++ vars.c Tue May 7 07:06:53 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)vars.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)vars.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: vars.c,v 1.2 1996/06/26 05:40:50 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: vars.c,v 1.2 1996/06/26 05:40:50 deraadt Exp $";
#endif /* not lint */
#include "tip.h"
---------------------------------
tip-aculib.patch:
---------------------------------
--- biz22.c.old Tue May 7 07:51:02 2002
+++ biz22.c Tue May 7 07:08:23 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)biz22.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)biz22.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: biz22.c,v 1.7 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: biz22.c,v 1.7 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
#include "tip.h"
--- courier.c.old Tue May 7 07:51:02 2002
+++ courier.c Tue May 7 07:15:28 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)courier.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)courier.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: courier.c,v 1.10 2002/02/16 21:27:55 millert Exp $";
+static const char rcsid[] = "$OpenBSD: courier.c,v 1.10 2002/02/16 21:27:55 millert Exp $";
#endif /* not lint */
/*
@@ -49,12 +49,14 @@
#include <sys/ioctl.h>
#include <stdio.h>
+static void cour_write(int fd, char *cp, int n);
+
#define MAXRETRY 5
static void sigALRM();
static int timeout = 0;
static int connected = 0;
-static jmp_buf timeoutbuf, intbuf;
+static jmp_buf timeoutbuf;
static int coursync(), cour_connect(), cour_swallow();
void cour_nap();
@@ -183,12 +185,12 @@
char *msg;
int baud;
} baud_msg[] = {
- "", B300,
- " 1200", B1200,
- " 2400", B2400,
- " 9600", B9600,
- " 9600/ARQ", B9600,
- 0, 0,
+ { "", B300 },
+ { " 1200", B1200 },
+ { " 2400", B2400 },
+ { " 9600", B9600 },
+ { " 9600/ARQ", B9600 },
+ { 0, 0 },
};
static int
--- df.c.old Tue May 7 07:51:02 2002
+++ df.c Tue May 7 07:20:13 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)df.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)df.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: df.c,v 1.5 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: df.c,v 1.5 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
/*
@@ -49,6 +49,8 @@
static jmp_buf Sjbuf;
static void timeout();
+static int df_dialer(char *num, char *acu, int df03);
+static void df_disconnect();
int
df02_dialer(num, acu)
--- dn11.c.old Tue May 7 07:51:02 2002
+++ dn11.c Tue May 7 07:21:03 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)dn11.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)dn11.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: dn11.c,v 1.5 2001/11/19 19:02:16 mpech Exp $";
+static const char rcsid[] = "$OpenBSD: dn11.c,v 1.5 2001/11/19 19:02:16 mpech Exp $";
#endif /* not lint */
/*
--- hayes.c.old Tue May 7 07:51:02 2002
+++ hayes.c Tue May 7 07:30:48 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)hayes.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)hayes.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: hayes.c,v 1.8 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: hayes.c,v 1.8 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
/*
@@ -75,6 +75,11 @@
static int timeout = 0;
static jmp_buf timeoutbuf;
static char gobble();
+static void error_rep(char c);
+int hay_sync(void);
+void hay_disconnect(void);
+void goodbye(void);
+
#define DUMBUFLEN 40
static char dumbuf[DUMBUFLEN];
@@ -209,8 +214,7 @@
}
static void
-error_rep(c)
- char c;
+error_rep(char c)
{
printf("\n\r");
switch (c) {
--- t3000.c.old Tue May 7 07:51:02 2002
+++ t3000.c Tue May 7 07:38:00 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)t3000.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)t3000.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: t3000.c,v 1.9 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: t3000.c,v 1.9 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
/*
@@ -55,9 +55,11 @@
static void sigALRM();
static int timeout = 0;
static int connected = 0;
-static jmp_buf timeoutbuf, intbuf;
+static jmp_buf timeoutbuf;
static int t3000_sync(), t3000_connect(), t3000_swallow();
static void t3000_nap();
+static int t3000_write(int fd, char *cp, int n);
+void t3000_disconnect();
int
t3000_dialer(num, acu)
@@ -188,20 +190,20 @@
int baud;
int baud2;
} tbaud_msg[] = {
- "", B300, 0,
- " 1200", B1200, 0,
- " 2400", B2400, 0,
- " 4800", B4800, 0,
- " 9600", B9600, 0,
- " 14400", B19200, B9600,
- " 19200", B19200, B9600,
- " 38400", B38400, B9600,
- " 57600", B38400, B9600,
- " 7512", B9600, 0,
- " 1275", B2400, 0,
- " 7200", B9600, 0,
- " 12000", B19200, B9600,
- 0, 0, 0,
+ {"", B300, 0},
+ {" 1200", B1200, 0},
+ {" 2400", B2400, 0},
+ {" 4800", B4800, 0},
+ {" 9600", B9600, 0},
+ {" 14400", B19200, B9600},
+ {" 19200", B19200, B9600},
+ {" 38400", B38400, B9600},
+ {" 57600", B38400, B9600},
+ {" 7512", B9600, 0},
+ {" 1275", B2400, 0},
+ {" 7200", B9600, 0},
+ {" 12000", B19200, B9600},
+ {0, 0, 0}
};
static int
@@ -339,6 +341,7 @@
tcdrain(fd);
t3000_nap();
}
+ return (0);
}
#ifdef DEBUG
--- v831.c.old Tue May 7 07:51:02 2002
+++ v831.c Tue May 7 07:41:44 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)v831.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)v831.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: v831.c,v 1.6 2001/11/19 19:02:16 mpech Exp $";
+static const char rcsid[] = "$OpenBSD: v831.c,v 1.6 2001/11/19 19:02:16 mpech Exp $";
#endif /* not lint */
/*
--- v3451.c.old Tue May 7 07:51:02 2002
+++ v3451.c Tue May 7 07:41:17 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)v3451.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)v3451.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: v3451.c,v 1.6 2001/10/24 18:38:58 millert Exp $";
+static const char rcsid[] = "$OpenBSD: v3451.c,v 1.6 2001/10/24 18:38:58 millert Exp $";
#endif /* not lint */
/*
--- ventel.c.old Tue May 7 07:51:02 2002
+++ ventel.c Tue May 7 07:45:30 2002
@@ -36,9 +36,9 @@
#ifndef lint
#if 0
-static char sccsid[] = "@(#)ventel.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)ventel.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: ventel.c,v 1.7 2001/11/19 19:02:16 mpech Exp $";
+static const char rcsid[] = "$OpenBSD: ventel.c,v 1.7 2001/11/19 19:02:16 mpech Exp $";
#endif /* not lint */
/*
@@ -57,6 +57,7 @@
static int gobble(), vensync();
static void echo();
+void ven_disconnect();
/*
* some sleep calls have been replaced by this macro
@@ -120,7 +121,7 @@
cp = strchr(line, '\r');
if (cp)
*cp = '\0';
- for (cp = line; cp = strchr(cp, ' '); cp++)
+ for (cp = line; ((cp = strchr(cp, ' ')) != NULL); cp++)
if (cp[1] == ' ')
break;
if (cp) {
@@ -158,7 +159,7 @@
{
char c;
- while (c = *s++) switch (c) {
+ while ((c = *s++) != NULL) switch (c) {
case '$':
read(FD, &c, 1);