Browse Source

Rename find-unused to warn-unused

Ben Boeckel 15 years ago
parent
commit
4ff03402fc
5 changed files with 19 additions and 19 deletions
  1. 8 8
      Source/cmMakefile.cxx
  2. 1 1
      Source/cmMakefile.h
  3. 5 5
      Source/cmake.cxx
  4. 3 3
      Source/cmake.h
  5. 2 2
      Source/cmakemain.cxx

+ 8 - 8
Source/cmMakefile.cxx

@@ -92,7 +92,7 @@ cmMakefile::cmMakefile(): Internal(new Internals)
   this->AddDefaultDefinitions();
   this->Initialize();
   this->PreOrder = false;
-  this->FindUnused = false;
+  this->WarnUnused = false;
   this->DefaultToUsed = false;
 }
 
@@ -136,7 +136,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
   this->SubDirectoryOrder = mf.SubDirectoryOrder;
   this->Properties = mf.Properties;
   this->PreOrder = mf.PreOrder;
-  this->FindUnused = mf.FindUnused;
+  this->WarnUnused = mf.WarnUnused;
   this->DefaultToUsed = mf.DefaultToUsed;
   this->ListFileStack = mf.ListFileStack;
   this->Initialize();
@@ -766,9 +766,9 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
     {
     const cmDefinitions& defs = cmDefinitions();
     const std::set<cmStdString> globalKeys = defs.LocalKeys();
-    this->FindUnused = this->GetCMakeInstance()->GetFindUnused();
+    this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
     this->DefaultToUsed = this->GetCMakeInstance()->GetDefaultToUsed();
-    if (this->FindUnused)
+    if (this->WarnUnused)
       {
       this->Internal->VarUsageStack.push(globalKeys);
       }
@@ -1710,7 +1710,7 @@ void cmMakefile::AddDefinition(const char* name, bool value)
 {
   this->Internal->VarStack.top().Set(name, value? "ON" : "OFF");
   this->Internal->VarInitStack.top().insert(name);
-  if (this->FindUnused && this->DefaultToUsed)
+  if (this->WarnUnused && this->DefaultToUsed)
     {
     this->Internal->VarUsageStack.top().insert(name);
     }
@@ -1756,7 +1756,7 @@ void cmMakefile::RemoveDefinition(const char* name)
   this->Internal->VarStack.top().Set(name, 0);
   this->Internal->VarRemoved.insert(name);
   this->Internal->VarInitStack.top().insert(name);
-  if (this->FindUnused)
+  if (this->WarnUnused)
     {
     this->Internal->VarUsageStack.top().insert(name);
     }
@@ -2138,7 +2138,7 @@ const char* cmMakefile::GetDefinition(const char* name) const
       RecordPropertyAccess(name,cmProperty::VARIABLE);
     }
 #endif
-  if (this->FindUnused)
+  if (this->WarnUnused)
     {
     this->Internal->VarUsageStack.top().insert(name);
     }
@@ -3391,7 +3391,7 @@ void cmMakefile::PopScope()
   for (; it != locals.end(); ++it)
     {
     init.erase(*it);
-    if (this->FindUnused && usage.find(*it) == usage.end())
+    if (this->WarnUnused && usage.find(*it) == usage.end())
       {
       cmOStringStream m;
       m << "unused variable \'" << *it << "\'";

+ 1 - 1
Source/cmMakefile.h

@@ -934,7 +934,7 @@ private:
   bool PreOrder;
 
   // Unused variable flags
-  bool FindUnused;
+  bool WarnUnused;
   bool DefaultToUsed;
 
   // stack of list files being read 

+ 5 - 5
Source/cmake.cxx

@@ -141,7 +141,7 @@ cmake::cmake()
 {
   this->Trace = false;
   this->WarnUninitialized = false;
-  this->FindUnused = false;
+  this->WarnUnused = false;
   this->DefaultToUsed = false;
   this->SuppressDevWarnings = false;
   this->DoSuppressDevWarnings = false;
@@ -621,16 +621,16 @@ void cmake::SetArgs(const std::vector<std::string>& args)
       std::cout << "Warn about uninitialized values.\n";
       this->SetWarnUninitialized(true);
       }
-    else if(arg.find("--find-unused",0) == 0)
+    else if(arg.find("--warn-unused",0) == 0)
       {
       std::cout << "Finding unused command line variables.\n";
-      this->SetFindUnused(true);
+      this->SetWarnUnused(true);
       this->SetDefaultToUsed(true);
       }
-    else if(arg.find("--find-unused-all",0) == 0)
+    else if(arg.find("--warn-unused-all",0) == 0)
       {
       std::cout << "Finding unused variables.\n";
-      this->SetFindUnused(true);
+      this->SetWarnUnused(true);
       this->SetDefaultToUsed(false);
       }
     else if(arg.find("-G",0) == 0)

+ 3 - 3
Source/cmake.h

@@ -308,8 +308,8 @@ class cmake
   void SetTrace(bool b) {  this->Trace = b;}
   bool GetWarnUninitialized() { return this->WarnUninitialized;}
   void SetWarnUninitialized(bool b) {  this->WarnUninitialized = b;}
-  bool GetFindUnused() { return this->FindUnused;}
-  void SetFindUnused(bool b) {  this->FindUnused = b;}
+  bool GetWarnUnused() { return this->WarnUnused;}
+  void SetWarnUnused(bool b) {  this->WarnUnused = b;}
   bool GetDefaultToUsed() { return this->DefaultToUsed;}
   void SetDefaultToUsed(bool b) {  this->DefaultToUsed = b;}
   // Define a property
@@ -450,7 +450,7 @@ private:
   bool DebugOutput;
   bool Trace;
   bool WarnUninitialized;
-  bool FindUnused;
+  bool WarnUnused;
   bool DefaultToUsed;
   std::string CMakeEditCommand;
   std::string CMakeCommand;

+ 2 - 2
Source/cmakemain.cxx

@@ -122,9 +122,9 @@ static const char * cmDocumentationOptions[][3] =
    "message(send_error ) calls."},
   {"--warn-uninitialized", "Warn about uninitialized values.",
    "Print a warning when an uninitialized variable is used."},
-  {"--find-unused", "Find unused variables.",
+  {"--warn-unused", "Warn about unused variables.",
    "Find variables that are declared on the command line, but not used."},
-  {"--find-unused-all", "Find all unused variables.",
+  {"--warn-unused-all", "Warn about all unused variables.",
    "Find variables that are declared, but not used."},
   {"--help-command cmd [file]", "Print help for a single command and exit.",
    "Full documentation specific to the given command is displayed. "