From 41ab3bd526807e0a092466e7d4e979f12bab81ff Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 13 May 2014 21:17:06 +0200 Subject: fix windows 64bit build. (changes already committed to trunk) (bzr r13341.1.19) --- buildtool.cpp | 148 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index 3f680e48c..060c352da 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -1000,7 +1000,7 @@ public: virtual ~Element() { - for (unsigned int i=0 ; i&res, const String &na { res.push_back(this); } - for (unsigned int i=0; ifindElementsRecursive(res, name); } @@ -1228,7 +1228,7 @@ std::vector Element::findElements(const String &name) String Element::getAttribute(const String &name) { - for (unsigned int i=0 ; iwriteIndentedRecursive(f, indent+2); //Closing tag @@ -1357,7 +1357,7 @@ String Parser::trim(const String &s) return s; //Find first non-ws char - unsigned int begin = 0; + std::size_t begin = 0; for ( ; begin < s.size() ; begin++) { if (!isspace(s[begin])) @@ -1365,7 +1365,7 @@ String Parser::trim(const String &s) } //Find first non-ws char, going in reverse - unsigned int end = s.size() - 1; + std::size_t end = s.size() - 1; for ( ; end > begin ; end--) { if (!isspace(s[end])) @@ -1442,7 +1442,7 @@ int Parser::peek(int pos) String Parser::encode(const String &str) { String ret; - for (unsigned int i=0 ; i= 3) { if (path[0] == '/' && @@ -2272,7 +2272,7 @@ String URI::getNativePath() const path[2] == ':') firstChar++; } - for (unsigned int i=firstChar ; i MakeBase::tokenize(const String &str, std::vector res; char *del = (char *)delimiters.c_str(); String dmp; - for (unsigned int i=0 ; i begin ; end--) { if (!isspace(s[end])) @@ -4061,7 +4061,7 @@ String MakeBase::toLower(const String &s) return s; String ret; - for(unsigned int i=0; i= 3) { if (path[0] == '/' && @@ -4085,7 +4085,7 @@ String MakeBase::getNativePath(const String &path) path[2] == ':') firstChar++; } - for (unsigned int i=firstChar ; i list = pkgConfig.getRequireList(); - for (unsigned int i = 0 ; i children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -4996,7 +4996,7 @@ bool MakeBase::parseFileSet(Element *elem, } //Look for child tags, including more patternsets std::vector children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -5033,7 +5033,7 @@ bool MakeBase::parseFileSet(Element *elem, /* - for (unsigned int i=0 ; i fnames; //Look for child tags, namely "file" std::vector children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -5119,7 +5119,7 @@ bool MakeBase::createDirectory(const String &dirname) //## 2: pull off the last path segment, if any, //## to make the dir 'above' this one, if necessary - unsigned int pos = dirname.find_last_of('/'); + std::size_t pos = dirname.find_last_of('/'); if (pos>0 && pos != dirname.npos) { String subpath = dirname.substr(0, pos); @@ -5251,7 +5251,7 @@ bool MakeBase::copyFile(const String &srcFile, const String &destFile) } //# 2 prepare a destination directory if necessary - unsigned int pos = destFile.find_last_of('/'); + std::size_t pos = destFile.find_last_of('/'); if (pos != destFile.npos) { String subpath = destFile.substr(0, pos); @@ -5554,8 +5554,8 @@ void PkgConfig::parseVersion() if (version.size() == 0) return; String s1, s2, s3; - unsigned int pos = 0; - unsigned int pos2 = version.find('.', pos); + std::size_t pos = 0; + std::size_t pos2 = version.find('.', pos); if (pos2 == version.npos) { s1 = version; @@ -5702,7 +5702,7 @@ bool PkgConfig::parse(const String &buf) String line; int lineNr = 0; - for (unsigned int p=0 ; p DepTool::loadDepFile(const String &depFile) Element *depList = root->getChildren()[0]; std::vector objects = depList->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -6659,7 +6659,7 @@ std::vector DepTool::loadDepFile(const String &depFile) depObject.suffix = objectElem->getAttribute("suffix"); //########## DESCRIPTION std::vector depElems = objectElem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -6901,7 +6901,7 @@ public: virtual bool isExcludedInc(const String &dirname) { - for (unsigned int i=0 ; i0) @@ -7124,7 +7124,7 @@ public: srcFullName.c_str()); fprintf(f, "#### COMMAND ###\n"); int col = 0; - for (unsigned int i = 0 ; i < cmd.size() ; i++) + for (std::size_t i = 0 ; i < cmd.size() ; i++) { char ch = cmd[i]; if (isspace(ch) && col > 63) @@ -7193,7 +7193,7 @@ public: return false; std::vector children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -7322,7 +7322,7 @@ public: fileSetDir.c_str(), toDirName.c_str()); int nrFiles = 0; - for (unsigned int i=0 ; i children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -7520,7 +7520,7 @@ public: cmd.append(fullDest); unsigned int newFiles = 0; - for (unsigned int i=0 ; i children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -7624,7 +7624,7 @@ public: if (isNewerThan(fullTemplate, fullDest)) newFiles++; } - for (unsigned int i=0 ; i children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -8046,7 +8046,7 @@ public: String fname = "javalist.btool"; FILE *f = fopen(fname.c_str(), "w"); int count = 0; - for (unsigned int i=0 ; i children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -8351,7 +8351,7 @@ public: fullName.c_str(), strerror(errno)); return false; } - for (unsigned int i=0 ; i children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -8778,7 +8778,7 @@ public: if (!parent.getAttribute(elem, "out", outNameOpt)) return false; std::vector children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -8833,7 +8833,7 @@ public: return false; String fileSetDir = parent.eval(fileSet.getDirectory(), "."); - for (unsigned int i=0 ; i0) @@ -8868,7 +8868,7 @@ public: cmd.append(impFileName); cmd.append(" "); } - for (unsigned int i=0 ; i0) @@ -8907,7 +8907,7 @@ public: return false; std::vector children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -8968,7 +8968,7 @@ public: String fileSetDir = parent.eval(fileSet.getDirectory(), "."); //trace("###########HERE %s", fileSetDir.c_str()); - for (unsigned int i=0 ; i0) @@ -8991,7 +8991,7 @@ public: String cmd = command; cmd.append(" "); cmd.append(fullOut); - for (unsigned int i=0 ; i0) @@ -9025,7 +9025,7 @@ public: return false; std::vector children = elem->getChildren(); - for (unsigned int i=0 ; igetName(); @@ -9623,7 +9623,7 @@ void Make::init() pclPrefix = "pcl."; bzrPrefix = "bzr."; properties.clear(); - for (unsigned int i = 0 ; i < allTasks.size() ; i++) + for (std::size_t i = 0 ; i < allTasks.size() ; i++) delete allTasks[i]; allTasks.clear(); } @@ -9635,7 +9635,7 @@ void Make::init() */ void Make::cleanup() { - for (unsigned int i = 0 ; i < allTasks.size() ; i++) + for (std::size_t i = 0 ; i < allTasks.size() ; i++) delete allTasks[i]; allTasks.clear(); } @@ -9690,7 +9690,7 @@ bool Make::executeTarget(Target &target, //First get any dependencies for this target std::vector deps = target.getDependencies(); - for (unsigned int i=0 ; i &tasks = target.getTasks(); - for (unsigned int i=0 ; igetName().c_str()); @@ -9793,7 +9793,7 @@ bool Make::checkTargetDependencies(Target &target, depList.push_back(tgtName); std::vector deps = target.getDependencies(); - for (unsigned int i=0 ; i &attrs = elem->getAttributes(); - for (unsigned int i=0 ; i children = project->getChildren(); - for (unsigned int i=0 ; igetLine()); @@ -10135,7 +10135,7 @@ bool Make::parseFile() target.setIf(tif); target.setUnless(tunless); std::vector telems = elem->getChildren(); - for (unsigned int i=0 ; i Date: Thu, 15 May 2014 23:28:16 +0200 Subject: add cxxflags attribute possibility for buildtool. fixes warnings for c-files (-Woverloaded-virtual) (bzr r13341.1.27) --- buildtool.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index 060c352da..a43bb0192 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -6918,7 +6918,9 @@ public: String cxxCommand = parent.eval(cxxCommandOpt, "g++"); String source = parent.eval(sourceOpt, "."); String dest = parent.eval(destOpt, "."); - String flags = parent.eval(flagsOpt, ""); + String ccflags = parent.eval(flagsOpt, ""); + String cxxflags = parent.eval(cxxflagsOpt, ""); + String flags = ccflags; String defines = parent.eval(definesOpt, ""); String includes = parent.eval(includesOpt, ""); bool continueOnError = parent.evalBool(continueOnErrorOpt, true); @@ -7027,7 +7029,10 @@ public: String command = ccCommand; if (sfx == "cpp" || sfx == "cxx" || sfx == "c++" || sfx == "cc" || sfx == "CC") + { command = cxxCommand; + flags += " " + cxxflags; + } //## Make paths String destPath = dest; @@ -7203,6 +7208,12 @@ public: return false; flagsOpt = strip(flagsOpt); } + else if (tagName == "cxxflags") + { + if (!parent.getValue(child, cxxflagsOpt)) + return false; + cxxflagsOpt = strip(cxxflagsOpt); + } else if (tagName == "includes") { if (!parent.getValue(child, includesOpt)) @@ -7239,6 +7250,7 @@ protected: String sourceOpt; String destOpt; String flagsOpt; + String cxxflagsOpt; String definesOpt; String includesOpt; String continueOnErrorOpt; -- cgit v1.2.3 From 18282d489ba50d7965fc39b481bea5de602b0994 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 15 May 2014 23:34:48 +0200 Subject: make buildtool cxxflags actually work (bzr r13341.1.28) --- buildtool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index a43bb0192..ae3d40106 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -6920,7 +6920,6 @@ public: String dest = parent.eval(destOpt, "."); String ccflags = parent.eval(flagsOpt, ""); String cxxflags = parent.eval(cxxflagsOpt, ""); - String flags = ccflags; String defines = parent.eval(definesOpt, ""); String includes = parent.eval(includesOpt, ""); bool continueOnError = parent.evalBool(continueOnErrorOpt, true); @@ -7027,6 +7026,7 @@ public: //## Select command String sfx = dep.suffix; String command = ccCommand; + String flags = ccflags; if (sfx == "cpp" || sfx == "cxx" || sfx == "c++" || sfx == "cc" || sfx == "CC") { -- cgit v1.2.3