Cosmetic: Clean up warnings.

This commit is contained in:
Brian Somers 1998-04-18 01:01:28 +00:00
parent 3edeb0c69e
commit cdbbb6b571
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/MP/; revision=35258
12 changed files with 43 additions and 42 deletions

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: chat.c,v 1.44.2.21 1998/04/07 00:53:27 brian Exp $
* $Id: chat.c,v 1.44.2.22 1998/04/10 23:51:24 brian Exp $
*/
#include <sys/types.h>
@ -134,6 +134,7 @@ chat_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
struct chat *c = descriptor2chat(d);
int special, gotabort, gottimeout, needcr;
int TimedOut = c->TimedOut;
static char arg_term;
if (c->pause.state == TIMER_RUNNING)
return 0;
@ -144,7 +145,7 @@ chat_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
c->state = CHAT_FAILED;
else {
/* c->state = CHAT_EXPECT; */
c->argptr = "";
c->argptr = &arg_term;
}
c->TimedOut = 0;
}
@ -211,22 +212,22 @@ chat_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
if (gotabort) {
if (c->abort.num < MAXABORTS) {
int len, n;
int len, i;
len = strlen(c->exp+2);
for (n = 0; n < c->abort.num; n++)
if (len > c->abort.string[n].len) {
for (i = 0; i < c->abort.num; i++)
if (len > c->abort.string[i].len) {
int last;
for (last = c->abort.num; last > n; last--) {
for (last = c->abort.num; last > i; last--) {
c->abort.string[last].data = c->abort.string[last-1].data;
c->abort.string[last].len = c->abort.string[last-1].len;
}
break;
}
c->abort.string[n].len = len;
c->abort.string[n].data = (char *)malloc(len+1);
memcpy(c->abort.string[n].data, c->exp+2, len+1);
c->abort.string[i].len = len;
c->abort.string[i].data = (char *)malloc(len+1);
memcpy(c->abort.string[i].data, c->exp+2, len+1);
c->abort.num++;
} else
LogPrintf(LogERROR, "chat_UpdateSet: too many abort strings\n");
@ -246,7 +247,7 @@ chat_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
if (c->exp[2] == '\0') {
/* Empty string, reparse (this may be better as a `goto start') */
c->argptr = "";
c->argptr = &arg_term;
return chat_UpdateSet(d, r, w, e, n);
}

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: command.c,v 1.131.2.62 1998/04/16 18:30:50 brian Exp $
* $Id: command.c,v 1.131.2.63 1998/04/17 22:05:12 brian Exp $
*
*/
#include <sys/types.h>
@ -453,7 +453,7 @@ ShowEscape(struct cmdargs const *arg)
{
if (arg->cx->physical->async.cfg.EscMap[32]) {
int code, bit;
char *sep = "";
const char *sep = "";
for (code = 0; code < 32; code++)
if (arg->cx->physical->async.cfg.EscMap[code])
@ -500,13 +500,13 @@ static int
ShowVersion(struct cmdargs const *arg)
{
static char VarVersion[] = "PPP Version 2.0-beta";
static char VarLocalVersion[] = "$Date: 1998/04/16 18:30:50 $";
static char VarLocalVersion[] = "$Date: 1998/04/17 22:05:12 $";
prompt_Printf(arg->prompt, "%s - %s \n", VarVersion, VarLocalVersion);
return 0;
}
int
static int
ShowProtocolStats(struct cmdargs const *arg)
{
struct link *l = ChooseLink(arg);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: datalink.c,v 1.1.2.38 1998/04/16 00:25:56 brian Exp $
* $Id: datalink.c,v 1.1.2.39 1998/04/17 22:04:25 brian Exp $
*/
#include <sys/types.h>
@ -823,7 +823,7 @@ datalink_SetRedial(struct cmdargs const *arg)
return -1;
}
static char *states[] = {
static const char *states[] = {
"closed",
"opening",
"hangup",

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: datalink.h,v 1.1.2.16 1998/04/07 00:53:36 brian Exp $
* $Id: datalink.h,v 1.1.2.17 1998/04/10 13:19:06 brian Exp $
*/
#define DATALINK_CLOSED (0)
@ -78,7 +78,7 @@ struct datalink {
char list[SCRIPT_LEN]; /* copy of cfg.list for strsep() */
char *next; /* Next phone from the list */
char *alt; /* Next phone from the list */
char *chosen; /* Chosen phone number after DIAL */
const char *chosen; /* Chosen phone number after DIAL */
} phone;
int dial_tries; /* currently try again this number of times */

View File

@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: filter.h,v 1.11.2.4 1998/04/07 00:53:40 brian Exp $
* $Id: filter.h,v 1.11.2.5 1998/04/16 18:30:52 brian Exp $
*
* TODO:
*/
@ -70,7 +70,7 @@ struct filterent {
struct filter {
struct filterent rule[MAXFILTERS]; /* incoming packet filter */
char *name;
const char *name;
unsigned fragok : 1;
unsigned logok : 1;
};

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: hdlc.c,v 1.28.2.24 1998/04/06 09:12:28 brian Exp $
* $Id: hdlc.c,v 1.28.2.25 1998/04/07 00:53:43 brian Exp $
*
* TODO:
*/
@ -553,7 +553,8 @@ static const char *FrameHeaders[] = {
u_char *
HdlcDetect(struct physical *physical, u_char *cp, int n)
{
const char *ptr, *fp, **hp;
const char *fp, **hp;
char *ptr;
cp[n] = '\0'; /* be sure to null terminated */
ptr = NULL;

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: link.h,v 1.1.2.7 1998/04/03 19:21:33 brian Exp $
* $Id: link.h,v 1.1.2.8 1998/04/03 19:25:38 brian Exp $
*
*/
@ -39,7 +39,7 @@ struct prompt;
struct link {
int type; /* _LINK type */
char *name; /* unique id per link type */
const char *name; /* unique id per link type */
int len; /* full size of parent struct */
struct pppThroughput throughput; /* Link throughput statistics */
struct pppTimer Timer; /* inactivity timeout */

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: loadalias.c,v 1.14.2.1 1998/04/06 09:12:31 brian Exp $
* $Id: loadalias.c,v 1.14.2.2 1998/04/07 00:53:57 brian Exp $
*/
#include <sys/param.h>
@ -95,8 +95,8 @@ loadAliasHandlers()
plen = strlen(path);
if (plen && plen < MAXPATHLEN - 1 && path[plen-1] == '.') {
DIR *d;
char p[MAXPATHLEN], *fix;
char *file, *dir;
char p[MAXPATHLEN], *fix, *file;
const char *dir;
strcpy(p, path);
if ((file = strrchr(p, '/')) != NULL) {

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: lqr.c,v 1.22.2.22 1998/04/14 07:25:37 brian Exp $
* $Id: lqr.c,v 1.22.2.23 1998/04/16 00:26:07 brian Exp $
*
* o LQR based on RFC1333
*
@ -110,7 +110,7 @@ LqrChangeOrder(struct lqrdata * src, struct lqrdata * dst)
*dp++ = ntohl(*sp++);
}
void
static void
SendLqrData(struct lcp *lcp)
{
struct mbuf *bp;

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp.c,v 1.1.2.3 1998/04/14 23:17:09 brian Exp $
* $Id: mp.c,v 1.1.2.4 1998/04/16 00:26:11 brian Exp $
*/
#include <sys/types.h>
@ -175,9 +175,8 @@ mp_Input(struct mp *mp, struct mbuf *m, struct physical *p)
struct mp_header mh, h;
struct mbuf *q, *last;
int32_t seq;
int len;
if ((len = mp_ReadHeader(mp, m, &mh)) == 0) {
if (mp_ReadHeader(mp, m, &mh) == 0) {
pfree(m);
return;
}

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: prompt.c,v 1.1.2.25 1998/04/10 13:19:18 brian Exp $
* $Id: prompt.c,v 1.1.2.26 1998/04/14 23:17:10 brian Exp $
*/
#include <sys/param.h>
@ -100,12 +100,12 @@ prompt_Display(struct prompt *p)
pconnect = "ppp";
if (*shostname == '\0') {
char *p;
char *dot;
if (gethostname(shostname, sizeof shostname))
strcpy(shostname, "localhost");
else if ((p = strchr(shostname, '.')))
*p = '\0';
else if ((dot = strchr(shostname, '.')))
*dot = '\0';
}
fprintf(p->Term, "%s%s%s> ", pconnect, pauth, shostname);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: server.c,v 1.16.2.14 1998/04/07 23:46:09 brian Exp $
* $Id: server.c,v 1.16.2.15 1998/04/10 13:19:20 brian Exp $
*/
#include <sys/types.h>
@ -94,7 +94,7 @@ server_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
struct server *s = descriptor2server(d);
char hisaddr[ADDRSZ];
struct sockaddr *sa = (struct sockaddr *)hisaddr;
struct sockaddr_in *sin = (struct sockaddr_in *)hisaddr;
struct sockaddr_in *in = (struct sockaddr_in *)hisaddr;
int ssize = ADDRSZ, wfd;
struct prompt *p;
@ -110,15 +110,15 @@ server_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
break;
case AF_INET:
if (ntohs(sin->sin_port) < 1024) {
if (ntohs(in->sin_port) < 1024) {
LogPrintf(LogALERT, "Rejected client connection from %s:%u"
"(invalid port number) !\n",
inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
inet_ntoa(in->sin_addr), ntohs(in->sin_port));
close(wfd);
return;
}
LogPrintf(LogPHASE, "Connected to client from %s:%u\n",
inet_ntoa(sin->sin_addr), sin->sin_port);
inet_ntoa(in->sin_addr), in->sin_port);
break;
default:
@ -140,7 +140,7 @@ server_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
case AF_INET:
p->src.type = "tcp";
snprintf(p->src.from, sizeof p->src.from, "%s:%u",
inet_ntoa(sin->sin_addr), sin->sin_port);
inet_ntoa(in->sin_addr), in->sin_port);
break;
}
prompt_TtyCommandMode(p);