rename more identifiers with trailing underscores

This commit is contained in:
tg 2011-10-25 22:36:39 +00:00
parent cd7dab250b
commit fed31331f4
5 changed files with 39 additions and 39 deletions

34
lex.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.156 2011/09/07 15:24:16 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/lex.c,v 1.157 2011/10/25 22:36:36 tg Exp $");
/* /*
* states while lexing word * states while lexing word
@ -90,7 +90,7 @@ typedef struct {
static void readhere(struct ioword *); static void readhere(struct ioword *);
static void ungetsc(int); static void ungetsc(int);
static void ungetsc_(int); static void ungetsc_i(int);
static int getsc_uu(void); static int getsc_uu(void);
static void getsc_line(Source *); static void getsc_line(Source *);
static int getsc_bn(void); static int getsc_bn(void);
@ -99,8 +99,8 @@ static void s_put(int);
static char *get_brace_var(XString *, char *); static char *get_brace_var(XString *, char *);
static bool arraysub(char **); static bool arraysub(char **);
static void gethere(bool); static void gethere(bool);
static Lex_state *push_state_(State_info *, Lex_state *); static Lex_state *push_state_i(State_info *, Lex_state *);
static Lex_state *pop_state_(State_info *, Lex_state *); static Lex_state *pop_state_i(State_info *, Lex_state *);
static int dopprompt(const char *, int, bool); static int dopprompt(const char *, int, bool);
void yyskiputf8bom(void); void yyskiputf8bom(void);
@ -154,13 +154,13 @@ getsc_r(int c)
#define PUSH_STATE(s) do { \ #define PUSH_STATE(s) do { \
if (++statep == state_info.end) \ if (++statep == state_info.end) \
statep = push_state_(&state_info, statep); \ statep = push_state_i(&state_info, statep); \
state = statep->type = (s); \ state = statep->type = (s); \
} while (/* CONSTCOND */ 0) } while (/* CONSTCOND */ 0)
#define POP_STATE() do { \ #define POP_STATE() do { \
if (--statep == state_info.base) \ if (--statep == state_info.base) \
statep = pop_state_(&state_info, statep); \ statep = pop_state_i(&state_info, statep); \
state = statep->type; \ state = statep->type; \
} while (/* CONSTCOND */ 0) } while (/* CONSTCOND */ 0)
@ -1727,10 +1727,10 @@ ungetsc(int c)
rp->xp--; rp->xp--;
rp = rp->next; rp = rp->next;
} }
ungetsc_(c); ungetsc_i(c);
} }
static void static void
ungetsc_(int c) ungetsc_i(int c)
{ {
if (source->str > source->start) if (source->str > source->start)
source->str--; source->str--;
@ -1768,7 +1768,7 @@ getsc_bn(void)
if ((c2 = o_getsc_u()) == '\n') if ((c2 = o_getsc_u()) == '\n')
/* ignore the \newline; get the next char... */ /* ignore the \newline; get the next char... */
continue; continue;
ungetsc_(c2); ungetsc_i(c2);
backslash_skip = 1; backslash_skip = 1;
} }
return (c); return (c);
@ -1781,25 +1781,25 @@ yyskiputf8bom(void)
int c; int c;
if ((unsigned char)(c = o_getsc_u()) != 0xEF) { if ((unsigned char)(c = o_getsc_u()) != 0xEF) {
ungetsc_(c); ungetsc_i(c);
return; return;
} }
if ((unsigned char)(c = o_getsc_u()) != 0xBB) { if ((unsigned char)(c = o_getsc_u()) != 0xBB) {
ungetsc_(c); ungetsc_i(c);
ungetsc_(0xEF); ungetsc_i(0xEF);
return; return;
} }
if ((unsigned char)(c = o_getsc_u()) != 0xBF) { if ((unsigned char)(c = o_getsc_u()) != 0xBF) {
ungetsc_(c); ungetsc_i(c);
ungetsc_(0xBB); ungetsc_i(0xBB);
ungetsc_(0xEF); ungetsc_i(0xEF);
return; return;
} }
UTFMODE |= 8; UTFMODE |= 8;
} }
static Lex_state * static Lex_state *
push_state_(State_info *si, Lex_state *old_end) push_state_i(State_info *si, Lex_state *old_end)
{ {
Lex_state *news = alloc2(STATE_BSIZE, sizeof(Lex_state), ATEMP); Lex_state *news = alloc2(STATE_BSIZE, sizeof(Lex_state), ATEMP);
@ -1810,7 +1810,7 @@ push_state_(State_info *si, Lex_state *old_end)
} }
static Lex_state * static Lex_state *
pop_state_(State_info *si, Lex_state *old_end) pop_state_i(State_info *si, Lex_state *old_end)
{ {
Lex_state *old_base = si->base; Lex_state *old_base = si->base;

8
misc.c
View File

@ -29,7 +29,7 @@
#include <grp.h> #include <grp.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.175 2011/10/25 22:25:06 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/misc.c,v 1.176 2011/10/25 22:36:37 tg Exp $");
/* type bits for unsigned char */ /* type bits for unsigned char */
unsigned char chtypes[UCHAR_MAX + 1]; unsigned char chtypes[UCHAR_MAX + 1];
@ -2029,7 +2029,7 @@ stristr(const char *b, const char *l)
#ifdef MKSH_SMALL #ifdef MKSH_SMALL
char * char *
strndup_(const char *src, size_t len, Area *ap) strndup_i(const char *src, size_t len, Area *ap)
{ {
char *dst = NULL; char *dst = NULL;
@ -2042,9 +2042,9 @@ strndup_(const char *src, size_t len, Area *ap)
} }
char * char *
strdup_(const char *src, Area *ap) strdup_i(const char *src, Area *ap)
{ {
return (src == NULL ? NULL : strndup_(src, strlen(src), ap)); return (src == NULL ? NULL : strndup_i(src, strlen(src), ap));
} }
#endif #endif

22
sh.h
View File

@ -151,7 +151,7 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.497 2011/10/25 22:25:07 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.498 2011/10/25 22:36:37 tg Exp $");
#endif #endif
#define MKSH_VERSION "R40 2011/10/24" #define MKSH_VERSION "R40 2011/10/24"
@ -442,11 +442,11 @@ char *ucstrstr(char *, const char *);
} while (/* CONSTCOND */ 0) } while (/* CONSTCOND */ 0)
#ifdef MKSH_SMALL #ifdef MKSH_SMALL
#define strdupx(d, s, ap) do { \ #define strdupx(d, s, ap) do { \
(d) = strdup_((s), (ap)); \ (d) = strdup_i((s), (ap)); \
} while (/* CONSTCOND */ 0) } while (/* CONSTCOND */ 0)
#define strndupx(d, s, n, ap) do { \ #define strndupx(d, s, n, ap) do { \
(d) = strndup_((s), (n), (ap)); \ (d) = strndup_i((s), (n), (ap)); \
} while (/* CONSTCOND */ 0) } while (/* CONSTCOND */ 0)
#else #else
/* be careful to evaluate arguments only once! */ /* be careful to evaluate arguments only once! */
@ -896,10 +896,10 @@ EXTERN mksh_ari_t x_lins E_INIT(-1); /* tty lines */
#define shf_fileno(shf) ((shf)->fd) #define shf_fileno(shf) ((shf)->fd)
#define shf_setfileno(shf,nfd) ((shf)->fd = (nfd)) #define shf_setfileno(shf,nfd) ((shf)->fd = (nfd))
#define shf_getc_(shf) ((shf)->rnleft > 0 ? \ #define shf_getc_i(shf) ((shf)->rnleft > 0 ? \
(shf)->rnleft--, *(shf)->rp++ : \ (shf)->rnleft--, *(shf)->rp++ : \
shf_getchar(shf)) shf_getchar(shf))
#define shf_putc_(c, shf) ((shf)->wnleft == 0 ? \ #define shf_putc_i(c, shf) ((shf)->wnleft == 0 ? \
shf_putchar((c), (shf)) : \ shf_putchar((c), (shf)) : \
((shf)->wnleft--, *(shf)->wp++ = (c))) ((shf)->wnleft--, *(shf)->wp++ = (c)))
#define shf_eof(shf) ((shf)->flags & SHF_EOF) #define shf_eof(shf) ((shf)->flags & SHF_EOF)
@ -1772,8 +1772,8 @@ void simplify_path(char *);
void set_current_wd(const char *); void set_current_wd(const char *);
int c_cd(const char **); int c_cd(const char **);
#ifdef MKSH_SMALL #ifdef MKSH_SMALL
char *strdup_(const char *, Area *); char *strdup_i(const char *, Area *);
char *strndup_(const char *, size_t, Area *); char *strndup_i(const char *, size_t, Area *);
#endif #endif
int unbksl(bool, int (*)(void), void (*)(int)); int unbksl(bool, int (*)(void), void (*)(int));
/* shf.c */ /* shf.c */
@ -1793,8 +1793,8 @@ int shf_ungetc(int, struct shf *);
int shf_getc(struct shf *); int shf_getc(struct shf *);
int shf_putc(int, struct shf *); int shf_putc(int, struct shf *);
#else #else
#define shf_getc shf_getc_ #define shf_getc shf_getc_i
#define shf_putc shf_putc_ #define shf_putc shf_putc_i
#endif #endif
int shf_putchar(int, struct shf *); int shf_putchar(int, struct shf *);
ssize_t shf_puts(const char *, struct shf *); ssize_t shf_puts(const char *, struct shf *);

6
shf.c
View File

@ -24,7 +24,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.44 2011/09/07 15:24:20 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/shf.c,v 1.45 2011/10/25 22:36:38 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 */
@ -1046,12 +1046,12 @@ shf_vfprintf(struct shf *shf, const char *fmt, va_list args)
int int
shf_getc(struct shf *shf) shf_getc(struct shf *shf)
{ {
return (shf_getc_(shf)); return (shf_getc_i(shf));
} }
int int
shf_putc(int c, struct shf *shf) shf_putc(int c, struct shf *shf)
{ {
return (shf_putc_(c, shf)); return (shf_putc_i(c, shf));
} }
#endif #endif

8
tree.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.51 2011/09/07 15:24:21 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/tree.c,v 1.52 2011/10/25 22:36:39 tg Exp $");
#define INDENT 8 #define INDENT 8
@ -747,7 +747,7 @@ dumpchar(struct shf *shf, int c)
/* see: wdvarput */ /* see: wdvarput */
static const char * static const char *
dumpwdvar_(struct shf *shf, const char *wp, int quotelevel) dumpwdvar_i(struct shf *shf, const char *wp, int quotelevel)
{ {
int c; int c;
@ -799,7 +799,7 @@ dumpwdvar_(struct shf *shf, const char *wp, int quotelevel)
while ((c = *wp++) != 0) while ((c = *wp++) != 0)
dumpchar(shf, c); dumpchar(shf, c);
shf_putc('|', shf); shf_putc('|', shf);
wp = dumpwdvar_(shf, wp, 0); wp = dumpwdvar_i(shf, wp, 0);
break; break;
case CSUBST: case CSUBST:
shf_puts("]CSUBST(", shf); shf_puts("]CSUBST(", shf);
@ -826,7 +826,7 @@ dumpwdvar_(struct shf *shf, const char *wp, int quotelevel)
void void
dumpwdvar(struct shf *shf, const char *wp) dumpwdvar(struct shf *shf, const char *wp)
{ {
dumpwdvar_(shf, wp, 0); dumpwdvar_i(shf, wp, 0);
} }
void void