fixed some compiler warnings and leaks

This commit is contained in:
Ken Martin 2002-08-07 10:30:38 -04:00
parent 559d99e97d
commit 3704cc268e
1 changed files with 4 additions and 15 deletions

View File

@ -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"