| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b1329bf commit f5d804f
132 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,42 +54,48 @@ class CmdLineParser { | |||
| 54 | 54 | /** | |
| 55 | 55 | * Return if user wanted to see program version. | |
| 56 | 56 | */ | |
| 57 | - bool GetShowVersion() const { | ||
| 57 | + bool GetShowVersion() const | ||
| 58 | + { | ||
| 58 | 59 | return _showVersion; | |
| 59 | 60 | } | |
| 60 | 61 | ||
| 61 | 62 | /** | |
| 62 | 63 | * Return if user wanted to see list of error messages. | |
| 63 | 64 | */ | |
| 64 | - bool GetShowErrorMessages() const { | ||
| 65 | + bool GetShowErrorMessages() const | ||
| 66 | + { | ||
| 65 | 67 | return _showErrorMessages; | |
| 66 | 68 | } | |
| 67 | 69 | ||
| 68 | 70 | /** | |
| 69 | 71 | * Return the path names user gave to command line. | |
| 70 | 72 | */ | |
| 71 | - const std::vector<std::string>& GetPathNames() const { | ||
| 73 | + const std::vector<std::string>& GetPathNames() const | ||
| 74 | + { | ||
| 72 | 75 | return _pathnames; | |
| 73 | 76 | } | |
| 74 | 77 | ||
| 75 | 78 | /** | |
| 76 | 79 | * Return if help is shown to user. | |
| 77 | 80 | */ | |
| 78 | - bool GetShowHelp() const { | ||
| 81 | + bool GetShowHelp() const | ||
| 82 | + { | ||
| 79 | 83 | return _showHelp; | |
| 80 | 84 | } | |
| 81 | 85 | ||
| 82 | 86 | /** | |
| 83 | 87 | * Return if we should exit after printing version, help etc. | |
| 84 | 88 | */ | |
| 85 | - bool ExitAfterPrinting() const { | ||
| 89 | + bool ExitAfterPrinting() const | ||
| 90 | + { | ||
| 86 | 91 | return _exitAfterPrint; | |
| 87 | 92 | } | |
| 88 | 93 | ||
| 89 | 94 | /** | |
| 90 | 95 | * Return a list of paths user wants to ignore. | |
| 91 | 96 | */ | |
| 92 | - const std::vector<std::string>& GetIgnoredPaths() const { | ||
| 97 | + const std::vector<std::string>& GetIgnoredPaths() const | ||
| 98 | + { | ||
| 93 | 99 | return _ignoredPaths; | |
| 94 | 100 | } | |
| 95 | 101 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,8 @@ class FileLister { | |||
| 37 | 37 | * @param files output map that associates the size of each file with its name | |
| 38 | 38 | * @param path root path | |
| 39 | 39 | */ | |
| 40 | - static void recursiveAddFiles(std::map<std::string, std::size_t> &files, const std::string &path) { | ||
| 40 | + static void recursiveAddFiles(std::map<std::string, std::size_t> &files, const std::string &path) | ||
| 41 | + { | ||
| 41 | 42 | const std::set<std::string> extra; | |
| 42 | 43 | recursiveAddFiles(files, path, extra); | |
| 43 | 44 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,7 +98,8 @@ class ThreadExecutor : public ErrorLogger { | |||
| 98 | 98 | /** | |
| 99 | 99 | * @return true if support for threads exist. | |
| 100 | 100 | */ | |
| 101 | - static bool isEnabled() { | ||
| 101 | + static bool isEnabled() | ||
| 102 | + { | ||
| 102 | 103 | return true; | |
| 103 | 104 | } | |
| 104 | 105 | ||
@@ -128,15 +129,17 @@ class ThreadExecutor : public ErrorLogger { | |||
| 128 | 129 | /** | |
| 129 | 130 | * @return true if support for threads exist. | |
| 130 | 131 | */ | |
| 131 | - static bool isEnabled() { | ||
| 132 | + static bool isEnabled() | ||
| 133 | + { | ||
| 132 | 134 | return true; | |
| 133 | 135 | } | |
| 134 | 136 | #else | |
| 135 | 137 | public: | |
| 136 | 138 | /** | |
| 137 | 139 | * @return true if support for threads exist. | |
| 138 | 140 | */ | |
| 139 | - static bool isEnabled() { | ||
| 141 | + static bool isEnabled() | ||
| 142 | + { | ||
| 140 | 143 | return false; | |
| 141 | 144 | } | |
| 142 | 145 | #endif | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,24 +33,28 @@ class CppcheckExecutor : public ErrorLogger { | |||
| 33 | 33 | CppcheckExecutor() | |
| 34 | 34 | : ErrorLogger() | |
| 35 | 35 | , stoptime(std::time(NULL)+2U) | |
| 36 | - , cppcheck(*this,false) { | ||
| 36 | + , cppcheck(*this,false) | ||
| 37 | + { | ||
| 37 | 38 | cppcheck.settings().addEnabled("all"); | |
| 38 | 39 | cppcheck.settings().inconclusive = true; | |
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | - void run(const char code[]) { | ||
| 42 | + void run(const char code[]) | ||
| 43 | + { | ||
| 42 | 44 | cppcheck.check("test.c", code); | |
| 43 | 45 | } | |
| 44 | 46 | ||
| 45 | 47 | void reportOut(const std::string &outmsg) { } | |
| 46 | - void reportErr(const ErrorLogger::ErrorMessage &msg) { | ||
| 48 | + void reportErr(const ErrorLogger::ErrorMessage &msg) | ||
| 49 | + { | ||
| 47 | 50 | printf("%s\n", msg.toString(true).c_str()); | |
| 48 | 51 | } | |
| 49 | 52 | ||
| 50 | 53 | void reportProgress(const | |
| 51 | 54 | std::string &filename, | |
| 52 | 55 | const char stage[], | |
| 53 | - const unsigned int value) { | ||
| 56 | + const unsigned int value) | ||
| 57 | + { | ||
| 54 | 58 | if (std::time(NULL) >= stoptime) { | |
| 55 | 59 | printf("time to analyse the " | |
| 56 | 60 | "code is more than 1 " | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,47 +49,53 @@ class Application { | |||
| 49 | 49 | * @brief Get application name. | |
| 50 | 50 | * @return Application name. | |
| 51 | 51 | */ | |
| 52 | - QString getName() const { | ||
| 52 | + QString getName() const | ||
| 53 | + { | ||
| 53 | 54 | return mName; | |
| 54 | 55 | } | |
| 55 | 56 | ||
| 56 | 57 | /** | |
| 57 | 58 | * @brief Get application path. | |
| 58 | 59 | * @return Application path. | |
| 59 | 60 | */ | |
| 60 | - QString getPath() const { | ||
| 61 | + QString getPath() const | ||
| 62 | + { | ||
| 61 | 63 | return mPath; | |
| 62 | 64 | } | |
| 63 | 65 | ||
| 64 | 66 | /** | |
| 65 | 67 | * @brief Get application command line parameters. | |
| 66 | 68 | * @return Application command line parameters. | |
| 67 | 69 | */ | |
| 68 | - QString getParameters() const { | ||
| 70 | + QString getParameters() const | ||
| 71 | + { | ||
| 69 | 72 | return mParameters; | |
| 70 | 73 | } | |
| 71 | 74 | ||
| 72 | 75 | /** | |
| 73 | 76 | * @brief Set application name. | |
| 74 | 77 | * @param name Application name. | |
| 75 | 78 | */ | |
| 76 | - void setName(const QString &name) { | ||
| 79 | + void setName(const QString &name) | ||
| 80 | + { | ||
| 77 | 81 | mName = name; | |
| 78 | 82 | } | |
| 79 | 83 | ||
| 80 | 84 | /** | |
| 81 | 85 | * @brief Set application path. | |
| 82 | 86 | * @param path Application path. | |
| 83 | 87 | */ | |
| 84 | - void setPath(const QString &path) { | ||
| 88 | + void setPath(const QString &path) | ||
| 89 | + { | ||
| 85 | 90 | mPath = path; | |
| 86 | 91 | } | |
| 87 | 92 | ||
| 88 | 93 | /** | |
| 89 | 94 | * @brief Set application command line parameters. | |
| 90 | 95 | * @param parameters Application command line parameters. | |
| 91 | 96 | */ | |
| 92 | - void setParameters(const QString ¶meters) { | ||
| 97 | + void setParameters(const QString ¶meters) | ||
| 98 | + { | ||
| 93 | 99 | mParameters = parameters; | |
| 94 | 100 | } | |
| 95 | 101 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,7 +69,8 @@ class ApplicationList : public QObject { | |||
| 69 | 69 | * @brief Return the default application. | |
| 70 | 70 | * @return Index of the default application. | |
| 71 | 71 | */ | |
| 72 | - int GetDefaultApplication() const { | ||
| 72 | + int GetDefaultApplication() const | ||
| 73 | + { | ||
| 73 | 74 | return mDefaultApplicationIndex; | |
| 74 | 75 | } | |
| 75 | 76 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,11 +37,13 @@ class ErrorLine; | |||
| 37 | 37 | */ | |
| 38 | 38 | class GuiSeverity { | |
| 39 | 39 | public: | |
| 40 | - static QString toString(Severity::SeverityType severity) { | ||
| 40 | + static QString toString(Severity::SeverityType severity) | ||
| 41 | + { | ||
| 41 | 42 | return QString(Severity::toString(severity).c_str()); | |
| 42 | 43 | } | |
| 43 | 44 | ||
| 44 | - static Severity::SeverityType fromString(const QString &severity) { | ||
| 45 | + static Severity::SeverityType fromString(const QString &severity) | ||
| 46 | + { | ||
| 45 | 47 | return Severity::fromString(severity.toStdString()); | |
| 46 | 48 | } | |
| 47 | 49 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ void FileList::AddDirectory(const QString &directory, bool recursive) | |||
| 68 | 68 | dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); | |
| 69 | 69 | QFileInfoList list = dir.entryInfoList(); | |
| 70 | 70 | QFileInfo item; | |
| 71 | - foreach(item, list) { | ||
| 71 | + foreach (item, list) { | ||
| 72 | 72 | const QString path = item.canonicalFilePath(); | |
| 73 | 73 | AddDirectory(path, recursive); | |
| 74 | 74 | } | |
@@ -78,7 +78,7 @@ void FileList::AddDirectory(const QString &directory, bool recursive) | |||
| 78 | 78 | void FileList::AddPathList(const QStringList &paths) | |
| 79 | 79 | { | |
| 80 | 80 | QString path; | |
| 81 | - foreach(path, paths) { | ||
| 81 | + foreach (path, paths) { | ||
| 82 | 82 | QFileInfo inf(path); | |
| 83 | 83 | if (inf.isFile()) | |
| 84 | 84 | AddFile(path); | |
@@ -91,7 +91,7 @@ QStringList FileList::GetFileList() const | |||
| 91 | 91 | { | |
| 92 | 92 | if (mExcludedPaths.empty()) { | |
| 93 | 93 | QStringList names; | |
| 94 | - foreach(QFileInfo item, mFileList) { | ||
| 94 | + foreach (QFileInfo item, mFileList) { | ||
| 95 | 95 | QString name = QDir::fromNativeSeparators(item.canonicalFilePath()); | |
| 96 | 96 | names << name; | |
| 97 | 97 | } | |
@@ -109,7 +109,7 @@ void FileList::AddExcludeList(const QStringList &paths) | |||
| 109 | 109 | QStringList FileList::ApplyExcludeList() const | |
| 110 | 110 | { | |
| 111 | 111 | QStringList paths; | |
| 112 | - foreach(QFileInfo item, mFileList) { | ||
| 112 | + foreach (QFileInfo item, mFileList) { | ||
| 113 | 113 | QString name = QDir::fromNativeSeparators(item.canonicalFilePath()); | |
| 114 | 114 | if (!Match(name)) | |
| 115 | 115 | paths << name; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,7 +57,7 @@ int main(int argc, char *argv[]) | |||
| 57 | 57 | QSettings* settings = new QSettings("Cppcheck", "Cppcheck-GUI", &app); | |
| 58 | 58 | ||
| 59 | 59 | // Set data dir.. | |
| 60 | - foreach(const QString arg, app.arguments()) { | ||
| 60 | + foreach (const QString arg, app.arguments()) { | ||
| 61 | 61 | if (arg.startsWith("--data-dir=")) { | |
| 62 | 62 | settings->setValue("DATADIR", arg.mid(11)); | |
| 63 | 63 | return 0; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -499,7 +499,7 @@ void MainWindow::CheckDirectory() | |||
| 499 | 499 | void MainWindow::AddIncludeDirs(const QStringList &includeDirs, Settings &result) | |
| 500 | 500 | { | |
| 501 | 501 | QString dir; | |
| 502 | - foreach(dir, includeDirs) { | ||
| 502 | + foreach (dir, includeDirs) { | ||
| 503 | 503 | QString incdir; | |
| 504 | 504 | if (!QDir::isAbsolutePath(dir)) | |
| 505 | 505 | incdir = mCurrentDirectory + "/"; | |
@@ -560,14 +560,14 @@ Settings MainWindow::GetCppcheckSettings() | |||
| 560 | 560 | ||
| 561 | 561 | QStringList defines = pfile->GetDefines(); | |
| 562 | 562 | QString define; | |
| 563 | - foreach(define, defines) { | ||
| 563 | + foreach (define, defines) { | ||
| 564 | 564 | if (!result.userDefines.empty()) | |
| 565 | 565 | result.userDefines += ";"; | |
| 566 | 566 | result.userDefines += define.toStdString(); | |
| 567 | 567 | } | |
| 568 | 568 | ||
| 569 | 569 | QStringList libraries = pfile->GetLibraries(); | |
| 570 | - foreach(QString library, libraries) { | ||
| 570 | + foreach (QString library, libraries) { | ||
| 571 | 571 | const QString filename = library + ".cfg"; | |
| 572 | 572 | const Library::Error error = LoadLibrary(&result.library, filename); | |
| 573 | 573 | if (error.errorcode != Library::ErrorCode::OK) { | |
@@ -604,7 +604,7 @@ Settings MainWindow::GetCppcheckSettings() | |||
| 604 | 604 | } | |
| 605 | 605 | ||
| 606 | 606 | QStringList suppressions = pfile->GetSuppressions(); | |
| 607 | - foreach(QString suppression, suppressions) { | ||
| 607 | + foreach (QString suppression, suppressions) { | ||
| 608 | 608 | result.nomsg.addSuppressionLine(suppression.toStdString()); | |
| 609 | 609 | } | |
| 610 | 610 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments