From 7c040d98f958740d4d6e6fdf1687588f9bd505e3 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 15 Mar 2009 16:13:40 +0000 Subject: [PATCH] sprinkle a few static and clean up the internal APIs --- check.t | 4 ++-- edit.c | 13 +++++++------ funcs.c | 4 ++-- sh.h | 7 +++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/check.t b/check.t index 4b1746a..60f2e86 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.257 2009/03/14 18:12:50 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.258 2009/03/15 16:13:37 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -7,7 +7,7 @@ # http://www.research.att.com/~gsf/public/ifs.sh expected-stdout: - @(#)MIRBSD KSH R36 2009/03/14 + @(#)MIRBSD KSH R36 2009/03/15 description: Check version of shell. stdin: diff --git a/edit.c b/edit.c index 2c157bd..2cb1c4e 100644 --- a/edit.c +++ b/edit.c @@ -5,7 +5,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.152 2009/02/22 19:02:27 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.153 2009/03/15 16:13:38 tg Exp $"); /* tty driver characters we are interested in */ typedef struct { @@ -17,7 +17,7 @@ typedef struct { int eof; } X_chars; -X_chars edchars; +static X_chars edchars; /* x_fc_glob() flags */ #define XCF_COMMAND BIT(0) /* Do command completion */ @@ -58,6 +58,7 @@ static int x_command_glob(int, const char *, int, char ***); static int x_locate_word(const char *, int, int, int *, bool *); static int x_e_getmbc(char *); +static int utf_wcwidth(unsigned int); /* +++ generic editing functions +++ */ @@ -775,7 +776,7 @@ utf_skipcols(const char *p, int cols) __RCSID("$miros: src/lib/libc/i18n/wcwidth.c,v 1.8 2008/09/20 12:01:18 tg Exp $"); -int +static int utf_wcwidth(unsigned int c) { static const struct cbset { @@ -2551,8 +2552,8 @@ x_print(int prefix, int key) int x_bind(const char *a1, const char *a2, - int macro, /* bind -m */ - int list) /* bind -l */ + bool macro, /* bind -m */ + bool list) /* bind -l */ { unsigned char f; int prefix, key; @@ -3430,7 +3431,7 @@ static int x_vi_putbuf(const char *, size_t); #define is_srch(c) (classify[(c)&0x7f]&S_) #define is_zerocount(c) (classify[(c)&0x7f]&Z_) -const unsigned char classify[128] = { +static const unsigned char classify[128] = { /* 0 1 2 3 4 5 6 7 */ /* 0 ^@ ^A ^B ^C ^D ^E ^F ^G */ B_, 0, 0, 0, 0, C_|U_, C_|Z_, 0, diff --git a/funcs.c b/funcs.c index 4655bc0..6c59b64 100644 --- a/funcs.c +++ b/funcs.c @@ -5,7 +5,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.94 2009/03/14 18:12:52 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.95 2009/03/15 16:13:39 tg Exp $"); /* A leading = means assignments before command are kept; * a leading * means a POSIX special builtin; @@ -1495,7 +1495,7 @@ c_bind(const char **wp) wp += builtin_opt.optind; if (*wp == NULL) /* list all */ - rv = x_bind((char*)NULL, (char*)NULL, 0, list); + rv = x_bind(NULL, NULL, 0, list); for (; *wp != NULL; wp++) { if ((cp = cstrchr(*wp, '=')) == NULL) diff --git a/sh.h b/sh.h index b59f3d7..cd8b8ea 100644 --- a/sh.h +++ b/sh.h @@ -102,9 +102,9 @@ #define __SCCSID(x) __IDSTRING(sccsid,x) #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.275 2009/03/14 18:12:54 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.276 2009/03/15 16:13:40 tg Exp $"); #endif -#define MKSH_VERSION "R36 2009/03/14" +#define MKSH_VERSION "R36 2009/03/15" #ifndef MKSH_INCLUDES_ONLY @@ -1272,13 +1272,12 @@ void afree(void *, Area *); /* can take NULL */ /* edit.c */ void x_init(void); int x_read(char *, size_t); -int x_bind(const char *, const char *, int, int); +int x_bind(const char *, const char *, bool, bool); /* UTF-8 stuff */ size_t utf_mbtowc(unsigned int *, const char *); size_t utf_wctomb(char *, unsigned int); int utf_widthadj(const char *, const char **); int utf_mbswidth(const char *); -int utf_wcwidth(unsigned int); const char *utf_skipcols(const char *, int); /* eval.c */ char *substitute(const char *, int);