From 7b71f41e43e522d2070758729d799f639cdaa0b8 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Fri, 1 Sep 2017 17:36:43 -0700 Subject: [PATCH] Fix compiler warnings --- geobuf.cpp | 2 +- jsonpull/jsonpull.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/geobuf.cpp b/geobuf.cpp index e5f0b66..d83630f 100644 --- a/geobuf.cpp +++ b/geobuf.cpp @@ -204,7 +204,7 @@ std::vector readGeometry(protozero::pbf_reader &pbf, size_t dim, d std::vector ret; std::vector coords; std::vector lengths; - int type; + int type = -1; while (pbf.next()) { switch (pbf.tag()) { diff --git a/jsonpull/jsonpull.c b/jsonpull/jsonpull.c index 78e6472..c214e68 100644 --- a/jsonpull/jsonpull.c +++ b/jsonpull/jsonpull.c @@ -710,12 +710,14 @@ void json_free(json_object *o) { static void json_disconnect_parser(json_object *o) { if (o->type == JSON_HASH) { - for (size_t i = 0; i < o->length; i++) { + size_t i; + for (i = 0; i < o->length; i++) { json_disconnect_parser(o->keys[i]); json_disconnect_parser(o->values[i]); } } else if (o->type == JSON_ARRAY) { - for (size_t i = 0; i < o->length; i++) { + size_t i; + for (i = 0; i < o->length; i++) { json_disconnect_parser(o->array[i]); } }