From c6b5d2f8d25d004632e8952ee2f927bcd842c666 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 26 Apr 2020 08:42:50 +0200 Subject: [PATCH] DXF reader code change suggested by clang-analyze --- src/plugins/streamers/dxf/db_plugin/dbDXFReader.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/streamers/dxf/db_plugin/dbDXFReader.cc b/src/plugins/streamers/dxf/db_plugin/dbDXFReader.cc index 85fe87027..c93cc5b60 100644 --- a/src/plugins/streamers/dxf/db_plugin/dbDXFReader.cc +++ b/src/plugins/streamers/dxf/db_plugin/dbDXFReader.cc @@ -1406,7 +1406,6 @@ DXFReader::read_entities (db::Layout &layout, db::Cell &cell, const db::DVector std::string layer; int flags = 0; double width1 = 0.0, width2 = 0.0; - unsigned int got_width = 0; double common_width1 = 0.0, common_width2 = 0.0; unsigned int common_width_set = 0; double ex = 0.0, ey = 0.0, ez = 1.0; @@ -1417,6 +1416,7 @@ DXFReader::read_entities (db::Layout &layout, db::Cell &cell, const db::DVector unsigned int xy_flags = 0; double x = 0.0, y = 0.0; + unsigned int got_width = 0; while ((g = read_group_code ()) != 0) { @@ -1445,7 +1445,6 @@ DXFReader::read_entities (db::Layout &layout, db::Cell &cell, const db::DVector if (got_width == 3) { widths.push_back (std::make_pair (seg_start, width1)); widths.push_back (std::make_pair (points.size () - 1, width2)); - got_width = 0; } got_width = 0; @@ -1516,7 +1515,7 @@ DXFReader::read_entities (db::Layout &layout, db::Cell &cell, const db::DVector const std::string &e = read_string (true); if (e == "VERTEX") { - got_width = 0; + unsigned int got_width = 0; double x = 0.0, y = 0.0; double bnew = 0.0;