From 31a313d47043923bc722554175912e75a03a13f6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 11 Aug 2010 16:17:09 -0400 Subject: CPack: Avoid member shadowing after API refactor After converting method arguments to members we need to avoid use of the same names as local variables and other method arguments. --- Source/CPack/cmCPackBundleGenerator.cxx | 2 +- Source/CPack/cmCPackDragNDropGenerator.cxx | 7 +++---- Source/CPack/cmCPackDragNDropGenerator.h | 3 +-- Source/CPack/cmCPackGenerator.cxx | 8 ++++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index a9d283a..06a0509 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -165,5 +165,5 @@ int cmCPackBundleGenerator::PackageFiles() cmSystemTools::SetPermissions(command_target.str().c_str(), 0777); } - return this->CreateDMG(toplevel.c_str(), packageFileNames[0].c_str()); + return this->CreateDMG(); } diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index e12c98c..e9ce76c 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -107,7 +107,7 @@ const char* cmCPackDragNDropGenerator::GetOutputExtension() int cmCPackDragNDropGenerator::PackageFiles() { - return this->CreateDMG(toplevel, packageFileNames[0]); + return this->CreateDMG(); } //---------------------------------------------------------------------- @@ -159,8 +159,7 @@ bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command, } //---------------------------------------------------------------------- -int cmCPackDragNDropGenerator::CreateDMG(const std::string& toplevel, - const std::string& outFileName) +int cmCPackDragNDropGenerator::CreateDMG() { // Get optional arguments ... const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON") @@ -473,7 +472,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& toplevel, final_image_command << cpack_dmg_format; final_image_command << " -imagekey"; final_image_command << " zlib-level=9"; - final_image_command << " -o \"" << outFileName << "\""; + final_image_command << " -o \"" << packageFileNames[0] << "\""; if(!this->RunCommand(final_image_command)) { diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index 8a4d774..dcef7fb 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -34,8 +34,7 @@ protected: bool CopyFile(cmOStringStream& source, cmOStringStream& target); bool RunCommand(cmOStringStream& command, std::string* output = 0); - virtual int CreateDMG(const std::string& installdir, - const std::string& outdmg); + int CreateDMG(); std::string InstallPrefix; }; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index b59e980..37b8d5a 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -331,13 +331,13 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( { cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl); cmsys::Glob gl; - std::string toplevel = it->c_str(); + std::string top = it->c_str(); it ++; std::string subdir = it->c_str(); - std::string findExpr = toplevel; + std::string findExpr = top; findExpr += "/*"; cmCPackLogger(cmCPackLog::LOG_OUTPUT, - "- Install directory: " << toplevel << std::endl); + "- Install directory: " << top << std::endl); gl.RecurseOn(); if ( !gl.FindFiles(findExpr) ) { @@ -369,7 +369,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( } std::string filePath = tempDir; filePath += "/" + subdir + "/" - + cmSystemTools::RelativePath(toplevel.c_str(), gfit->c_str()); + + cmSystemTools::RelativePath(top.c_str(), gfit->c_str()); cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: " << inFile.c_str() << " -> " << filePath.c_str() << std::endl); if ( !cmSystemTools::CopyFileIfDifferent(inFile.c_str(), -- cgit v0.12