Reorganize GitInfo + Reorder some initialization to prevent some warning

messages
This commit is contained in:
Thibaud Balem 2018-06-25 15:31:13 +02:00
parent 87ecb22ea5
commit 2a11586d01
4 changed files with 26 additions and 22 deletions

View File

@ -29,5 +29,5 @@ Triskele suit partiellement le [[https://nvie.com/posts/a-successful-git-branchi
# Pour une branche locale # Pour une branche locale
$ git branch -d nomDeBranche $ git branch -d nomDeBranche
# Pour une branche distante # Pour une branche distante
$ git branch -rd nomDeBranche $ git push origin --delete nomDeBranch

View File

@ -60,8 +60,8 @@ Border::Border ()
inline inline
Border::Border (const Size &size, bool defaultVal) Border::Border (const Size &size, bool defaultVal)
: pixelsCount (getPixelsCount (size)), : pixelsCount (getPixelsCount (size)),
size (size),
mapLength (getMapLength (pixelsCount)), mapLength (getMapLength (pixelsCount)),
size (size),
map (), map (),
defaultVal (defaultVal) { defaultVal (defaultVal) {
} }
@ -69,10 +69,12 @@ Border::Border (const Size &size, bool defaultVal)
inline inline
Border::Border (const Border &border, const Rect &tile) Border::Border (const Border &border, const Rect &tile)
: size (tile.width, tile.height), : size (tile.width, tile.height),
pixelsCount (getPixelsCount (size)),
mapLength (getMapLength (pixelsCount)),
map (), map (),
defaultVal (border.defaultVal) { defaultVal (border.defaultVal) {
pixelsCount = getPixelsCount (size);
mapLength = getMapLength (pixelsCount);
if (!border.map.size ()) if (!border.map.size ())
return; return;
// XXX todo // XXX todo

View File

@ -12,9 +12,9 @@ IImage::gdalCount = 0;
IImage::IImage (const string &imageFileName) IImage::IImage (const string &imageFileName)
: fileName (imageFileName), : fileName (imageFileName),
read (false),
gdalInputDataset (nullptr), gdalInputDataset (nullptr),
gdalOutputDataset (nullptr) gdalOutputDataset (nullptr),
read (false)
{ {
} }

View File

@ -7,21 +7,21 @@ using namespace otb::triskele::arrayTree;
using namespace std; using namespace std;
Tree::Tree (const DimSideImg &width, const DimSideImg &height, unsigned int coreCount) Tree::Tree (const DimSideImg &width, const DimSideImg &height, unsigned int coreCount)
: Tree (coreCount) : Tree(coreCount)
{ {
resize (width, height); resize(width, height);
} }
Tree::Tree (unsigned int coreCount) Tree::Tree (unsigned int coreCount)
: size (), : coreCount(coreCount),
coreCount (coreCount), size(),
leafCount (0), leafCount(0),
nodeCount (0), nodeCount(0),
leafParents (), leafParents(),
compParents (nullptr), compParents(nullptr),
children (), childrenStart(),
childrenStart (), children(),
state (State::Void) state(State::Void)
{ {
clear (); clear ();
} }
@ -195,7 +195,7 @@ Tree::checkSpare () const {
maxParent = leafParents[leafId]; maxParent = leafParents[leafId];
}); });
} }
DimImg *childCount = (DimImg*)&childrenStart[2]; // DimImg *childCount = (DimImg*)&childrenStart[2]; // Only used for the assert (so put to comment to prevent warnings)
for (unsigned int i = 0; i < tileCount; ++i) { for (unsigned int i = 0; i < tileCount; ++i) {
DimImg base = vertexMaxBounds [i], maxParent = maxParents [i]; DimImg base = vertexMaxBounds [i], maxParent = maxParents [i];
for (DimImg compId = base; compId < maxParent; ++compId) { for (DimImg compId = base; compId < maxParent; ++compId) {
@ -203,7 +203,8 @@ Tree::checkSpare () const {
BOOST_ASSERT (compParents[compId] != compId); BOOST_ASSERT (compParents[compId] != compId);
BOOST_ASSERT (compParents[compId] < maxParent); BOOST_ASSERT (compParents[compId] < maxParent);
if (compParents[compId] < compId) if (compParents[compId] < compId)
BOOST_ASSERT (childCount[compParents[compId]] > childCount[compId]); BOOST_ASSERT (*(childrenStart + 2 + compParents[compId]) > *(childrenStart + 2 + compId));
//BOOST_ASSERT (childCount[compParents[compId]] > childCount[compId]); // Edited line to prevent the "Unused variable" warning
} }
BOOST_ASSERT (compParents[maxParent] == DimImg_MAX); BOOST_ASSERT (compParents[maxParent] == DimImg_MAX);
} }
@ -319,10 +320,11 @@ Tree::CPrintTree::print (ostream &out) const {
if (!onRecord) if (!onRecord)
out << printMap (&tree.children[0], doubleSize, nodeCount-1) << endl << endl; out << printMap (&tree.children[0], doubleSize, nodeCount-1) << endl << endl;
if (tree.weightBounds.size ()) { if (tree.weightBounds.size ()) {
out << "weightBounds: " << endl return out << "weightBounds: " << endl
<< printMap (&tree.weightBounds[0], tree.size, tree.weightBounds.size ()) << endl << endl; << printMap (&tree.weightBounds[0], tree.size, tree.weightBounds.size ()) << endl << endl;
} else } else
return out << "no weightBounds" << endl << endl; return out << "no weightBounds" << endl << endl;
} }
Tree::CPrintTree Tree::CPrintTree