Skip to content

Commit

Permalink
Fix compiler warning [-Wshadow-field-in-constructor]
Browse files Browse the repository at this point in the history
clang warning:

src/ccstruct/polyblk.cpp:48:36: warning:
 constructor parameter 'box' shadows the field 'box' of 'POLY_BLOCK'
 [-Wshadow-field-in-constructor]

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jul 4, 2018
1 parent c1be102 commit d960a50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/ccstruct/polyblk.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/**********************************************************************
* File: polyblk.cpp (Formerly poly_block.c)
* Description: Polygonal blocks
* Author: Sheelagh Lloyd?
* Created:
*
* (C) Copyright 1993, Hewlett-Packard Ltd.
** Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -45,14 +43,14 @@ POLY_BLOCK::POLY_BLOCK(ICOORDELT_LIST *points, PolyBlockType t) {
}

// Initialize from box coordinates.
POLY_BLOCK::POLY_BLOCK(const TBOX& box, PolyBlockType t) {
POLY_BLOCK::POLY_BLOCK(const TBOX& tbox, PolyBlockType t) {
vertices.clear();
ICOORDELT_IT v = &vertices;
v.move_to_first();
v.add_to_end(new ICOORDELT(box.left(), box.top()));
v.add_to_end(new ICOORDELT(box.left(), box.bottom()));
v.add_to_end(new ICOORDELT(box.right(), box.bottom()));
v.add_to_end(new ICOORDELT(box.right(), box.top()));
v.add_to_end(new ICOORDELT(tbox.left(), tbox.top()));
v.add_to_end(new ICOORDELT(tbox.left(), tbox.bottom()));
v.add_to_end(new ICOORDELT(tbox.right(), tbox.bottom()));
v.add_to_end(new ICOORDELT(tbox.right(), tbox.top()));
compute_bb();
type = t;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ccstruct/polyblk.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DLLSYM POLY_BLOCK {
public:
POLY_BLOCK() = default;
// Initialize from box coordinates.
POLY_BLOCK(const TBOX& box, PolyBlockType type);
POLY_BLOCK(const TBOX& tbox, PolyBlockType type);
POLY_BLOCK(ICOORDELT_LIST *points, PolyBlockType type);
~POLY_BLOCK () = default;

Expand Down

0 comments on commit d960a50

Please sign in to comment.