Fix a few Coverity warnings.

This commit is contained in:
jean-pierre charras 2020-04-02 11:33:55 +02:00
parent ddb7b2b2b7
commit ffe0b4aba1
2 changed files with 4 additions and 7 deletions

View File

@ -101,12 +101,12 @@ public:
void Commit() override; void Commit() override;
void AddItem( PNS::ITEM* aItem ) override; void AddItem( PNS::ITEM* aItem ) override;
void RemoveItem( PNS::ITEM* aItem ) override; void RemoveItem( PNS::ITEM* aItem ) override;
void UpdateNet( int aNetCode ) override; void UpdateNet( int aNetCode ) override;
private: private:
struct OFFSET { struct OFFSET {
VECTOR2I p_old, p_new; VECTOR2I p_old, p_new;
}; };
std::map<D_PAD*, OFFSET> m_moduleOffsets; std::map<D_PAD*, OFFSET> m_moduleOffsets;
@ -114,7 +114,6 @@ private:
KIGFX::VIEW_GROUP* m_previewItems; KIGFX::VIEW_GROUP* m_previewItems;
std::unordered_set<BOARD_CONNECTED_ITEM*> m_hiddenItems; std::unordered_set<BOARD_CONNECTED_ITEM*> m_hiddenItems;
PNS::ROUTER* m_router;
PCB_TOOL_BASE* m_tool; PCB_TOOL_BASE* m_tool;
std::unique_ptr<BOARD_COMMIT> m_commit; std::unique_ptr<BOARD_COMMIT> m_commit;
const PCB_DISPLAY_OPTIONS* m_dispOptions; const PCB_DISPLAY_OPTIONS* m_dispOptions;

View File

@ -1315,7 +1315,8 @@ static int64_t shovedArea( const SHAPE_LINE_CHAIN& aOld, const SHAPE_LINE_CHAIN&
return std::abs(area / 2); return std::abs(area / 2);
} }
bool tightenSegment( bool dir, NODE *aNode, LINE cur, const SHAPE_LINE_CHAIN& in, SHAPE_LINE_CHAIN& out ) bool tightenSegment( bool dir, NODE *aNode, const LINE& cur,
const SHAPE_LINE_CHAIN& in, SHAPE_LINE_CHAIN& out )
{ {
SEG a = in.CSegment(0); SEG a = in.CSegment(0);
SEG center = in.CSegment(1); SEG center = in.CSegment(1);
@ -1418,10 +1419,7 @@ bool tightenSegment( bool dir, NODE *aNode, LINE cur, const SHAPE_LINE_CHAIN& in
//dbg->AddLine ( snew, 3, 100000 ); //dbg->AddLine ( snew, 3, 100000 );
return true; return true;
} }
void Tighten( NODE *aNode, SHAPE_LINE_CHAIN& aOldLine, LINE& aNewLine, LINE& aOptimized ) void Tighten( NODE *aNode, SHAPE_LINE_CHAIN& aOldLine, LINE& aNewLine, LINE& aOptimized )