Clean a few warnings emited by GCC v8

An instance of catching an exception by value:

  https://blog.knatten.org/2010/04/02/always-catch-exceptions-by-reference/

In jsontool, there's a warning about writing 8 bytes into a 7
byte buffer, potentially truncating or losing the nul-terminator.

There are a couple of instances of an unused bool variable, not
really a big deal.
This commit is contained in:
Monty Taylor
2020-05-17 09:43:24 -05:00
parent ddb79937d9
commit efa40d20ab
3 changed files with 2 additions and 7 deletions
-5
View File
@@ -130,10 +130,7 @@ void tilestats(std::map<std::string, layermap_entry> const &layermap1, size_t el
state.json_write_string("layers");
state.json_write_array();
bool first = true;
for (auto layer : layermap) {
first = false;
state.nospace = true;
state.json_write_hash();
@@ -509,7 +506,6 @@ void mbtiles_write_metadata(sqlite3 *outdb, const char *outdir, const char *fnam
state.json_write_newline();
sqlite3_stmt *stmt;
bool first = true;
if (sqlite3_prepare_v2(db, "SELECT name, value from metadata;", -1, &stmt, NULL) == SQLITE_OK) {
while (sqlite3_step(stmt) == SQLITE_ROW) {
std::string key, value;
@@ -524,7 +520,6 @@ void mbtiles_write_metadata(sqlite3 *outdb, const char *outdir, const char *fnam
state.json_comma_newline();
state.json_write_string(k);
state.json_write_string(v);
first = false;
}
sqlite3_finalize(stmt);
}