some gcc 4.1.2pre warning shutup

This commit is contained in:
tg
2007-03-10 18:16:28 +00:00
parent 95eaf0c9bb
commit 377dbe464a
5 changed files with 21 additions and 22 deletions

17
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.86 2007/03/10 00:36:44 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.87 2007/03/10 18:16:26 tg Exp $");
/* tty driver characters we are interested in */ /* tty driver characters we are interested in */
typedef struct { typedef struct {
@ -1511,11 +1511,11 @@ x_insert(int c)
if (Flag(FUTFHACK)) { if (Flag(FUTFHACK)) {
if (((c & 0xC0) == 0x80) && left) { if (((c & 0xC0) == 0x80) && left) {
str[pos++] = c; str[pos++] = c;
left--; if (!--left) {
if (!left) {
str[pos] = '\0'; str[pos] = '\0';
x_arg = save_arg; x_arg = save_arg;
goto x_insert_write; while (x_arg--)
x_ins(str);
} }
return (KSTD); return (KSTD);
} }
@ -1526,24 +1526,25 @@ x_insert(int c)
while (save_arg--) while (save_arg--)
x_ins(str); x_ins(str);
} }
left = 0;
} }
if ((c >= 0xC2) && (c < 0xE0)) if ((c >= 0xC2) && (c < 0xE0))
left = 1; left = 1;
else if ((c >= 0xE0) && (c < 0xF0)) else if ((c >= 0xE0) && (c < 0xF0))
left = 2; left = 2;
else if (c > 0x7F)
goto invmbs;
else
left = 0;
if (left) { if (left) {
save_arg = x_arg; save_arg = x_arg;
pos = 1; pos = 1;
str[0] = c; str[0] = c;
return (KSTD); return (KSTD);
} else if (c > 0x7F) }
goto invmbs;
} }
left = 0; left = 0;
str[0] = c; str[0] = c;
str[1] = '\0'; str[1] = '\0';
x_insert_write:
while (x_arg--) while (x_arg--)
x_ins(str); x_ins(str);
return KSTD; return KSTD;

View File

@ -5,7 +5,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.48 2007/03/04 03:04:25 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.49 2007/03/10 18:16:26 tg Exp $");
int int
c_cd(const char **wp) c_cd(const char **wp)
@ -1917,7 +1917,6 @@ c_exitreturn(const char **wp)
quitenv(NULL); /* get rid of any i/o redirections */ quitenv(NULL); /* get rid of any i/o redirections */
unwind(how); unwind(how);
/* NOTREACHED */ /* NOTREACHED */
return 0;
} }
int int
@ -2095,7 +2094,6 @@ timex(struct op *t, int f)
struct rusage ru0, ru1, cru0, cru1; struct rusage ru0, ru1, cru0, cru1;
struct timeval usrtime, systime, tv0, tv1; struct timeval usrtime, systime, tv0, tv1;
int tf = 0; int tf = 0;
extern struct timeval j_usrtime, j_systime; /* computed by j_wait */
char opts[1]; char opts[1];
gettimeofday(&tv0, NULL); gettimeofday(&tv0, NULL);

5
jobs.c
View File

@ -2,7 +2,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.19 2007/03/04 03:04:25 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.20 2007/03/10 18:16:27 tg Exp $");
/* Order important! */ /* Order important! */
#define PRUNNING 0 #define PRUNNING 0
@ -83,9 +83,6 @@ static const char *const lookup_msgs[] = {
NULL NULL
}; };
/* user and system time of last j_waitjed job */
struct timeval j_systime, j_usrtime;
static Job *job_list; /* job list */ static Job *job_list; /* job list */
static Job *last_job; static Job *last_job;
static Job *async_job; static Job *async_job;

11
sh.h
View File

@ -8,7 +8,7 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.119 2007/03/10 00:42:00 tg Exp $" #define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.120 2007/03/10 18:16:27 tg Exp $"
#define MKSH_VERSION "R29 2007/03/10" #define MKSH_VERSION "R29 2007/03/10"
#if HAVE_SYS_PARAM_H #if HAVE_SYS_PARAM_H
@ -373,7 +373,7 @@ EXTERN struct env {
struct option { struct option {
const char *name; /* long name of option */ const char *name; /* long name of option */
char c; /* character flag (if any) */ char c; /* character flag (if any) */
short flags; /* OF_* */ unsigned char flags; /* OF_* */
}; };
extern const struct option options[]; extern const struct option options[];
@ -1061,8 +1061,6 @@ struct source {
struct tbl *tblp; /* alias (SALIAS) */ struct tbl *tblp; /* alias (SALIAS) */
char *freeme; /* also for SREREAD */ char *freeme; /* also for SREREAD */
} u; } u;
char ugbuf[2]; /* buffer for ungetsc() (SREREAD) and
* alias (SALIAS) */
int line; /* line number */ int line; /* line number */
int errline; /* line the error occurred on (0 if not set) */ int errline; /* line the error occurred on (0 if not set) */
const char *file; /* input file name */ const char *file; /* input file name */
@ -1070,6 +1068,8 @@ struct source {
Area *areap; Area *areap;
XString xs; /* input buffer */ XString xs; /* input buffer */
Source *next; /* stacked source */ Source *next; /* stacked source */
char ugbuf[2]; /* buffer for ungetsc() (SREREAD) and
* alias (SALIAS) */
}; };
/* Source.type values */ /* Source.type values */
@ -1169,6 +1169,9 @@ EXTERN char **history; /* saved commands */
EXTERN char **histptr; /* last history item */ EXTERN char **histptr; /* last history item */
EXTERN int histsize; /* history size */ EXTERN int histsize; /* history size */
/* user and system time of last j_waitjed job */
EXTERN struct timeval j_usrtime, j_systime;
/* alloc.c */ /* alloc.c */
Area *ainit(Area *); Area *ainit(Area *);
void afreeall(Area *); void afreeall(Area *);

6
shf.c
View File

@ -2,7 +2,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.12 2007/03/04 03:04:27 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/shf.c,v 1.13 2007/03/10 18:16:28 tg Exp $");
/* flags to shf_emptybuf() */ /* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */ #define EB_READSW 0x01 /* about to switch to reading */
@ -829,8 +829,8 @@ shf_vfprintf(struct shf *shf, const char *fmt, va_list args)
switch (c) { switch (c) {
case 'p': /* pointer */ case 'p': /* pointer */
flags &= ~(FL_LONG | FL_SHORT); flags &= ~(FL_LONG | FL_SHORT);
if (sizeof(char *) > sizeof(int)) flags |= (sizeof(char *) > sizeof(int)) ?
flags |= FL_LONG; /* hope it fits.. */ /* hope it fits.. */ FL_LONG : 0;
/* aaahhh... */ /* aaahhh... */
case 'd': case 'd':
case 'i': case 'i':