diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 71af58c83..f3b28bf54 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -942,13 +942,13 @@ int cmake::ExecuteCMakeCommand(std::vector& args) clock_finish = clock(); time(&time_finish); - double clocks_per_sec = (double)CLOCKS_PER_SEC; + double clocks_per_sec = static_cast(CLOCKS_PER_SEC); std::cout << "Elapsed time: " - << (long)(time_finish - time_start) << " s. (time)" - << ", " - << (double)(clock_finish - clock_start) / clocks_per_sec - << " s. (clock)" - << "\n"; + << static_cast(time_finish - time_start) << " s. (time)" + << ", " + << static_cast(clock_finish - clock_start) / clocks_per_sec + << " s. (clock)" + << "\n"; return 0; } @@ -2368,7 +2368,6 @@ void cmake::GenerateGraphViz(const char* fileName) std::map targetDeps; std::map targetPtrs; std::map targetNamesNodes; - char tgtName[2048]; int cnt = 0; // First pass get the list of all cmake targets for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit ) @@ -2384,8 +2383,9 @@ void cmake::GenerateGraphViz(const char* fileName) continue; } //std::cout << "Found target: " << tit->first.c_str() << std::endl; - sprintf(tgtName, "%s%d", graphNodePrefix, cnt++); - targetNamesNodes[realTargetName] = tgtName; + cmOStringStream ostr; + ostr << graphNodePrefix << cnt++; + targetNamesNodes[realTargetName] = ostr.str(); targetPtrs[realTargetName] = &tit->second; } } @@ -2421,10 +2421,11 @@ void cmake::GenerateGraphViz(const char* fileName) } if ( tarIt == targetNamesNodes.end() ) { - sprintf(tgtName, "%s%d", graphNodePrefix, cnt++); + cmOStringStream ostr; + ostr << graphNodePrefix << cnt++; targetDeps[libName] = 2; - targetNamesNodes[libName] = tgtName; - //str << " \"" << tgtName << "\" [ label=\"" << libName + targetNamesNodes[libName] = ostr.str(); + //str << " \"" << ostr.c_str() << "\" [ label=\"" << libName //<< "\" shape=\"ellipse\"];" << std::endl; } else