Permalink
Browse files

Minor cleanup of whitespace and add a warning if the file doesn't exists

  • Loading branch information...
1 parent 877123c commit 647e09b8618c174a4f0a6be3a52f251b989b2c92 Benjamin Meyer committed Dec 7, 2007
Showing with 7 additions and 6 deletions.
  1. +7 −6 callgrind_info/main.cpp
@@ -30,7 +30,7 @@
#include <qtextstream.h>
#include <qdebug.h>
#include <qstringlist.h>
-
+
#include "decompress.h"
/*
@@ -41,12 +41,12 @@ int main(int argc, const char *argv[])
QFile inFile;
QTextStream in(&inFile);
QTextStream out(stdout);
-
+
bool spec = false;
bool functions = false;
bool cost = false;
QStringList args;
-
+
// Either read in from stdin or read in from a file
bool setInput = false;
for (int i = 1; i < argc; ++i) {
@@ -66,15 +66,17 @@ int main(int argc, const char *argv[])
} else {
qWarning() << "Usage:" << argv[0]
<< "[stdin|callgrindFile]" << "[options]";
- qWarning() << "-spec type [ob|fl|fn|fe|calls]";
qWarning() << "-functions file";
qWarning() << "-cost function";
+ qWarning() << "-spec type [ob|fl|fn|fe|calls]";
return 1;
}
}
if (!setInput) inFile.open(stdin, QIODevice::ReadOnly);
- if (inFile.openMode() == QIODevice::NotOpen)
+ if (inFile.openMode() == QIODevice::NotOpen) {
+ qWarning() << "Unable to open callgrind file";
return 1;
+ }
QStringList seen;
QStack<QString> currentFile;
@@ -123,7 +125,6 @@ int main(int argc, const char *argv[])
}
}
}
-
} while (!in.atEnd());
if (cost)
out << totalCost << endl;

0 comments on commit 647e09b

Please sign in to comment.