fix warnings on const char * discards qualifiers
diff --git a/cstool/cstool.c b/cstool/cstool.c
index cd3483e..65ad945 100644
--- a/cstool/cstool.c
+++ b/cstool/cstool.c
@@ -74,7 +74,7 @@
 
 static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins);
 
-void print_string_hex(char *comment, unsigned char *str, size_t len)
+void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/cstool/cstool_evm.c b/cstool/cstool_evm.c
index 18b3192..692a3f0 100644
--- a/cstool/cstool_evm.c
+++ b/cstool/cstool_evm.c
@@ -8,7 +8,6 @@
 void print_insn_detail_evm(csh handle, cs_insn *ins)
 {
 	cs_evm *evm;
-	int i;
 
 	// detail can be NULL on "data" instruction if SKIPDATA option is turned ON
 	if (ins->detail == NULL)
diff --git a/cstool/cstool_m680x.c b/cstool/cstool_m680x.c
index 8413051..4a9a519 100644
--- a/cstool/cstool_m680x.c
+++ b/cstool/cstool_m680x.c
@@ -60,7 +60,7 @@
 
 	for (i = 0; i < m680x->op_count; i++) {
 		cs_m680x_op *op = &(m680x->operands[i]);
-		char *comment;
+		const char *comment;
 
 		switch ((int)op->type) {
 		default:
@@ -131,9 +131,9 @@
 			}
 
 			if (op->idx.inc_dec) {
-				char *post_pre = op->idx.flags &
+				const char *post_pre = op->idx.flags &
 					M680X_IDX_POST_INC_DEC ? "post" : "pre";
-				char *inc_dec = (op->idx.inc_dec > 0) ?
+				const char *inc_dec = (op->idx.inc_dec > 0) ?
 					"increment" : "decrement";
 
 				printf("\t\t\t%s %s: %d\n", post_pre, inc_dec,
diff --git a/cstool/cstool_tms320c64x.c b/cstool/cstool_tms320c64x.c
index 882a6a5..daede36 100644
--- a/cstool/cstool_tms320c64x.c
+++ b/cstool/cstool_tms320c64x.c
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <capstone/capstone.h>
 
-void print_string_hex(char *comment, unsigned char *str, size_t len);
+void print_string_hex(const char *comment, unsigned char *str, size_t len);
 
 void print_insn_detail_tms320c64x(csh handle, cs_insn *ins)
 {
diff --git a/cstool/cstool_x86.c b/cstool/cstool_x86.c
index f5d2bab..ff3be36 100644
--- a/cstool/cstool_x86.c
+++ b/cstool/cstool_x86.c
@@ -5,9 +5,9 @@
 
 #include <capstone/capstone.h>
 
-void print_string_hex(char *comment, unsigned char *str, size_t len);
+void print_string_hex(const char *comment, unsigned char *str, size_t len);
 
-static char *get_eflag_name(uint64_t flag)
+static const char *get_eflag_name(uint64_t flag)
 {
 	switch(flag) {
 		default:
@@ -129,7 +129,7 @@
 	}
 }
 
-static char *get_fpu_flag_name(uint64_t flag)
+static const char *get_fpu_flag_name(uint64_t flag)
 {
 	switch (flag) {
 		default:
diff --git a/cstool/getopt.h b/cstool/getopt.h
index 210ac9f..81af410 100644
--- a/cstool/getopt.h
+++ b/cstool/getopt.h
@@ -6,7 +6,7 @@
 optind = 1, /* index into parent argv vector */
 optopt, /* character checked for validity */
 optreset; /* reset getopt */
-char *optarg; /* argument associated with option */
+const char *optarg; /* argument associated with option */
 
 #define BADCH (int)'?'
 #define BADARG (int)':'
@@ -19,7 +19,7 @@
 int
 getopt (int nargc, char * const nargv[], const char *ostr)
 {
-	static char *place = EMSG;              /* option letter processing */
+	static const char *place = EMSG;              /* option letter processing */
 	const char *oli;                        /* option letter list index */
 
 	if (optreset || !*place) {              /* update scanning pointer */
diff --git a/tests/test_arm.c b/tests/test_arm.c
index d021dff..eedcc98 100644
--- a/tests/test_arm.c
+++ b/tests/test_arm.c
@@ -14,11 +14,11 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 	int syntax;
 };
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_arm64.c b/tests/test_arm64.c
index fc8f7e6..951f7d2 100644
--- a/tests/test_arm64.c
+++ b/tests/test_arm64.c
@@ -14,10 +14,10 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_basic.c b/tests/test_basic.c
index 56dbd2f..22ea2e4 100644
--- a/tests/test_basic.c
+++ b/tests/test_basic.c
@@ -12,7 +12,7 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 	cs_opt_type opt_type;
 	cs_opt_value opt_value;
 };
@@ -91,7 +91,7 @@
 		cs_mode mode;
 		unsigned char *code;
 		size_t size;
-		char *comment;
+		const char *comment;
 		cs_opt_type opt_type;
 		cs_opt_value opt_value;
 	};
diff --git a/tests/test_detail.c b/tests/test_detail.c
index 48af3b9..c4c61dd 100644
--- a/tests/test_detail.c
+++ b/tests/test_detail.c
@@ -12,7 +12,7 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 	cs_opt_type opt_type;
 	cs_opt_value opt_value;
 };
diff --git a/tests/test_evm.c b/tests/test_evm.c
index 1d1d88a..1b21f27 100644
--- a/tests/test_evm.c
+++ b/tests/test_evm.c
@@ -14,10 +14,10 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_iter.c b/tests/test_iter.c
index 6c9169b..5ad9d3e 100644
--- a/tests/test_iter.c
+++ b/tests/test_iter.c
@@ -13,7 +13,7 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 	cs_opt_type opt_type;
 	cs_opt_value opt_value;
 };
diff --git a/tests/test_m680x.c b/tests/test_m680x.c
index 708bcdf..666161c 100644
--- a/tests/test_m680x.c
+++ b/tests/test_m680x.c
@@ -16,10 +16,10 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
@@ -85,7 +85,7 @@
 
 	for (i = 0; i < m680x->op_count; i++) {
 		cs_m680x_op *op = &(m680x->operands[i]);
-		char *comment;
+		const char *comment;
 
 		switch ((int)op->type) {
 		default:
@@ -157,9 +157,9 @@
 			}
 
 			if (op->idx.inc_dec) {
-				char *post_pre = op->idx.flags &
+				const char *post_pre = op->idx.flags &
 					M680X_IDX_POST_INC_DEC ? "post" : "pre";
-				char *inc_dec = (op->idx.inc_dec > 0) ?
+				const char *inc_dec = (op->idx.inc_dec > 0) ?
 					"increment" : "decrement";
 
 				printf("\t\t\t%s %s: %d\n", post_pre, inc_dec,
@@ -328,7 +328,7 @@
 	cs_insn *insn;
 	int i;
 	size_t count;
-	char *nine_spaces = "         ";
+	const char *nine_spaces = "         ";
 
 	if (!consistency_checks())
 		abort();
diff --git a/tests/test_m68k.c b/tests/test_m68k.c
index cc5f786..62b05be 100644
--- a/tests/test_m68k.c
+++ b/tests/test_m68k.c
@@ -11,12 +11,12 @@
 	cs_mode mode;
 	unsigned char* code;
 	size_t size;
-	char* comment;
+	const char* comment;
 };
 
 static csh handle;
 
-static void print_string_hex(char* comment, unsigned char* str, size_t len)
+static void print_string_hex(const char* comment, unsigned char* str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_mips.c b/tests/test_mips.c
index d3864bd..5645a48 100644
--- a/tests/test_mips.c
+++ b/tests/test_mips.c
@@ -12,12 +12,12 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
 static csh handle;
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_ppc.c b/tests/test_ppc.c
index 0ad5de3..f0eceea 100644
--- a/tests/test_ppc.c
+++ b/tests/test_ppc.c
@@ -11,12 +11,12 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
 static csh handle;
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_skipdata.c b/tests/test_skipdata.c
index 5217210..e27798b 100644
--- a/tests/test_skipdata.c
+++ b/tests/test_skipdata.c
@@ -12,7 +12,7 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 	cs_opt_type opt_type;
 	cs_opt_value opt_value;
 	cs_opt_type opt_skipdata;
diff --git a/tests/test_sparc.c b/tests/test_sparc.c
index 122829a..369e077 100644
--- a/tests/test_sparc.c
+++ b/tests/test_sparc.c
@@ -11,12 +11,12 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
 static csh handle;
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_systemz.c b/tests/test_systemz.c
index ec1af9d..6bdcc6f 100644
--- a/tests/test_systemz.c
+++ b/tests/test_systemz.c
@@ -11,12 +11,12 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
 static csh handle;
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_tms320c64x.c b/tests/test_tms320c64x.c
index 3dee537..86a6d76 100644
--- a/tests/test_tms320c64x.c
+++ b/tests/test_tms320c64x.c
@@ -10,12 +10,12 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
 static csh handle;
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
diff --git a/tests/test_x86.c b/tests/test_x86.c
index 1fa1b13..ebabf18 100644
--- a/tests/test_x86.c
+++ b/tests/test_x86.c
@@ -14,12 +14,12 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 	cs_opt_type opt_type;
 	cs_opt_value opt_value;
 };
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;
 
@@ -31,7 +31,7 @@
 	printf("\n");
 }
 
-static char *get_eflag_name(uint64_t flag)
+static const char *get_eflag_name(uint64_t flag)
 {
 	switch(flag) {
 		default:
diff --git a/tests/test_xcore.c b/tests/test_xcore.c
index b382ef6..12cc1f1 100644
--- a/tests/test_xcore.c
+++ b/tests/test_xcore.c
@@ -11,12 +11,12 @@
 	cs_mode mode;
 	unsigned char *code;
 	size_t size;
-	char *comment;
+	const char *comment;
 };
 
 static csh handle;
 
-static void print_string_hex(char *comment, unsigned char *str, size_t len)
+static void print_string_hex(const char *comment, unsigned char *str, size_t len)
 {
 	unsigned char *c;