Browse Source

ccan_tokenizer: remove warnings with gcc

/home/rusty/devel/cvs/ccan/ccan/ccan_tokenizer/test/run.c:898:66: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]
 #define T(txt, ...) {txt, sizeof(txt)-1, array_count_pair(struct token, __VA_ARGS__)}
...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 11 years ago
parent
commit
e22289e923
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ccan/ccan_tokenizer/test/run.c

+ 2 - 2
ccan/ccan_tokenizer/test/run.c

@@ -896,14 +896,14 @@ struct tokenizer_test {
 };
 
 #define T(txt, ...) {txt, sizeof(txt)-1, array_count_pair(struct token, __VA_ARGS__)}
-#define string(txt) {.string=(darray_char[1]){{.item = (txt), .size = sizeof(txt)-1}}}
+#define string(txt) {.string=(darray_char[1]){{.item = (char *)(txt), .size = sizeof(txt)-1}}}
 #define opkw(v) {.opkw = (v)}
 #define txt(t) .txt = (t), .txt_size = sizeof(t)-1
 #define integer(...) {.integer={__VA_ARGS__}}
 #define floating(...) {.floating={__VA_ARGS__}}
 #define space {.type = TOK_WHITE, .txt = " ", .txt_size = 1}
 #define startline {.type = TOK_STARTLINE}
-#define include(str) {.include = (str)}
+#define include(str) {.include = (char *)(str)}
 
 struct tokenizer_msg_test {
 	struct tokenizer_test test;