Skip to content

Commit

Permalink
astyle formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Nov 20, 2014
1 parent 9cbab3d commit 051d42a
Show file tree
Hide file tree
Showing 132 changed files with 3,690 additions and 7,333 deletions.
18 changes: 6 additions & 12 deletions cli/cmdlineparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,48 +54,42 @@ class CmdLineParser {
/**
* Return if user wanted to see program version.
*/
bool GetShowVersion() const
{
bool GetShowVersion() const {
return _showVersion;
}

/**
* Return if user wanted to see list of error messages.
*/
bool GetShowErrorMessages() const
{
bool GetShowErrorMessages() const {
return _showErrorMessages;
}

/**
* Return the path names user gave to command line.
*/
const std::vector<std::string>& GetPathNames() const
{
const std::vector<std::string>& GetPathNames() const {
return _pathnames;
}

/**
* Return if help is shown to user.
*/
bool GetShowHelp() const
{
bool GetShowHelp() const {
return _showHelp;
}

/**
* Return if we should exit after printing version, help etc.
*/
bool ExitAfterPrinting() const
{
bool ExitAfterPrinting() const {
return _exitAfterPrint;
}

/**
* Return a list of paths user wants to ignore.
*/
const std::vector<std::string>& GetIgnoredPaths() const
{
const std::vector<std::string>& GetIgnoredPaths() const {
return _ignoredPaths;
}

Expand Down
3 changes: 1 addition & 2 deletions cli/filelister.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class FileLister {
* @param files output map that associates the size of each file with its name
* @param path root path
*/
static void recursiveAddFiles(std::map<std::string, std::size_t> &files, const std::string &path)
{
static void recursiveAddFiles(std::map<std::string, std::size_t> &files, const std::string &path) {
const std::set<std::string> extra;
recursiveAddFiles(files, path, extra);
}
Expand Down
9 changes: 3 additions & 6 deletions cli/threadexecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ class ThreadExecutor : public ErrorLogger {
/**
* @return true if support for threads exist.
*/
static bool isEnabled()
{
static bool isEnabled() {
return true;
}

Expand Down Expand Up @@ -129,17 +128,15 @@ class ThreadExecutor : public ErrorLogger {
/**
* @return true if support for threads exist.
*/
static bool isEnabled()
{
static bool isEnabled() {
return true;
}
#else
public:
/**
* @return true if support for threads exist.
*/
static bool isEnabled()
{
static bool isEnabled() {
return false;
}
#endif
Expand Down
12 changes: 4 additions & 8 deletions democlient/democlient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,24 @@ class CppcheckExecutor : public ErrorLogger {
CppcheckExecutor()
: ErrorLogger()
, stoptime(std::time(NULL)+2U)
, cppcheck(*this,false)
{
, cppcheck(*this,false) {
cppcheck.settings().addEnabled("all");
cppcheck.settings().inconclusive = true;
}

void run(const char code[])
{
void run(const char code[]) {
cppcheck.check("test.c", code);
}

void reportOut(const std::string &outmsg) { }
void reportErr(const ErrorLogger::ErrorMessage &msg)
{
void reportErr(const ErrorLogger::ErrorMessage &msg) {
printf("%s\n", msg.toString(true).c_str());
}

void reportProgress(const
std::string &filename,
const char stage[],
const unsigned int value)
{
const unsigned int value) {
if (std::time(NULL) >= stoptime) {
printf("time to analyse the "
"code is more than 1 "
Expand Down
18 changes: 6 additions & 12 deletions gui/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,53 +49,47 @@ class Application {
* @brief Get application name.
* @return Application name.
*/
QString getName() const
{
QString getName() const {
return mName;
}

/**
* @brief Get application path.
* @return Application path.
*/
QString getPath() const
{
QString getPath() const {
return mPath;
}

/**
* @brief Get application command line parameters.
* @return Application command line parameters.
*/
QString getParameters() const
{
QString getParameters() const {
return mParameters;
}

/**
* @brief Set application name.
* @param name Application name.
*/
void setName(const QString &name)
{
void setName(const QString &name) {
mName = name;
}

/**
* @brief Set application path.
* @param path Application path.
*/
void setPath(const QString &path)
{
void setPath(const QString &path) {
mPath = path;
}

/**
* @brief Set application command line parameters.
* @param parameters Application command line parameters.
*/
void setParameters(const QString &parameters)
{
void setParameters(const QString &parameters) {
mParameters = parameters;
}

Expand Down
3 changes: 1 addition & 2 deletions gui/applicationlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class ApplicationList : public QObject {
* @brief Return the default application.
* @return Index of the default application.
*/
int GetDefaultApplication() const
{
int GetDefaultApplication() const {
return mDefaultApplicationIndex;
}

Expand Down
6 changes: 2 additions & 4 deletions gui/erroritem.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ class ErrorLine;
*/
class GuiSeverity {
public:
static QString toString(Severity::SeverityType severity)
{
static QString toString(Severity::SeverityType severity) {
return QString(Severity::toString(severity).c_str());
}

static Severity::SeverityType fromString(const QString &severity)
{
static Severity::SeverityType fromString(const QString &severity) {
return Severity::fromString(severity.toStdString());
}
};
Expand Down
8 changes: 4 additions & 4 deletions gui/filelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void FileList::AddDirectory(const QString &directory, bool recursive)
dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
QFileInfoList list = dir.entryInfoList();
QFileInfo item;
foreach (item, list) {
foreach(item, list) {
const QString path = item.canonicalFilePath();
AddDirectory(path, recursive);
}
Expand All @@ -78,7 +78,7 @@ void FileList::AddDirectory(const QString &directory, bool recursive)
void FileList::AddPathList(const QStringList &paths)
{
QString path;
foreach (path, paths) {
foreach(path, paths) {
QFileInfo inf(path);
if (inf.isFile())
AddFile(path);
Expand All @@ -91,7 +91,7 @@ QStringList FileList::GetFileList() const
{
if (mExcludedPaths.empty()) {
QStringList names;
foreach (QFileInfo item, mFileList) {
foreach(QFileInfo item, mFileList) {
QString name = QDir::fromNativeSeparators(item.canonicalFilePath());
names << name;
}
Expand All @@ -109,7 +109,7 @@ void FileList::AddExcludeList(const QStringList &paths)
QStringList FileList::ApplyExcludeList() const
{
QStringList paths;
foreach (QFileInfo item, mFileList) {
foreach(QFileInfo item, mFileList) {
QString name = QDir::fromNativeSeparators(item.canonicalFilePath());
if (!Match(name))
paths << name;
Expand Down
2 changes: 1 addition & 1 deletion gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int main(int argc, char *argv[])
QSettings* settings = new QSettings("Cppcheck", "Cppcheck-GUI", &app);

// Set data dir..
foreach (const QString arg, app.arguments()) {
foreach(const QString arg, app.arguments()) {
if (arg.startsWith("--data-dir=")) {
settings->setValue("DATADIR", arg.mid(11));
return 0;
Expand Down
8 changes: 4 additions & 4 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void MainWindow::CheckDirectory()
void MainWindow::AddIncludeDirs(const QStringList &includeDirs, Settings &result)
{
QString dir;
foreach (dir, includeDirs) {
foreach(dir, includeDirs) {
QString incdir;
if (!QDir::isAbsolutePath(dir))
incdir = mCurrentDirectory + "/";
Expand Down Expand Up @@ -560,14 +560,14 @@ Settings MainWindow::GetCppcheckSettings()

QStringList defines = pfile->GetDefines();
QString define;
foreach (define, defines) {
foreach(define, defines) {
if (!result.userDefines.empty())
result.userDefines += ";";
result.userDefines += define.toStdString();
}

QStringList libraries = pfile->GetLibraries();
foreach (QString library, libraries) {
foreach(QString library, libraries) {
const QString filename = library + ".cfg";
const Library::Error error = LoadLibrary(&result.library, filename);
if (error.errorcode != Library::ErrorCode::OK) {
Expand Down Expand Up @@ -604,7 +604,7 @@ Settings MainWindow::GetCppcheckSettings()
}

QStringList suppressions = pfile->GetSuppressions();
foreach (QString suppression, suppressions) {
foreach(QString suppression, suppressions) {
result.nomsg.addSuppressionLine(suppression.toStdString());
}

Expand Down
3 changes: 1 addition & 2 deletions gui/project.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ class Project : public QObject {
* @brief Return current project file.
* @return project file.
*/
ProjectFile * GetProjectFile() const
{
ProjectFile * GetProjectFile() const {
return mPFile;
}

Expand Down
Loading

0 comments on commit 051d42a

Please sign in to comment.