shuffle declarations around (all shared between even only two files go into sh.h even if they’re not supposed to be used elsewhere) and make some static; libFirm/cparser has -Wmissing-declarations against it

This commit is contained in:
tg 2012-12-05 18:54:10 +00:00
parent cf807eb83a
commit d8a6ce41de
3 changed files with 10 additions and 14 deletions

5
lex.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.172 2012/11/30 20:19:12 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.173 2012/12/05 18:54:08 tg Exp $");
/*
* states while lexing word
@ -104,12 +104,9 @@ static Lex_state *push_state_i(State_info *, Lex_state *);
static Lex_state *pop_state_i(State_info *, Lex_state *);
static int dopprompt(const char *, int, bool);
void yyskiputf8bom(void);
static int backslash_skip;
static int ignore_backslash_newline;
struct sretrace_info *retrace_info = NULL;
int subshell_nesting_type = 0;
/* optimised getsc_bn() */
#define o_getsc() (*source->str != '\0' && *source->str != '\\' && \

6
sh.h
View File

@ -152,7 +152,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.612 2012/12/04 01:18:32 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.613 2012/12/05 18:54:09 tg Exp $");
#endif
#define MKSH_VERSION "R41 2012/12/03"
@ -651,7 +651,8 @@ enum sh_flag {
struct sretrace_info;
struct yyrecursive_state;
extern struct sretrace_info *retrace_info;
EXTERN struct sretrace_info *retrace_info E_INIT(NULL);
EXTERN int subshell_nesting_type E_INIT(0);
extern struct env {
ALLOC_ITEM alloc_INT; /* internal, do not touch */
@ -1797,6 +1798,7 @@ pid_t j_async(void);
int j_stopped_running(void);
/* lex.c */
int yylex(int);
void yyskiputf8bom(void);
void yyerror(const char *, ...)
MKSH_A_NORETURN
MKSH_A_FORMAT(__printf__, 1, 2);

13
syn.c
View File

@ -23,10 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.85 2012/11/30 20:19:15 tg Exp $");
extern int subshell_nesting_type;
extern void yyskiputf8bom(void);
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.86 2012/12/05 18:54:10 tg Exp $");
struct nesting_state {
int start_token; /* token than began nesting (eg, FOR) */
@ -771,7 +768,7 @@ block(int type, struct op *t1, struct op *t2, char **wp)
return (t);
}
const struct tokeninfo {
static const struct tokeninfo {
const char *name;
short val;
short reserved;
@ -973,9 +970,9 @@ const char *const dbtest_tokens[] = {
dbtest_or, dbtest_and, dbtest_not,
dbtest_oparen, dbtest_cparen
};
const char db_close[] = { CHAR, ']', CHAR, ']', EOS };
const char db_lthan[] = { CHAR, '<', EOS };
const char db_gthan[] = { CHAR, '>', EOS };
static const char db_close[] = { CHAR, ']', CHAR, ']', EOS };
static const char db_lthan[] = { CHAR, '<', EOS };
static const char db_gthan[] = { CHAR, '>', EOS };
/*
* Test if the current token is a whatever. Accepts the current token if