Index: qemu/audio/audio.c
===================================================================
--- qemu.orig/audio/audio.c	2008-09-03 18:45:45.000000000 +0000
+++ qemu/audio/audio.c	2008-09-03 18:46:01.000000000 +0000
@@ -1850,7 +1850,6 @@
     }
     else {
         HWVoiceOut *hw;
-        CaptureVoiceOut *cap;
 
         cap = audio_calloc (AUDIO_FUNC, 1, sizeof (*cap));
         if (!cap) {
Index: qemu/audio/ossaudio.c
===================================================================
--- qemu.orig/audio/ossaudio.c	2008-09-03 18:46:51.000000000 +0000
+++ qemu/audio/ossaudio.c	2008-09-03 18:47:00.000000000 +0000
@@ -492,7 +492,6 @@
             oss_logerr (errno, "Failed to map %d bytes of DAC\n",
                         hw->samples << hw->info.shift);
         } else {
-            int err;
             int trig = 0;
             if (ioctl (fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
                 oss_logerr (errno, "SNDCTL_DSP_SETTRIGGER 0 failed\n");
Index: qemu/block-vvfat.c
===================================================================
--- qemu.orig/block-vvfat.c	2008-09-03 18:32:12.000000000 +0000
+++ qemu/block-vvfat.c	2008-09-03 18:55:16.000000000 +0000
@@ -644,7 +644,6 @@
     /* mangle duplicates */
     while(1) {
 	direntry_t* entry1=array_get(&(s->directory),directory_start);
-	int j;
 
 	for(;entry1<entry;entry1++)
 	    if(!is_long_name(entry1) && !memcmp(entry1->name,entry->name,11))
@@ -654,7 +653,6 @@
 
 	/* use all 8 characters of name */
 	if(entry->name[7]==' ') {
-	    int j;
 	    for(j=6;j>0 && entry->name[j]==' ';j--)
 		entry->name[j]='~';
 	}
@@ -691,7 +689,6 @@
 static int read_directory(BDRVVVFATState* s, int mapping_index)
 {
     mapping_t* mapping = array_get(&(s->mapping), mapping_index);
-    direntry_t* direntry;
     const char* dirname = mapping->path;
     int first_cluster = mapping->begin;
     int parent_index = mapping->info.dir.parent_mapping_index;
@@ -702,6 +699,7 @@
     DIR* dir=opendir(dirname);
     struct dirent* entry;
     int i;
+    direntry_t* direntry;
 
     assert(mapping->mode & MODE_DIRECTORY);
 
@@ -717,7 +715,6 @@
     while((entry=readdir(dir))) {
 	unsigned int length=strlen(dirname)+2+strlen(entry->d_name);
         char* buffer;
-	direntry_t* direntry;
         struct stat st;
 	int is_dot=!strcmp(entry->d_name,".");
 	int is_dotdot=!strcmp(entry->d_name,"..");
@@ -786,7 +783,7 @@
 
     /* fill with zeroes up to the end of the cluster */
     while(s->directory.next%(0x10*s->sectors_per_cluster)) {
-	direntry_t* direntry=array_get_next(&(s->directory));
+	direntry=array_get_next(&(s->directory));
 	memset(direntry,0,sizeof(direntry_t));
     }
 
@@ -1683,17 +1680,17 @@
 		 * This is horribly inefficient, but that is okay, since
 		 * it is rarely executed, if at all.
 		 */
-		int64_t offset = cluster2sector(s, cluster_num);
+		int64_t offset2 = cluster2sector(s, cluster_num);
 
 		vvfat_close_current_file(s);
 		for (i = 0; i < s->sectors_per_cluster; i++)
 		    if (!s->qcow->drv->bdrv_is_allocated(s->qcow,
-				offset + i, 1, &dummy)) {
+				offset2 + i, 1, &dummy)) {
 			if (vvfat_read(s->bs,
-				    offset, s->cluster_buffer, 1))
+				    offset2, s->cluster_buffer, 1))
 			    return -1;
 			if (s->qcow->drv->bdrv_write(s->qcow,
-				    offset, s->cluster_buffer, 1))
+				    offset2, s->cluster_buffer, 1))
 			    return -2;
 		    }
 	    }
@@ -2168,8 +2165,8 @@
 		factor * (old_cluster_count - new_cluster_count));
 
     for (c = first_cluster; !fat_eof(s, c); c = modified_fat_get(s, c)) {
-	void* direntry = array_get(&(s->directory), current_dir_index);
-	int ret = vvfat_read(s->bs, cluster2sector(s, c), direntry,
+	direntry = array_get(&(s->directory), current_dir_index);
+	ret = vvfat_read(s->bs, cluster2sector(s, c), direntry,
 		s->sectors_per_cluster);
 	if (ret)
 	    return ret;
@@ -2358,12 +2355,12 @@
 		direntry_t* direntry = array_get(&(s->directory),
 			mapping->info.dir.first_dir_index);
 		uint32_t c = mapping->begin;
-		int i = 0;
+		int diroffset = 0;
 
 		/* recurse */
 		while (!fat_eof(s, c)) {
 		    do {
-			direntry_t* d = direntry + i;
+			direntry_t* d = direntry + diroffset;
 
 			if (is_file(d) || (is_directory(d) && !is_dot(d))) {
 			    mapping_t* m = find_mapping_for_cluster(s,
@@ -2379,8 +2376,8 @@
 
 			    schedule_rename(s, m->begin, new_path);
 			}
-			i++;
-		    } while((i % (0x10 * s->sectors_per_cluster)) != 0);
+			diroffset++;
+		    } while((diroffset % (0x10 * s->sectors_per_cluster)) != 0);
 		    c = fat_get(s, c);
 		}
 	    }
@@ -2471,16 +2468,16 @@
 	    int begin = commit->param.new_file.first_cluster;
 	    mapping_t* mapping = find_mapping_for_cluster(s, begin);
 	    direntry_t* entry;
-	    int i;
+	    int j;
 
 	    /* find direntry */
-	    for (i = 0; i < s->directory.next; i++) {
-		entry = array_get(&(s->directory), i);
+	    for (j = 0; j < s->directory.next; j++) {
+		entry = array_get(&(s->directory), j);
 		if (is_file(entry) && begin_of_direntry(entry) == begin)
 		    break;
 	    }
 
-	    if (i >= s->directory.next) {
+	    if (j >= s->directory.next) {
 		fail = -6;
 		continue;
 	    }
@@ -2500,7 +2497,7 @@
 	    mapping->mode = MODE_NORMAL;
 	    mapping->info.file.offset = 0;
 
-	    if (commit_one_file(s, i, 0))
+	    if (commit_one_file(s, j, 0))
 		fail = -7;
 
 	    break;
Index: qemu/vnc.c
===================================================================
--- qemu.orig/vnc.c	2008-09-03 18:57:33.000000000 +0000
+++ qemu/vnc.c	2008-09-03 18:59:22.000000000 +0000
@@ -745,7 +745,6 @@
 
     while (vs->read_handler && vs->input.offset >= vs->read_handler_expect) {
 	size_t len = vs->read_handler_expect;
-	int ret;
 
 	ret = vs->read_handler(vs, vs->input.buffer, len);
 	if (vs->csock == -1)
Index: qemu/tcg/tcg.c
===================================================================
--- qemu.orig/tcg/tcg.c	2008-09-03 19:03:10.000000000 +0000
+++ qemu/tcg/tcg.c	2008-09-03 19:04:44.000000000 +0000
@@ -760,8 +760,6 @@
             nb_iargs = def->nb_iargs;
             nb_cargs = def->nb_cargs;
         } else if (c == INDEX_op_call) {
-            TCGArg arg;
-
             /* variable number of arguments */
             arg = *args++;
             nb_oargs = arg >> 16;
Index: qemu/vl.c
===================================================================
--- qemu.orig/vl.c	2008-09-03 19:00:11.000000000 +0000
+++ qemu/vl.c	2008-09-03 19:02:45.000000000 +0000
@@ -8687,9 +8687,9 @@
                 break;
             case QEMU_OPTION_echr:
                 {
-                    char *r;
-                    term_escape_char = strtol(optarg, &r, 0);
-                    if (r == optarg)
+                    char *optptr;
+                    term_escape_char = strtol(optarg, &optptr, 0);
+                    if (optptr == optarg)
                         printf("Bad argument to echr\n");
                     break;
                 }
Index: qemu/cpu-exec.c
===================================================================
--- qemu.orig/cpu-exec.c	2008-09-04 15:46:58.000000000 +0000
+++ qemu/cpu-exec.c	2008-09-04 15:47:28.000000000 +0000
@@ -334,7 +334,6 @@
             }
 #ifdef USE_KQEMU
             if (kqemu_is_ok(env) && env->interrupt_request == 0) {
-                int ret;
                 env->eflags = env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK);
                 ret = kqemu_cpu_exec(env);
                 /* put eflags in CPU temporary format */
Index: qemu/exec-all.h
===================================================================
--- qemu.orig/exec-all.h	2008-09-04 17:18:56.000000000 +0000
+++ qemu/exec-all.h	2008-09-04 17:19:56.000000000 +0000
@@ -345,16 +345,16 @@
 
 /* Deterministic execution requires that IO only be performed on the last
    instruction of a TB so that interrupts take effect immediately.  */
-static inline int can_do_io(CPUState *env)
+static inline int can_do_io(CPUState *env1)
 {
     if (!use_icount)
         return 1;
 
     /* If not executing code then assume we are ok.  */
-    if (!env->current_tb)
+    if (!env1->current_tb)
         return 1;
 
-    return env->can_do_io != 0;
+    return env1->can_do_io != 0;
 }
 #endif
 
@@ -376,16 +376,16 @@
 
 extern uint32_t kqemu_comm_base;
 
-static inline int kqemu_is_ok(CPUState *env)
+static inline int kqemu_is_ok(CPUState *env1)
 {
-    return(env->kqemu_enabled &&
-           (env->cr[0] & CR0_PE_MASK) &&
-           !(env->hflags & HF_INHIBIT_IRQ_MASK) &&
-           (env->eflags & IF_MASK) &&
-           !(env->eflags & VM_MASK) &&
-           (env->kqemu_enabled == 2 ||
-            ((env->hflags & HF_CPL_MASK) == 3 &&
-             (env->eflags & IOPL_MASK) != IOPL_MASK)));
+    return(env1->kqemu_enabled &&
+           (env1->cr[0] & CR0_PE_MASK) &&
+           !(env1->hflags & HF_INHIBIT_IRQ_MASK) &&
+           (env1->eflags & IF_MASK) &&
+           !(env1->eflags & VM_MASK) &&
+           (env1->kqemu_enabled == 2 ||
+            ((env1->hflags & HF_CPL_MASK) == 3 &&
+             (env1->eflags & IOPL_MASK) != IOPL_MASK)));
 }
 
 #endif
Index: qemu/target-sparc/op_helper.c
===================================================================
--- qemu.orig/target-sparc/op_helper.c	2008-09-04 17:25:03.000000000 +0000
+++ qemu/target-sparc/op_helper.c	2008-09-04 17:26:27.000000000 +0000
@@ -2792,9 +2792,9 @@
 };
 #endif
 
-void do_interrupt(CPUState *env)
+void do_interrupt(CPUState *env1)
 {
-    int intno = env->exception_index;
+    int intno = env1->exception_index;
 
 #ifdef DEBUG_PCALL
     if (loglevel & CPU_LOG_INT) {
@@ -2818,16 +2818,16 @@
         fprintf(logfile, "%6d: %s (v=%04x) pc=%016" PRIx64 " npc=%016" PRIx64
                 " SP=%016" PRIx64 "\n",
                 count, name, intno,
-                env->pc,
-                env->npc, env->regwptr[6]);
-        cpu_dump_state(env, logfile, fprintf, 0);
+                env1->pc,
+                env1->npc, env1->regwptr[6]);
+        cpu_dump_state(env1, logfile, fprintf, 0);
 #if 0
         {
             int i;
             uint8_t *ptr;
 
             fprintf(logfile, "       code=");
-            ptr = (uint8_t *)env->pc;
+            ptr = (uint8_t *)env1->pc;
             for(i = 0; i < 16; i++) {
                 fprintf(logfile, " %02x", ldub(ptr + i));
             }
@@ -2838,27 +2838,27 @@
     }
 #endif
 #if !defined(CONFIG_USER_ONLY)
-    if (env->tl >= env->maxtl) {
-        cpu_abort(env, "Trap 0x%04x while trap level (%d) >= MAXTL (%d),"
-                  " Error state", env->exception_index, env->tl, env->maxtl);
+    if (env1->tl >= env1->maxtl) {
+        cpu_abort(env1, "Trap 0x%04x while trap level (%d) >= MAXTL (%d),"
+                  " Error state", env1->exception_index, env1->tl, env1->maxtl);
         return;
     }
 #endif
-    if (env->tl < env->maxtl - 1) {
-        env->tl++;
+    if (env1->tl < env1->maxtl - 1) {
+        env1->tl++;
     } else {
-        env->pstate |= PS_RED;
-        if (env->tl < env->maxtl)
-            env->tl++;
+        env1->pstate |= PS_RED;
+        if (env1->tl < env1->maxtl)
+            env1->tl++;
     }
-    env->tsptr = &env->ts[env->tl & MAXTL_MASK];
-    env->tsptr->tstate = ((uint64_t)GET_CCR(env) << 32) |
-        ((env->asi & 0xff) << 24) | ((env->pstate & 0xf3f) << 8) |
-        GET_CWP64(env);
-    env->tsptr->tpc = env->pc;
-    env->tsptr->tnpc = env->npc;
-    env->tsptr->tt = intno;
-    if (!(env->def->features & CPU_FEATURE_GL)) {
+    env1->tsptr = &env1->ts[env1->tl & MAXTL_MASK];
+    env1->tsptr->tstate = ((uint64_t)GET_CCR(env1) << 32) |
+        ((env1->asi & 0xff) << 24) | ((env1->pstate & 0xf3f) << 8) |
+        GET_CWP64(env1);
+    env1->tsptr->tpc = env1->pc;
+    env1->tsptr->tnpc = env1->npc;
+    env1->tsptr->tt = intno;
+    if (!(env1->def->features & CPU_FEATURE_GL)) {
         switch (intno) {
         case TT_IVEC:
             change_pstate(PS_PEF | PS_PRIV | PS_IG);
@@ -2876,16 +2876,16 @@
         }
     }
     if (intno == TT_CLRWIN)
-        cpu_set_cwp(env, cpu_cwp_dec(env, env->cwp - 1));
+        cpu_set_cwp(env1, cpu_cwp_dec(env1, env1->cwp - 1));
     else if ((intno & 0x1c0) == TT_SPILL)
-        cpu_set_cwp(env, cpu_cwp_dec(env, env->cwp - env->cansave - 2));
+        cpu_set_cwp(env1, cpu_cwp_dec(env1, env1->cwp - env1->cansave - 2));
     else if ((intno & 0x1c0) == TT_FILL)
-        cpu_set_cwp(env, cpu_cwp_inc(env, env->cwp + 1));
-    env->tbr &= ~0x7fffULL;
-    env->tbr |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5);
-    env->pc = env->tbr;
-    env->npc = env->pc + 4;
-    env->exception_index = 0;
+        cpu_set_cwp(env1, cpu_cwp_inc(env1, env1->cwp + 1));
+    env1->tbr &= ~0x7fffULL;
+    env1->tbr |= ((env1->tl > 1) ? 1 << 14 : 0) | (intno << 5);
+    env1->pc = env1->tbr;
+    env1->npc = env1->pc + 4;
+    env1->exception_index = 0;
 }
 #else
 #ifdef DEBUG_PCALL
@@ -2923,9 +2923,9 @@
 };
 #endif
 
-void do_interrupt(CPUState *env)
+void do_interrupt(CPUState *env1)
 {
-    int cwp, intno = env->exception_index;
+    int cwp, intno = env1->exception_index;
 
 #ifdef DEBUG_PCALL
     if (loglevel & CPU_LOG_INT) {
@@ -2944,16 +2944,16 @@
 
         fprintf(logfile, "%6d: %s (v=%02x) pc=%08x npc=%08x SP=%08x\n",
                 count, name, intno,
-                env->pc,
-                env->npc, env->regwptr[6]);
-        cpu_dump_state(env, logfile, fprintf, 0);
+                env1->pc,
+                env1->npc, env1->regwptr[6]);
+        cpu_dump_state(env1, logfile, fprintf, 0);
 #if 0
         {
             int i;
             uint8_t *ptr;
 
             fprintf(logfile, "       code=");
-            ptr = (uint8_t *)env->pc;
+            ptr = (uint8_t *)env1->pc;
             for(i = 0; i < 16; i++) {
                 fprintf(logfile, " %02x", ldub(ptr + i));
             }
@@ -2964,23 +2964,23 @@
     }
 #endif
 #if !defined(CONFIG_USER_ONLY)
-    if (env->psret == 0) {
-        cpu_abort(env, "Trap 0x%02x while interrupts disabled, Error state",
-                  env->exception_index);
+    if (env1->psret == 0) {
+        cpu_abort(env1, "Trap 0x%02x while interrupts disabled, Error state",
+                  env1->exception_index);
         return;
     }
 #endif
-    env->psret = 0;
-    cwp = cpu_cwp_dec(env, env->cwp - 1);
-    cpu_set_cwp(env, cwp);
-    env->regwptr[9] = env->pc;
-    env->regwptr[10] = env->npc;
-    env->psrps = env->psrs;
-    env->psrs = 1;
-    env->tbr = (env->tbr & TBR_BASE_MASK) | (intno << 4);
-    env->pc = env->tbr;
-    env->npc = env->pc + 4;
-    env->exception_index = 0;
+    env1->psret = 0;
+    cwp = cpu_cwp_dec(env1, env1->cwp - 1);
+    cpu_set_cwp(env1, cwp);
+    env1->regwptr[9] = env1->pc;
+    env1->regwptr[10] = env1->npc;
+    env1->psrps = env1->psrs;
+    env1->psrs = 1;
+    env1->tbr = (env1->tbr & TBR_BASE_MASK) | (intno << 4);
+    env1->pc = env1->tbr;
+    env1->npc = env1->pc + 4;
+    env1->exception_index = 0;
 }
 #endif
 
Index: qemu/target-sparc/cpu.h
===================================================================
--- qemu.orig/target-sparc/cpu.h	2008-09-04 17:30:08.000000000 +0000
+++ qemu/target-sparc/cpu.h	2008-09-04 17:30:30.000000000 +0000
@@ -475,11 +475,11 @@
 }
 
 #if defined(CONFIG_USER_ONLY)
-static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
+static inline void cpu_clone_regs(CPUState *env1, target_ulong newsp)
 {
     if (newsp)
-        env->regwptr[22] = newsp;
-    env->regwptr[0] = 0;
+        env1->regwptr[22] = newsp;
+    env1->regwptr[0] = 0;
     /* FIXME: Do we also need to clear CF?  */
     /* XXXXX */
     printf ("HELPME: %s:%d\n", __FILE__, __LINE__);
