From ff57dee13df3d57a1a46999b6884beffd02d9e73 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 20 Sep 2011 11:46:29 +0200 Subject: [PATCH 1/2] unsed static variable removed --- src/hashtable.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hashtable.c b/src/hashtable.c index 9a3f73b..1b0cd6c 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -62,7 +62,6 @@ static size_t primes[] = { 12582917, 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, 1610612741 }; -static const size_t num_primes = sizeof(primes) / sizeof(size_t); static JSON_INLINE size_t num_buckets(hashtable_t *hashtable) { From 909874b1b9edc7d5f8f8ca797640069a054b71ac Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 20 Sep 2011 13:10:32 +0200 Subject: [PATCH 2/2] scope error. result points to a out-of-score variable. --- src/load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/load.c b/src/load.c index 8a53f13..9dc971a 100644 --- a/src/load.c +++ b/src/load.c @@ -69,6 +69,7 @@ static void error_set(json_error_t *error, const lex_t *lex, { va_list ap; char msg_text[JSON_ERROR_TEXT_LENGTH]; + char msg_with_context[JSON_ERROR_TEXT_LENGTH]; int line = -1, col = -1; size_t pos = 0; @@ -84,7 +85,6 @@ static void error_set(json_error_t *error, const lex_t *lex, if(lex) { const char *saved_text = strbuffer_value(&lex->saved_text); - char msg_with_context[JSON_ERROR_TEXT_LENGTH]; line = lex->stream.line; col = lex->stream.column;