From 4bc28d547b8ff72b7aa375d8e3a4b614959178e9 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Jul 2013 14:31:46 -0400 Subject: [PATCH] handle lacking return value handling caught by coverity --- benchmark/run.cpp | 5 ++++- bindings/python/mapnik_feature.cpp | 3 ++- utils/pgsql2sqlite/pgsql2sqlite.hpp | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/benchmark/run.cpp b/benchmark/run.cpp index 251bf7161..8668ab5d4 100644 --- a/benchmark/run.cpp +++ b/benchmark/run.cpp @@ -900,7 +900,10 @@ int main( int argc, char** argv) } { - mapnik::freetype_engine::register_fonts("./fonts", true); + bool success = mapnik::freetype_engine::register_fonts("./fonts", true); + if (!success) { + std::clog << "warning, did not register any new fonts!\n"; + } unsigned face_count = mapnik::freetype_engine::face_names().size(); test13 runner(1000,10); benchmark(runner, (boost::format("font_engihe: created %ld faces in ") % (face_count * 1000 * 10)).str()); diff --git a/bindings/python/mapnik_feature.cpp b/bindings/python/mapnik_feature.cpp index f597c9b56..19b3b4aa2 100644 --- a/bindings/python/mapnik_feature.cpp +++ b/bindings/python/mapnik_feature.cpp @@ -54,7 +54,8 @@ boost::ptr_vector const& (mapnik::feature_impl::*get_path void feature_add_geometries_from_wkb(mapnik::feature_impl &feature, std::string wkb) { - geometry_utils::from_wkb(feature.paths(), wkb.c_str(), wkb.size()); + bool result = geometry_utils::from_wkb(feature.paths(), wkb.c_str(), wkb.size()); + if (!result) throw std::runtime_error("Failed to parse WKB"); } void feature_add_geometries_from_wkt(mapnik::feature_impl &feature, std::string wkt) diff --git a/utils/pgsql2sqlite/pgsql2sqlite.hpp b/utils/pgsql2sqlite/pgsql2sqlite.hpp index b799bb2eb..8962d0f9f 100644 --- a/utils/pgsql2sqlite/pgsql2sqlite.hpp +++ b/utils/pgsql2sqlite/pgsql2sqlite.hpp @@ -212,7 +212,10 @@ void pgsql2sqlite(Connection conn, if ( rs->next()) { - mapnik::util::string2int(rs->getValue("srid"),srid); + if (!mapnik::util::string2int(rs->getValue("srid"),srid)) + { + std::clog << "could not convert srid to integer\n"; + } geom_col = rs->getValue("f_geometry_column"); geom_type = rs->getValue("type"); }