Cleanup: Remove 100+ compiler warnings.

This is a big cleanup that removes compiler warnings by performing
the following:

- Remove unused functions or variables.
- Change pointer cast to be alias safe using unions.
- Use __attribute__((unused)) on some local variable definitions
  when their usage depends on conditional defines that are not
  always true when compiling the same source several times.
- Fix a couple array indexing bugs.

There are still a few warnings from the JSON lexer, libjpeg and
the TCG helpers though, but the overall compilation is much cleaner.

BUG=NONE

Change-Id: Ic4483e6402b266ecfd7bca8c92a73d8fcf392a1f
diff --git a/gdbstub.c b/gdbstub.c
index 2678301..2173f5e 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -28,11 +28,13 @@
 #include <fcntl.h>
 
 #include "qemu.h"
+#include "hw/hw.h"
 #else
 #include "monitor/monitor.h"
 #include "sysemu/char.h"
 #include "sysemu/sysemu.h"
 #include "exec/gdbstub.h"
+#include "exec/exec-all.h"
 #endif
 
 #define MAX_PACKET_LENGTH 4096
@@ -1989,7 +1991,7 @@
             env->watchpoint_hit = NULL;
             return;
         }
-	tb_flush(env);
+        tb_flush(env);
         ret = GDB_SIGNAL_TRAP;
     } else {
         ret = GDB_SIGNAL_INT;