removed various warnings

This commit is contained in:
Maximilian Röhrle 2018-08-31 09:01:36 +02:00
parent 020cc26b5c
commit fc591913ac
4 changed files with 8 additions and 12 deletions

View File

@ -101,7 +101,7 @@ static int dump_indent(size_t flags, int depth, int space, json_dump_callback_t
static int dump_string(const char *str, size_t len, json_dump_callback_t dump, void *data, size_t flags)
{
const char *pos, *end, *lim;
int32_t codepoint;
int32_t codepoint = 0;
if(dump("\"", 1, data))
return -1;
@ -351,7 +351,7 @@ static int do_dump(const json_t *json, size_t flags, int depth,
}
assert(i == size);
qsort(keys, size, sizeof(const char *), compare_keys);
qsort((void*)keys, size, sizeof(const char *), compare_keys);
for(i = 0; i < size; i++)
{
@ -366,7 +366,7 @@ static int do_dump(const json_t *json, size_t flags, int depth,
if(dump(separator, separator_length, data) ||
do_dump(value, flags, depth + 1, parents, dump, data))
{
jsonp_free(keys);
jsonp_free((void*)keys);
return -1;
}
@ -375,7 +375,7 @@ static int do_dump(const json_t *json, size_t flags, int depth,
if(dump(",", 1, data) ||
dump_indent(flags, depth + 1, 1, dump, data))
{
jsonp_free(keys);
jsonp_free((void*)keys);
return -1;
}
}
@ -383,7 +383,7 @@ static int do_dump(const json_t *json, size_t flags, int depth,
{
if(dump_indent(flags, depth, 0, dump, data))
{
jsonp_free(keys);
jsonp_free((void*)keys);
return -1;
}
}

View File

@ -164,7 +164,7 @@ static int seed_from_timestamp_and_pid(uint32_t *seed) {
}
static uint32_t generate_seed() {
uint32_t seed;
uint32_t seed = 0;
int done = 0;
#if !defined(_WIN32) && defined(USE_URANDOM)

View File

@ -174,7 +174,7 @@ static int stream_get(stream_t *stream, json_error_t *error)
return STREAM_STATE_EOF;
}
stream->buffer[0] = c;
stream->buffer[0] = (char) c;
stream->buffer_pos = 0;
if(0x80 <= c && c <= 0xFF)
@ -189,7 +189,7 @@ static int stream_get(stream_t *stream, json_error_t *error)
assert(count >= 2);
for(i = 1; i < count; i++)
stream->buffer[i] = stream->get(stream->data);
stream->buffer[i] = (char) stream->get(stream->data);
if(!utf8_check_full(stream->buffer, count, NULL))
goto out;

View File

@ -1044,8 +1044,6 @@ json_t *json_copy(json_t *json)
default:
return NULL;
}
return NULL;
}
json_t *json_deep_copy(const json_t *json)
@ -1073,6 +1071,4 @@ json_t *json_deep_copy(const json_t *json)
default:
return NULL;
}
return NULL;
}