From 03bfc091c31cfb8ab36763acab9e0accec3b574a Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 11 Nov 2020 13:45:15 +0100 Subject: [PATCH] Warn for zero values in Layer.setMinimalSize() & setMinimalSpacing(). --- hurricane/src/hurricane/Layer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hurricane/src/hurricane/Layer.cpp b/hurricane/src/hurricane/Layer.cpp index 51dbeb6a..f813f815 100644 --- a/hurricane/src/hurricane/Layer.cpp +++ b/hurricane/src/hurricane/Layer.cpp @@ -34,6 +34,7 @@ #include "hurricane/Layer.h" #include "hurricane/BasicLayer.h" #include "hurricane/Error.h" +#include "hurricane/Warning.h" namespace Hurricane { @@ -167,12 +168,18 @@ namespace Hurricane { void Layer::setMinimalSize ( const DbU::Unit& minimalSize ) { + if (minimalSize == 0) + cerr << Warning( "Layer::setMinimalSize(): Suspicious zero size for layer \"%s\"." + , getString(getName()).c_str()) << endl; _minimalSize = minimalSize; } void Layer::setMinimalSpacing ( const DbU::Unit& minimalSpacing ) { + if (minimalSpacing == 0) + cerr << Warning( "Layer::setMinimalSpacing(): Suspicious zero size for layer \"%s\"." + , getString(getName()).c_str()) << endl; _minimalSpacing = minimalSpacing; }