diff options
author | Ken Martin <ken.martin@kitware.com> | 2002-08-07 14:30:38 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2002-08-07 14:30:38 (GMT) |
commit | 3704cc268e7e9d9f3c8d71095e9af25486b5ae61 (patch) | |
tree | cc511d2f780a1036fae4fcf078dbffaeca803c5b /Source/cmCreateTestSourceList.cxx | |
parent | 559d99e97d9d64bbdb62e9570dd97082bd914d71 (diff) | |
download | CMake-3704cc268e7e9d9f3c8d71095e9af25486b5ae61.zip CMake-3704cc268e7e9d9f3c8d71095e9af25486b5ae61.tar.gz CMake-3704cc268e7e9d9f3c8d71095e9af25486b5ae61.tar.bz2 |
fixed some compiler warnings and leaks
Diffstat (limited to 'Source/cmCreateTestSourceList.cxx')
-rw-r--r-- | Source/cmCreateTestSourceList.cxx | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index cf086ae..ac9b3a2 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -194,7 +194,7 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn) " p = new_string;\n" " while (*p != 0)\n" " {\n" - " *p = tolower(*p);\n" + " *p = (char)tolower(*p);\n" " ++p;\n" " }\n" " return new_string;\n" @@ -202,7 +202,7 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn) "\n" "int main(int ac, char *av[])\n" "{\n" - " int NumTests, i, testNum, partial_match;\n" + " int i, testNum, partial_match;\n" " char *arg, *test_name;\n" " \n" " NumTests = " << numTests << ";\n" @@ -217,12 +217,6 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn) fout << " if (ac < 2)\n" " {\n" - " // If there is only one test, then run it with the arguments\n" - " if (NumTests == 1)\n" - " {\n" - " return (*cmakeGeneratedFunctionMapEntries[0].func)(ac, av);\n" - " }\n" - " \n" " // Ask for a test\n" " printf(\"Available tests:\\n\");\n" " for (i =0; i < NumTests; ++i)\n" @@ -254,23 +248,18 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn) " test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);\n" " if (partial_match && strstr(test_name, arg) != NULL)\n" " {\n" + " free(test_name);\n" " return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 2, av + 2);\n" " }\n" " else if (!partial_match && strcmp(test_name, arg) == 0)\n" " {\n" + " free(test_name);\n" " return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 1, av + 1);\n" " }\n" " free(test_name);\n" " }\n" " free(arg);\n" " \n" - " // If the test was not found but there is only one test, then\n" - " // run it with the arguments\n" - " if (NumTests == 1)\n" - " {\n" - " return (*cmakeGeneratedFunctionMapEntries[0].func)(ac, av);\n" - " }\n" - " \n" " // Nothing was run, display the test names\n" " printf(\"Available tests:\\n\");\n" " for (i =0; i < NumTests; ++i)\n" |