Issue #236: Add -Wcast-qual and fix casts to retain constness.

To better distinguish between entry->k and entry->v being const within linkhash, but non-const outside, add lh_entry_v() and lh_entry_k() accessors.
Make lh_entry->k const.
This commit is contained in:
Eric Haszlakiewicz
2016-06-11 18:18:46 +00:00
parent f285c0a2e5
commit 595891729e
7 changed files with 61 additions and 33 deletions

View File

@@ -28,7 +28,7 @@ int main()
{
const char *input = "\"\\ud840\\udd26,\\ud840\\udd27,\\ud800\\udd26,\\ud800\\udd27\"";
const char *expected = "\xF0\xA0\x84\xA6,\xF0\xA0\x84\xA7,\xF0\x90\x84\xA6,\xF0\x90\x84\xA7";
struct json_object *parse_result = json_tokener_parse((char*)input);
struct json_object *parse_result = json_tokener_parse(input);
const char *unjson = json_object_get_string(parse_result);
printf("input: %s\n", input);