Index: ioemu/hw/vga.c
===================================================================
--- ioemu.orig/hw/vga.c	2007-05-03 18:18:01.000000000 +0100
+++ ioemu/hw/vga.c	2007-05-03 18:59:25.000000000 +0100
@@ -1636,7 +1636,9 @@
 static void vga_save(QEMUFile *f, void *opaque)
 {
     VGAState *s = opaque;
+#ifdef CONFIG_BOCHS_VBE
     int i;
+#endif
 
     if (s->pci_dev)
         pci_device_save(s->pci_dev, f);
@@ -1680,7 +1682,10 @@
 static int vga_load(QEMUFile *f, void *opaque, int version_id)
 {
     VGAState *s = opaque;
-    int is_vbe, i, ret;
+    int is_vbe, ret;
+#ifdef CONFIG_BOCHS_VBE
+    int i;
+#endif
 
     if (version_id > 2)
         return -EINVAL;
Index: ioemu/vl.c
===================================================================
--- ioemu.orig/vl.c	2007-05-03 18:57:13.000000000 +0100
+++ ioemu/vl.c	2007-05-03 18:57:23.000000000 +0100
@@ -40,6 +40,7 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #include <dirent.h>
 #include <netdb.h>
 #ifdef _BSD
@@ -3129,7 +3130,7 @@
     }
 
     /* XXX: better tmp dir construction */
-    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid());
+    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
     if (mkdir(smb_dir, 0700) < 0) {
         fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
         exit(1);
@@ -4092,7 +4093,7 @@
                 perror("Opening pidfile");
                 exit(1);
             }
-            fprintf(f, "%d\n", getpid());
+            fprintf(f, "%ld\n", (long)getpid());
             fclose(f);
             pid_filename = qemu_strdup(filename);
             if (!pid_filename) {
@@ -6207,7 +6208,9 @@
     QEMU_OPTION_d,
     QEMU_OPTION_hdachs,
     QEMU_OPTION_L,
+#ifdef USE_CODE_COPY
     QEMU_OPTION_no_code_copy,
+#endif
     QEMU_OPTION_k,
     QEMU_OPTION_localtime,
     QEMU_OPTION_cirrusvga,
@@ -6284,7 +6287,9 @@
     { "d", HAS_ARG, QEMU_OPTION_d },
     { "hdachs", HAS_ARG, QEMU_OPTION_hdachs },
     { "L", HAS_ARG, QEMU_OPTION_L },
+#ifdef USE_CODE_COPY
     { "no-code-copy", 0, QEMU_OPTION_no_code_copy },
+#endif
 #ifdef USE_KQEMU
     { "no-kqemu", 0, QEMU_OPTION_no_kqemu },
     { "kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu },
@@ -6772,9 +6777,11 @@
                 fd_bootchk = 0;
                 break;
 #endif
+#ifdef USE_CODE_COPY
             case QEMU_OPTION_no_code_copy:
                 code_copy_enabled = 0;
                 break;
+#endif
             case QEMU_OPTION_net:
                 if (nb_net_clients >= MAX_NET_CLIENTS) {
                     fprintf(stderr, "qemu: too many network clients\n");
Index: ioemu/vl.h
===================================================================
--- ioemu.orig/vl.h	2007-05-03 18:49:10.000000000 +0100
+++ ioemu/vl.h	2007-05-03 18:57:23.000000000 +0100
@@ -1133,7 +1133,7 @@
 	       unsigned long vram_offset, int vram_size, int width, int height);
 
 /* slavio_intctl.c */
-void *slavio_intctl_init();
+void *slavio_intctl_init(void);
 void slavio_intctl_set_cpu(void *opaque, unsigned int cpu, CPUState *env);
 void slavio_pic_info(void *opaque);
 void slavio_irq_info(void *opaque);
Index: ioemu/usb-linux.c
===================================================================
--- ioemu.orig/usb-linux.c	2007-05-03 18:17:59.000000000 +0100
+++ ioemu/usb-linux.c	2007-05-03 18:59:55.000000000 +0100
@@ -26,6 +26,9 @@
 #if defined(__linux__)
 #include <dirent.h>
 #include <sys/ioctl.h>
+/* Some versions of usbdevice_fs.h need __user to be defined for them.   */
+/* This may (harmlessly) conflict with a definition in linux/compiler.h. */
+#define __user
 #include <linux/usbdevice_fs.h>
 #include <linux/version.h>
 
