Migrated dumpstate to C++.

Changes required:

- Explicity casting function pointers.
- Moving variables initialization before 'goto' statements.
- Changing string references from 'char *' to 'const char *'.
- Using 'extern "C"' so device-dependent implementation of
  'dumpstate_board()' can be written in C or C++.

BUG: 25563823
Change-Id: I5712c2adbe181c6d17983cbb136b17757900b4ba
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index c5d3044..f10ec46 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -24,6 +24,10 @@
 
 #define SU_PATH "/system/xbin/su"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef void (for_each_pid_func)(int, const char *);
 typedef void (for_each_tid_func)(int, int, const char *);
 
@@ -84,4 +88,8 @@
 /* Implemented by libdumpstate_board to dump board-specific info */
 void dumpstate_board();
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _DUMPSTATE_H_ */