reduce: rename stdout to print to avoid name clash
This commit is contained in:
parent
eebfea2b23
commit
7657b84c44
|
@ -546,13 +546,13 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
std::cout << "cppcheck tool that reduce code for a hang / false positive" << std::endl;
|
std::cout << "cppcheck tool that reduce code for a hang / false positive" << std::endl;
|
||||||
|
|
||||||
bool stdout = false;
|
bool print = false;
|
||||||
struct ReduceSettings settings = {0};
|
struct ReduceSettings settings = {0};
|
||||||
settings.maxtime = ~0U;
|
settings.maxtime = ~0U;
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (strcmp(argv[i], "--stdout") == 0)
|
if (strcmp(argv[i], "--stdout") == 0)
|
||||||
stdout = true;
|
print = true;
|
||||||
else if (strcmp(argv[i], "--hang") == 0) {
|
else if (strcmp(argv[i], "--hang") == 0) {
|
||||||
settings.hang = true;
|
settings.hang = true;
|
||||||
if (settings.maxtime == ~0U)
|
if (settings.maxtime == ~0U)
|
||||||
|
@ -646,7 +646,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
const std::string outfilename(std::string("__out__") + std::strrchr(settings.filename,'.'));
|
const std::string outfilename(std::string("__out__") + std::strrchr(settings.filename,'.'));
|
||||||
std::ofstream fout;
|
std::ofstream fout;
|
||||||
if (!stdout)
|
if (!print)
|
||||||
fout.open(outfilename.c_str());
|
fout.open(outfilename.c_str());
|
||||||
std::ostream &os = stdout ? std::cout : fout;
|
std::ostream &os = stdout ? std::cout : fout;
|
||||||
for (std::size_t i = 0; i < filedata.size(); i++) {
|
for (std::size_t i = 0; i < filedata.size(); i++) {
|
||||||
|
|
Loading…
Reference in New Issue