more static initialisers (verified using nm comparision between mksh

built with/-out "-ffunction-sections -fdata-sections -Wl,--gc-sections"
This commit is contained in:
tg 2011-04-22 12:15:42 +00:00
parent c0e1e7645a
commit 6c0255ecb2
4 changed files with 8 additions and 7 deletions

4
edit.c
View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.209 2011/04/22 12:10:13 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.210 2011/04/22 12:15:38 tg Exp $");
/*
* in later versions we might use libtermcap for this, but since external
@ -1186,7 +1186,7 @@ x_emacs(char *buf, size_t len)
static int
x_insert(int c)
{
static int left = 0, pos, save_arg;
static int left, pos, save_arg;
static char str[4];
/*

3
sh.h
View File

@ -151,7 +151,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.463 2011/04/17 12:24:44 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.464 2011/04/22 12:15:40 tg Exp $");
#endif
#define MKSH_VERSION "R39 2011/04/17"
@ -353,6 +353,7 @@ typedef uint32_t mksh_uari_t;
/* boolean type (no <stdbool.h> deliberately) */
typedef unsigned char mksh_bool;
#undef bool
/* false MUST equal 0 */
#undef false
#undef true
/* access macros for boolean type */

4
syn.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.60 2011/04/09 15:14:54 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.61 2011/04/22 12:15:42 tg Exp $");
extern short subshell_nesting_level;
@ -166,7 +166,7 @@ static struct ioword *
synio(int cf)
{
struct ioword *iop;
static struct ioword *nextiop = NULL;
static struct ioword *nextiop;
bool ishere;
if (nextiop != NULL) {

4
tree.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.43 2011/04/09 15:14:55 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.44 2011/04/22 12:15:42 tg Exp $");
#define INDENT 8
@ -35,7 +35,7 @@ static void iofree(struct ioword **, Area *);
static void wdstrip_internal(struct shf *, const char *, bool, bool);
/* "foo& ; bar" and "foo |& ; bar" are invalid */
static bool prevent_semicolon = false;
static bool prevent_semicolon;
/*
* print a command tree