ANSI C requires struct initializers to be constant expressions

Closes GH-17.
This commit is contained in:
Petri Lehtinen 2011-03-21 09:27:51 +02:00
parent 6ecba84817
commit c30e92603c

View File

@ -839,10 +839,13 @@ json_t *json_loads(const char *string, size_t flags, json_error_t *error)
{ {
lex_t lex; lex_t lex;
json_t *result; json_t *result;
string_data_t stream_data = {string, 0}; string_data_t stream_data;
(void)flags; /* unused */ (void)flags; /* unused */
stream_data.data = string;
stream_data.pos = 0;
if(lex_init(&lex, string_get, (void *)&stream_data)) if(lex_init(&lex, string_get, (void *)&stream_data))
return NULL; return NULL;