move bi_getn from misc.c to funcs.c and make it static

even antique gcc versions will usually inline it now
This commit is contained in:
tg 2012-05-04 20:08:25 +00:00
parent 4cc5fc3e29
commit 7c4bf78446
3 changed files with 14 additions and 15 deletions

13
funcs.c
View File

@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.212 2012/04/06 13:28:59 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.213 2012/05/04 20:08:24 tg Exp $");
#if HAVE_KILLPG
/*
@ -60,6 +60,17 @@ __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.212 2012/04/06 13:28:59 tg Exp $");
#define c_ulimit c_true
#endif
/* getn() that prints error */
static int
bi_getn(const char *as, int *ai)
{
int rv;
if (!(rv = getn(as, ai)))
bi_errorf("%s: %s", as, "bad number");
return (rv);
}
static int
c_true(const char **wp MKSH_A_UNUSED)
{

13
misc.c
View File

@ -30,7 +30,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.187 2012/04/06 12:59:27 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.188 2012/05/04 20:08:25 tg Exp $");
/* type bits for unsigned char */
unsigned char chtypes[UCHAR_MAX + 1];
@ -485,17 +485,6 @@ getn(const char *s, int *ai)
return (rv);
}
/* getn() that prints error */
int
bi_getn(const char *as, int *ai)
{
int rv;
if (!(rv = getn(as, ai)))
bi_errorf("%s: %s", as, "bad number");
return (rv);
}
/**
* pattern simplifications:
* - @(x) -> x (not @(x|y) though)

3
sh.h
View File

@ -152,7 +152,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.551 2012/04/27 16:16:23 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.552 2012/05/04 20:08:25 tg Exp $");
#endif
#define MKSH_VERSION "R40 2012/04/27"
@ -1772,7 +1772,6 @@ char *getoptions(void);
void change_flag(enum sh_flag, int, unsigned int);
int parse_args(const char **, int, bool *);
int getn(const char *, int *);
int bi_getn(const char *, int *);
int gmatchx(const char *, const char *, bool);
int has_globbing(const char *, const char *);
int xstrcmp(const void *, const void *);