Received: from eggs.gnu.org ([2001:4830:134:3::10]:33799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCPi3-0007fG-5t for qemu-devel@nongnu.org; Sun, 09 Feb 2014 03:25:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCPhx-0004Ow-6V for qemu-devel@nongnu.org; Sun, 09 Feb 2014 03:25:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCPhw-0004Os-V0 for qemu-devel@nongnu.org; Sun, 09 Feb 2014 03:25:45 -0500 Date: Sun, 9 Feb 2014 06:25:39 -0200 From: Eduardo Habkost Message-ID: <20140209082539.GL28427@otherpad.lan.raisama.net> References: <1391445551-6561-1-git-send-email-pbonzini@redhat.com> <1391445551-6561-17-git-send-email-pbonzini@redhat.com> <52F6695A.7090801@suse.de> <52F6BEB1.2090606@redhat.com> <52F726D6.4090807@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52F726D6.4090807@redhat.com> Subject: [Qemu-devel] [PATCH] target-i386: Don't declare variables in the middle of blocks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Peter Maydell , QEMU Developers Some of my recent changes introduced variable declarations in the middle of code blocks. Fix the code so that it compiles without warnings when using -Wdeclaration-after-statement. Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 0e8812a..f36383a 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1143,6 +1143,7 @@ static void kvm_cpu_fill_host(x86_def_t *x86_cpu_def) { KVMState *s = kvm_state; uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; + FeatureWord w; assert(kvm_enabled()); @@ -1163,7 +1164,6 @@ static void kvm_cpu_fill_host(x86_def_t *x86_cpu_def) cpu_x86_fill_model_id(x86_cpu_def->model_id); - FeatureWord w; for (w = 0; w < FEATURE_WORDS; w++) { FeatureWordInfo *wi = &feature_word_info[w]; x86_cpu_def->features[w] = @@ -1821,6 +1821,8 @@ static void cpu_x86_register(X86CPU *cpu, const char *name, Error **errp) { CPUX86State *env = &cpu->env; x86_def_t def1, *def = &def1; + const char *vendor; + char host_vendor[CPUID_VENDOR_SZ + 1]; memset(def, 0, sizeof(*def)); @@ -1860,8 +1862,7 @@ static void cpu_x86_register(X86CPU *cpu, const char *name, Error **errp) * KVM's sysenter/syscall emulation in compatibility mode and * when doing cross vendor migration */ - const char *vendor = def->vendor; - char host_vendor[CPUID_VENDOR_SZ + 1]; + vendor = def->vendor; if (kvm_enabled()) { uint32_t ebx = 0, ecx = 0, edx = 0; host_cpuid(0, 0, NULL, &ebx, &ecx, &edx); -- 1.8.5.3