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: Ibeb70fd23e64e9b530736b554a372cb232fe1a44
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index 228f09c..3b6abc1 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 *);
 
@@ -87,4 +91,8 @@
 /* dump eMMC Extended CSD data */
 void dump_emmc_ecsd(const char *ext_csd_path);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _DUMPSTATE_H_ */