[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 9/9] convert many more globals to static
From: |
Jim Meyering |
Subject: |
[Qemu-devel] [PATCH 9/9] convert many more globals to static |
Date: |
Mon, 21 May 2012 21:56:24 +0200 |
From: Jim Meyering <address@hidden>
Minor exceptions:
* arm-dis: move now-detected-as-unused static variables into #if-0'd
block of code where they *are* used.
* microblaze: remove decls of now-detected-as-unused vars
Signed-off-by: Jim Meyering <address@hidden>
---
arm-dis.c | 8 ++---
cpus.c | 4 +--
cris-dis.c | 2 +-
hw/9pfs/virtio-9p-synth.c | 2 +-
hw/ide/pci.c | 2 +-
hw/leon3.c | 2 +-
hw/mips_fulong2e.c | 2 +-
hw/s390-virtio-bus.c | 2 +-
hw/spapr_rtas.c | 2 +-
hw/xen_platform.c | 2 +-
hw/xgmac.c | 2 +-
m68k-dis.c | 79 ++++++++++++++++++++++++-----------------------
memory.c | 2 +-
microblaze-dis.c | 6 ++--
ppc-dis.c | 26 ++++++++--------
sh4-dis.c | 2 +-
target-cris/translate.c | 2 +-
target-i386/cpu.c | 4 +--
target-i386/kvm.c | 2 +-
tests/fdc-test.c | 2 +-
vl.c | 12 ++++---
21 files changed, 84 insertions(+), 83 deletions(-)
diff --git a/arm-dis.c b/arm-dis.c
index 6bc4d71..43f0253 100644
--- a/arm-dis.c
+++ b/arm-dis.c
@@ -1545,10 +1545,6 @@ enum map_type {
MAP_DATA
};
-enum map_type last_type;
-int last_mapping_sym = -1;
-bfd_vma last_mapping_addr = 0;
-
/* Decode a bitfield of the form matching regexp (N(-N)?,)*N(-N)?.
Returns pointer to following character of the format string and
fills in *VALUEP and *WIDTHP with the extracted value and number of
@@ -3877,6 +3873,10 @@ print_insn_arm (bfd_vma pc, struct disassemble_info
*info)
#if 0
bfd_boolean found = false;
+ static enum map_type last_type;
+ static int last_mapping_sym = -1;
+ static bfd_vma last_mapping_addr;
+
if (info->disassembler_options)
{
parse_disassembler_options (info->disassembler_options);
diff --git a/cpus.c b/cpus.c
index b182b3d..d5cd318 100644
--- a/cpus.c
+++ b/cpus.c
@@ -84,7 +84,7 @@ typedef struct TimersState {
int64_t dummy;
} TimersState;
-TimersState timers_state;
+static TimersState timers_state;
/* Return the virtual CPU time, based on the instruction counter. */
int64_t cpu_get_icount(void)
@@ -611,7 +611,7 @@ static void qemu_tcg_init_cpu_signals(void)
}
#endif /* _WIN32 */
-QemuMutex qemu_global_mutex;
+static QemuMutex qemu_global_mutex;
static QemuCond qemu_io_proceeded_cond;
static bool iothread_requesting_mutex;
diff --git a/cris-dis.c b/cris-dis.c
index 1d174ba..89ae0b7 100644
--- a/cris-dis.c
+++ b/cris-dis.c
@@ -1215,7 +1215,7 @@ cris_cc_strings[] =
};
/* Different names and semantics for condition 1111 (0xf). */
-const struct cris_cond15 cris_cond15s[] =
+static const struct cris_cond15 cris_cond15s[] =
{
/* FIXME: In what version did condition "ext" disappear? */
{"ext", cris_ver_v0_3},
diff --git a/hw/9pfs/virtio-9p-synth.c b/hw/9pfs/virtio-9p-synth.c
index 92e0b09..7a15da2 100644
--- a/hw/9pfs/virtio-9p-synth.c
+++ b/hw/9pfs/virtio-9p-synth.c
@@ -21,7 +21,7 @@
#include <sys/stat.h>
/* Root node for synth file system */
-V9fsSynthNode v9fs_synth_root = {
+static V9fsSynthNode v9fs_synth_root = {
.name = "/",
.actual_attr = {
.mode = 0555 | S_IFDIR,
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 88c0942..ac22d56 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -419,7 +419,7 @@ static const VMStateDescription vmstate_bmdma_current = {
}
};
-const VMStateDescription vmstate_bmdma_status = {
+static const VMStateDescription vmstate_bmdma_status = {
.name ="ide bmdma/status",
.version_id = 1,
.minimum_version_id = 1,
diff --git a/hw/leon3.c b/hw/leon3.c
index 0a5ff16..4d9cd68 100644
--- a/hw/leon3.c
+++ b/hw/leon3.c
@@ -208,7 +208,7 @@ static void leon3_generic_hw_init(ram_addr_t ram_size,
}
}
-QEMUMachine leon3_generic_machine = {
+static QEMUMachine leon3_generic_machine = {
.name = "leon3_generic",
.desc = "Leon-3 generic",
.init = leon3_generic_hw_init,
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c
index 1a8df10..b266141 100644
--- a/hw/mips_fulong2e.c
+++ b/hw/mips_fulong2e.c
@@ -389,7 +389,7 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const
char *boot_device,
network_init();
}
-QEMUMachine mips_fulong2e_machine = {
+static QEMUMachine mips_fulong2e_machine = {
.name = "fulong2e",
.desc = "Fulong 2e mini pc",
.init = mips_fulong2e_init,
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 63ccd5c..114f131 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -45,7 +45,7 @@
#define VIRTIO_EXT_CODE 0x2603
-struct BusInfo s390_virtio_bus_info = {
+static struct BusInfo s390_virtio_bus_info = {
.name = "s390-virtio",
.size = sizeof(VirtIOS390Bus),
};
diff --git a/hw/spapr_rtas.c b/hw/spapr_rtas.c
index ae18595..315d0fb 100644
--- a/hw/spapr_rtas.c
+++ b/hw/spapr_rtas.c
@@ -204,7 +204,7 @@ static struct rtas_call {
spapr_rtas_fn fn;
} rtas_table[TOKEN_MAX];
-struct rtas_call *rtas_next = rtas_table;
+static struct rtas_call *rtas_next = rtas_table;
target_ulong spapr_rtas_call(sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs, target_ulong args,
diff --git a/hw/xen_platform.c b/hw/xen_platform.c
index a9c52a6..562faf7 100644
--- a/hw/xen_platform.c
+++ b/hw/xen_platform.c
@@ -224,7 +224,7 @@ static void platform_fixed_ioport_reset(void *opaque)
platform_fixed_ioport_writeb(s, 0, 0);
}
-const MemoryRegionPortio xen_platform_ioport[] = {
+static const MemoryRegionPortio xen_platform_ioport[] = {
{ 0, 16, 4, .write = platform_fixed_ioport_writel, },
{ 0, 16, 2, .write = platform_fixed_ioport_writew, },
{ 0, 16, 1, .write = platform_fixed_ioport_writeb, },
diff --git a/hw/xgmac.c b/hw/xgmac.c
index dd4bdc4..47ee557 100644
--- a/hw/xgmac.c
+++ b/hw/xgmac.c
@@ -148,7 +148,7 @@ typedef struct XgmacState {
uint32_t regs[R_MAX];
} XgmacState;
-const VMStateDescription vmstate_rxtx_stats = {
+static const VMStateDescription vmstate_rxtx_stats = {
.name = "xgmac_stats",
.version_id = 1,
.minimum_version_id = 1,
diff --git a/m68k-dis.c b/m68k-dis.c
index 2b155de..20d0a3f 100644
--- a/m68k-dis.c
+++ b/m68k-dis.c
@@ -96,29 +96,29 @@ struct floatformat
/* floatformats for IEEE single and double, big and little endian. */
-extern const struct floatformat floatformat_ieee_single_big;
-extern const struct floatformat floatformat_ieee_single_little;
-extern const struct floatformat floatformat_ieee_double_big;
-extern const struct floatformat floatformat_ieee_double_little;
+static const struct floatformat floatformat_ieee_single_big;
+static const struct floatformat floatformat_ieee_single_little;
+static const struct floatformat floatformat_ieee_double_big;
+static const struct floatformat floatformat_ieee_double_little;
/* floatformat for ARM IEEE double, little endian bytes and big endian words */
-extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
+static const struct floatformat floatformat_ieee_double_littlebyte_bigword;
/* floatformats for various extendeds. */
-extern const struct floatformat floatformat_i387_ext;
-extern const struct floatformat floatformat_m68881_ext;
-extern const struct floatformat floatformat_i960_ext;
-extern const struct floatformat floatformat_m88110_ext;
-extern const struct floatformat floatformat_m88110_harris_ext;
-extern const struct floatformat floatformat_arm_ext_big;
-extern const struct floatformat floatformat_arm_ext_littlebyte_bigword;
+static const struct floatformat floatformat_i387_ext;
+static const struct floatformat floatformat_m68881_ext;
+static const struct floatformat floatformat_i960_ext;
+static const struct floatformat floatformat_m88110_ext;
+static const struct floatformat floatformat_m88110_harris_ext;
+static const struct floatformat floatformat_arm_ext_big;
+static const struct floatformat floatformat_arm_ext_littlebyte_bigword;
/* IA-64 Floating Point register spilt into memory. */
-extern const struct floatformat floatformat_ia64_spill_big;
-extern const struct floatformat floatformat_ia64_spill_little;
-extern const struct floatformat floatformat_ia64_quad_big;
-extern const struct floatformat floatformat_ia64_quad_little;
+static const struct floatformat floatformat_ia64_spill_big;
+static const struct floatformat floatformat_ia64_spill_little;
+static const struct floatformat floatformat_ia64_quad_big;
+static const struct floatformat floatformat_ia64_quad_little;
/* Convert from FMT to a double.
FROM is the address of the extended float.
@@ -515,10 +515,11 @@ struct m68k_opcode_alias
] first word, bit 10
*/
-extern const struct m68k_opcode m68k_opcodes[];
-extern const struct m68k_opcode_alias m68k_opcode_aliases[];
+static const struct m68k_opcode m68k_opcodes[];
+static const struct m68k_opcode_alias m68k_opcode_aliases[];
-extern const int m68k_numopcodes, m68k_numaliases;
+static const int m68k_numopcodes;
+static const int m68k_numaliases;
/* **** End of m68k-opcode.h */
/* **** m68k-dis.c from sourceware.org CVS 2005-08-14. */
@@ -2059,7 +2060,7 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
be consecutive. If they aren't, the assembler will bomb at
runtime. */
-const struct m68k_opcode m68k_opcodes[] =
+static const struct m68k_opcode m68k_opcodes[] =
{
{"abcd", 2, one(0140400), one(0170770), "DsDd", m68000up },
{"abcd", 2, one(0140410), one(0170770), "-s-d", m68000up },
@@ -4199,7 +4200,7 @@ TBL("tblunb", "tblunw", "tblunl", 0, 0),
{"wdebug", 4, two(0175750, 03), two(0177770, 0xffff), "ds", mcfisa_a },
};
-const int m68k_numopcodes = sizeof m68k_opcodes / sizeof m68k_opcodes[0];
+static const int m68k_numopcodes = sizeof m68k_opcodes / sizeof
m68k_opcodes[0];
/* These aliases used to be in the above table, each one duplicating
all of the entries for its primary exactly. This table was
@@ -4208,7 +4209,7 @@ const int m68k_numopcodes = sizeof m68k_opcodes / sizeof
m68k_opcodes[0];
aliases above that could be moved down here, except for very minor
differences. */
-const struct m68k_opcode_alias m68k_opcode_aliases[] =
+static const struct m68k_opcode_alias m68k_opcode_aliases[] =
{
{ "add", "addw", },
{ "adda", "addaw", },
@@ -4452,7 +4453,7 @@ const struct m68k_opcode_alias m68k_opcode_aliases[] =
};
-const int m68k_numaliases =
+static const int m68k_numaliases =
sizeof m68k_opcode_aliases / sizeof m68k_opcode_aliases[0];
/* **** End of m68k-opc.c */
/* **** floatformat.c from sourceware.org CVS 2005-08-14. */
@@ -4510,28 +4511,28 @@ floatformat_always_valid (const struct floatformat *fmt
ATTRIBUTE_UNUSED,
#define FLOATFORMAT_CHAR_BIT 8
/* floatformats for IEEE single and double, big and little endian. */
-const struct floatformat floatformat_ieee_single_big =
+static const struct floatformat floatformat_ieee_single_big =
{
floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23,
floatformat_intbit_no,
"floatformat_ieee_single_big",
floatformat_always_valid
};
-const struct floatformat floatformat_ieee_single_little =
+static const struct floatformat floatformat_ieee_single_little =
{
floatformat_little, 32, 0, 1, 8, 127, 255, 9, 23,
floatformat_intbit_no,
"floatformat_ieee_single_little",
floatformat_always_valid
};
-const struct floatformat floatformat_ieee_double_big =
+static const struct floatformat floatformat_ieee_double_big =
{
floatformat_big, 64, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
"floatformat_ieee_double_big",
floatformat_always_valid
};
-const struct floatformat floatformat_ieee_double_little =
+static const struct floatformat floatformat_ieee_double_little =
{
floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
@@ -4542,7 +4543,7 @@ const struct floatformat floatformat_ieee_double_little =
/* floatformat for IEEE double, little endian byte order, with big endian word
ordering, as on the ARM. */
-const struct floatformat floatformat_ieee_double_littlebyte_bigword =
+static const struct floatformat floatformat_ieee_double_littlebyte_bigword =
{
floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
@@ -4573,14 +4574,14 @@ floatformat_i387_ext_is_valid (const struct floatformat
*fmt, const char *from)
return 1;
}
-const struct floatformat floatformat_i387_ext =
+static const struct floatformat floatformat_i387_ext =
{
floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
floatformat_intbit_yes,
"floatformat_i387_ext",
floatformat_i387_ext_is_valid
};
-const struct floatformat floatformat_m68881_ext =
+static const struct floatformat floatformat_m68881_ext =
{
/* Note that the bits from 16 to 31 are unused. */
floatformat_big, 96, 0, 1, 15, 0x3fff, 0x7fff, 32, 64,
@@ -4588,7 +4589,7 @@ const struct floatformat floatformat_m68881_ext =
"floatformat_m68881_ext",
floatformat_always_valid
};
-const struct floatformat floatformat_i960_ext =
+static const struct floatformat floatformat_i960_ext =
{
/* Note that the bits from 0 to 15 are unused. */
floatformat_little, 96, 16, 17, 15, 0x3fff, 0x7fff, 32, 64,
@@ -4596,14 +4597,14 @@ const struct floatformat floatformat_i960_ext =
"floatformat_i960_ext",
floatformat_always_valid
};
-const struct floatformat floatformat_m88110_ext =
+static const struct floatformat floatformat_m88110_ext =
{
floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
floatformat_intbit_yes,
"floatformat_m88110_ext",
floatformat_always_valid
};
-const struct floatformat floatformat_m88110_harris_ext =
+static const struct floatformat floatformat_m88110_harris_ext =
{
/* Harris uses raw format 128 bytes long, but the number is just an ieee
double, and the last 64 bits are wasted. */
@@ -4612,7 +4613,7 @@ const struct floatformat floatformat_m88110_harris_ext =
"floatformat_m88110_ext_harris",
floatformat_always_valid
};
-const struct floatformat floatformat_arm_ext_big =
+static const struct floatformat floatformat_arm_ext_big =
{
/* Bits 1 to 16 are unused. */
floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
@@ -4620,7 +4621,7 @@ const struct floatformat floatformat_arm_ext_big =
"floatformat_arm_ext_big",
floatformat_always_valid
};
-const struct floatformat floatformat_arm_ext_littlebyte_bigword =
+static const struct floatformat floatformat_arm_ext_littlebyte_bigword =
{
/* Bits 1 to 16 are unused. */
floatformat_littlebyte_bigword, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
@@ -4628,28 +4629,28 @@ const struct floatformat
floatformat_arm_ext_littlebyte_bigword =
"floatformat_arm_ext_littlebyte_bigword",
floatformat_always_valid
};
-const struct floatformat floatformat_ia64_spill_big =
+static const struct floatformat floatformat_ia64_spill_big =
{
floatformat_big, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64,
floatformat_intbit_yes,
"floatformat_ia64_spill_big",
floatformat_always_valid
};
-const struct floatformat floatformat_ia64_spill_little =
+static const struct floatformat floatformat_ia64_spill_little =
{
floatformat_little, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64,
floatformat_intbit_yes,
"floatformat_ia64_spill_little",
floatformat_always_valid
};
-const struct floatformat floatformat_ia64_quad_big =
+static const struct floatformat floatformat_ia64_quad_big =
{
floatformat_big, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
floatformat_intbit_no,
"floatformat_ia64_quad_big",
floatformat_always_valid
};
-const struct floatformat floatformat_ia64_quad_little =
+static const struct floatformat floatformat_ia64_quad_little =
{
floatformat_little, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
floatformat_intbit_no,
diff --git a/memory.c b/memory.c
index aab4a31..cf6c2e2 100644
--- a/memory.c
+++ b/memory.c
@@ -23,7 +23,7 @@
#define WANT_EXEC_OBSOLETE
#include "exec-obsolete.h"
-unsigned memory_region_transaction_depth = 0;
+static unsigned memory_region_transaction_depth;
static bool memory_region_update_pending = false;
static bool global_dirty_log = false;
diff --git a/microblaze-dis.c b/microblaze-dis.c
index 16c312f..71810e5 100644
--- a/microblaze-dis.c
+++ b/microblaze-dis.c
@@ -567,10 +567,8 @@ struct op_code_struct {
};
/* prefix for register names */
-char register_prefix[] = "r";
-char special_register_prefix[] = "spr";
-char fsl_register_prefix[] = "rfsl";
-char pvr_register_prefix[] = "rpvr";
+static char register_prefix[] = "r";
+static char fsl_register_prefix[] = "rfsl";
/* #defines for valid immediate range */
diff --git a/ppc-dis.c b/ppc-dis.c
index bc98cbe..89ce7a6 100644
--- a/ppc-dis.c
+++ b/ppc-dis.c
@@ -73,8 +73,8 @@ struct powerpc_opcode
/* The table itself is sorted by major opcode number, and is otherwise
in the order in which the disassembler should consider
instructions. */
-extern const struct powerpc_opcode powerpc_opcodes[];
-extern const int powerpc_num_opcodes;
+static const struct powerpc_opcode powerpc_opcodes[];
+static const int powerpc_num_opcodes;
/* Values defined for the flags field of a struct powerpc_opcode. */
@@ -224,8 +224,8 @@ struct powerpc_operand
/* Elements in the table are retrieved by indexing with values from
the operands field of the powerpc_opcodes table. */
-extern const struct powerpc_operand powerpc_operands[];
-extern const unsigned int num_powerpc_operands;
+static const struct powerpc_operand powerpc_operands[];
+static const unsigned int num_powerpc_operands;
/* Values defined for the flags field of a struct powerpc_operand. */
@@ -340,8 +340,8 @@ struct powerpc_macro
const char *format;
};
-extern const struct powerpc_macro powerpc_macros[];
-extern const int powerpc_num_macros;
+static const struct powerpc_macro powerpc_macros[];
+static const int powerpc_num_macros;
/* ppc-opc.c -- PowerPC opcode list
Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
@@ -424,7 +424,7 @@ static long extract_tbr (unsigned long, int, int *);
omit the parens, since the macros are never used in a context where
the addition will be ambiguous. */
-const struct powerpc_operand powerpc_operands[] =
+static const struct powerpc_operand powerpc_operands[] =
{
/* The zero index is used to indicate the end of the list of
operands. */
@@ -892,8 +892,8 @@ const struct powerpc_operand powerpc_operands[] =
{ 0x1, 25, NULL, NULL, PPC_OPERAND_OPTIONAL},
};
-const unsigned int num_powerpc_operands = (sizeof (powerpc_operands)
- / sizeof (powerpc_operands[0]));
+static const unsigned int num_powerpc_operands = (sizeof powerpc_operands
+ / sizeof
powerpc_operands[0]);
/* The functions used to insert and extract complicated operands. */
@@ -2004,7 +2004,7 @@ extract_tbr (unsigned long insn,
specific instructions before more general instructions. It is also
sorted by major opcode. */
-const struct powerpc_opcode powerpc_opcodes[] = {
+static const struct powerpc_opcode powerpc_opcodes[] = {
{ "attn", X(0,256), X_MASK, POWER4, { 0 } },
{ "tdlgti", OPTO(2,TOLGT), OPTO_MASK, PPC64, { RA, SI } },
{ "tdllti", OPTO(2,TOLLT), OPTO_MASK, PPC64, { RA, SI } },
@@ -5014,7 +5014,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
};
-const int powerpc_num_opcodes =
+static const int powerpc_num_opcodes =
sizeof (powerpc_opcodes) / sizeof (powerpc_opcodes[0]);
/* The macro table. This is only used by the assembler. */
@@ -5029,7 +5029,7 @@ const int powerpc_num_opcodes =
the underlying instructions don't support extracting 0 bits but do
support extracting the whole word (32 bits in this case). */
-const struct powerpc_macro powerpc_macros[] = {
+static const struct powerpc_macro powerpc_macros[] = {
{ "extldi", 4, PPC64, "rldicr %0,%1,%3,(%2)-1" },
{ "extldi.", 4, PPC64, "rldicr. %0,%1,%3,(%2)-1" },
{ "extrdi", 4, PPC64, "rldicl %0,%1,(%2)+(%3),64-(%2)" },
@@ -5071,7 +5071,7 @@ const struct powerpc_macro powerpc_macros[] = {
{ "clrlslwi.",4, PPCCOM, "rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)" },
};
-const int powerpc_num_macros =
+static const int powerpc_num_macros =
sizeof (powerpc_macros) / sizeof (powerpc_macros[0]);
diff --git a/sh4-dis.c b/sh4-dis.c
index 673bc78..e9261ff 100644
--- a/sh4-dis.c
+++ b/sh4-dis.c
@@ -332,7 +332,7 @@ typedef struct
#ifdef DEFINE_TABLE
-const sh_opcode_info sh_table[] =
+static const sh_opcode_info sh_table[] =
{
/* 0111nnnni8*1.... add #<imm>,<REG_N>
*/{"add",{A_IMM,A_REG_N},{HEX_7,REG_N,IMM0_8}, arch_sh1_up},
diff --git a/target-cris/translate.c b/target-cris/translate.c
index e353ea3..0d0796c 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -3470,7 +3470,7 @@ void cpu_dump_state (CPUCRISState *env, FILE *f,
fprintf_function cpu_fprintf,
}
-struct
+static const struct
{
uint32_t vr;
const char *name;
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 89b4ac7..3f61dd5 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -104,8 +104,8 @@ typedef struct model_features_t {
uint32_t cpuid;
} model_features_t;
-int check_cpuid = 0;
-int enforce_cpuid = 0;
+static int check_cpuid;
+static int enforce_cpuid;
void host_cpuid(uint32_t function, uint32_t count,
uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index e74a9e4..6f2f07f 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -90,7 +90,7 @@ static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
return cpuid;
}
-struct kvm_para_features {
+static const struct kvm_para_features {
int cap;
int feature;
} para_features[] = {
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 5b5dd74..4d06787 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -58,7 +58,7 @@ enum {
DSKCHG = 0x80,
};
-char test_image[] = "/tmp/qtest.XXXXXX";
+static char test_image[] = "/tmp/qtest.XXXXXX";
#define assert_bit_set(data, mask) g_assert_cmphex((data) & (mask), ==, (mask))
#define assert_bit_clear(data, mask) g_assert_cmphex((data) & (mask), ==, 0)
diff --git a/vl.c b/vl.c
index 23ab3a3..beb5cca 100644
--- a/vl.c
+++ b/vl.c
@@ -179,7 +179,7 @@ static const char *data_dir;
const char *bios_name = NULL;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
DisplayType display_type = DT_DEFAULT;
-int display_remote = 0;
+static int display_remote;
const char* keyboard_layout = NULL;
ram_addr_t ram_size;
const char *mem_path = NULL;
@@ -200,7 +200,7 @@ static int no_frame = 0;
int no_quit = 0;
CharDriverState *serial_hds[MAX_SERIAL_PORTS];
CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
-CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
+static const CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
int win2k_install_hack = 0;
int usb_enabled = 0;
int singlestep = 0;
@@ -214,7 +214,7 @@ const char *vnc_display;
int acpi_enabled = 1;
int no_hpet = 0;
int fd_bootchk = 1;
-int no_reboot = 0;
+static int no_reboot;
int no_shutdown = 0;
int cursor_hide = 1;
int graphic_rotate = 0;
@@ -242,7 +242,8 @@ struct FWBootEntry {
char *suffix;
};
-QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
QTAILQ_HEAD_INITIALIZER(fw_boot_order);
+static QTAILQ_HEAD(, FWBootEntry) fw_boot_order =
+ QTAILQ_HEAD_INITIALIZER(fw_boot_order);
int nb_numa_nodes;
uint64_t node_mem[MAX_NODES];
@@ -1947,7 +1948,8 @@ struct device_config {
Location loc;
QTAILQ_ENTRY(device_config) next;
};
-QTAILQ_HEAD(, device_config) device_configs =
QTAILQ_HEAD_INITIALIZER(device_configs);
+static QTAILQ_HEAD(, device_config) device_configs =
+ QTAILQ_HEAD_INITIALIZER(device_configs);
static void add_device_config(int type, const char *cmdline)
{
--
1.7.10.2.552.gaa3bb87
- Re: [Qemu-devel] [PATCH 2/9] tcg: declare __jit_debug_descriptor to be static, (continued)
[Qemu-devel] [PATCH 3/9] alpha-dis: remove unused global; declare others to be static, Jim Meyering, 2012/05/21
[Qemu-devel] [PATCH 3/9] alpha-dis: remove unused global; declare others to be static, Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 6/9] sheepdog: declare bdrv_sheepdog to be static, Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 5/9] ccid: make backend_enum_table "static const" and adjust users, Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 4/9] linux-user: arg_table need not have global scope, Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 7/9] mips-dis: declare four globals to be "static", Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 8/9] bonito: declare bonito_state to be static, Jim Meyering, 2012/05/21
- [Qemu-devel] [PATCH 9/9] convert many more globals to static,
Jim Meyering <=