Updated AStyle to version 2.05.1
Tweaked runastyle.bat a little bit.
This commit is contained in:
parent
bc6ae499dc
commit
8f22e4924c
|
@ -232,7 +232,7 @@ static void writeContainerFunctions(QXmlStreamWriter &xmlWriter, const QString n
|
|||
else if (name == "size")
|
||||
xmlWriter.writeAttribute("templateParameter", QString::number(extra));
|
||||
}
|
||||
foreach(const CppcheckLibraryData::Container::Function &function, functions) {
|
||||
foreach (const CppcheckLibraryData::Container::Function &function, functions) {
|
||||
xmlWriter.writeStartElement("function");
|
||||
xmlWriter.writeAttribute("name", function.name);
|
||||
if (!function.action.isEmpty())
|
||||
|
@ -275,7 +275,7 @@ static void writeFunction(QXmlStreamWriter &xmlWriter, const CppcheckLibraryData
|
|||
comments = comments.mid(1);
|
||||
while (comments.endsWith("\n"))
|
||||
comments.chop(1);
|
||||
foreach(const QString &comment, comments.split('\n')) {
|
||||
foreach (const QString &comment, comments.split('\n')) {
|
||||
if (comment.length() >= 1)
|
||||
xmlWriter.writeComment(comment);
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ static void writeFunction(QXmlStreamWriter &xmlWriter, const CppcheckLibraryData
|
|||
if (function.leakignore)
|
||||
xmlWriter.writeEmptyElement("leak-ignore");
|
||||
// Argument info..
|
||||
foreach(const CppcheckLibraryData::Function::Arg &arg, function.args) {
|
||||
foreach (const CppcheckLibraryData::Function::Arg &arg, function.args) {
|
||||
if (arg.formatstr) {
|
||||
xmlWriter.writeStartElement("formatstr");
|
||||
if (!function.formatstr.scan.isNull())
|
||||
|
@ -323,7 +323,7 @@ static void writeFunction(QXmlStreamWriter &xmlWriter, const CppcheckLibraryData
|
|||
if (!arg.valid.isEmpty())
|
||||
xmlWriter.writeTextElement("valid",arg.valid);
|
||||
|
||||
foreach(const CppcheckLibraryData::Function::Arg::MinSize &minsize, arg.minsizes) {
|
||||
foreach (const CppcheckLibraryData::Function::Arg::MinSize &minsize, arg.minsizes) {
|
||||
xmlWriter.writeStartElement("minsize");
|
||||
xmlWriter.writeAttribute("type", minsize.type);
|
||||
xmlWriter.writeAttribute("arg", minsize.arg);
|
||||
|
@ -359,16 +359,16 @@ static void writeFunction(QXmlStreamWriter &xmlWriter, const CppcheckLibraryData
|
|||
static void writeMemoryResource(QXmlStreamWriter &xmlWriter, const CppcheckLibraryData::MemoryResource &mr)
|
||||
{
|
||||
xmlWriter.writeStartElement(mr.type);
|
||||
foreach(const CppcheckLibraryData::MemoryResource::Alloc &alloc, mr.alloc) {
|
||||
foreach (const CppcheckLibraryData::MemoryResource::Alloc &alloc, mr.alloc) {
|
||||
xmlWriter.writeStartElement("alloc");
|
||||
xmlWriter.writeAttribute("init", alloc.init ? "true" : "false");
|
||||
xmlWriter.writeCharacters(alloc.name);
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
foreach(const QString &dealloc, mr.dealloc) {
|
||||
foreach (const QString &dealloc, mr.dealloc) {
|
||||
xmlWriter.writeTextElement("dealloc", dealloc);
|
||||
}
|
||||
foreach(const QString &use, mr.use) {
|
||||
foreach (const QString &use, mr.use) {
|
||||
xmlWriter.writeTextElement("use", use);
|
||||
}
|
||||
xmlWriter.writeEndElement();
|
||||
|
@ -384,26 +384,26 @@ QString CppcheckLibraryData::toString() const
|
|||
xmlWriter.writeStartElement("def");
|
||||
xmlWriter.writeAttribute("format","2");
|
||||
|
||||
foreach(const Define &define, defines) {
|
||||
foreach (const Define &define, defines) {
|
||||
xmlWriter.writeStartElement("define");
|
||||
xmlWriter.writeAttribute("name", define.name);
|
||||
xmlWriter.writeAttribute("value", define.value);
|
||||
xmlWriter.writeEndElement();
|
||||
}
|
||||
|
||||
foreach(const Function &function, functions) {
|
||||
foreach (const Function &function, functions) {
|
||||
writeFunction(xmlWriter, function);
|
||||
}
|
||||
|
||||
foreach(const MemoryResource &mr, memoryresource) {
|
||||
foreach (const MemoryResource &mr, memoryresource) {
|
||||
writeMemoryResource(xmlWriter, mr);
|
||||
}
|
||||
|
||||
foreach(const Container &container, containers) {
|
||||
foreach (const Container &container, containers) {
|
||||
writeContainer(xmlWriter, container);
|
||||
}
|
||||
|
||||
foreach(const PodType &podtype, podtypes) {
|
||||
foreach (const PodType &podtype, podtypes) {
|
||||
xmlWriter.writeStartElement("podtype");
|
||||
xmlWriter.writeAttribute("name", podtype.name);
|
||||
if (!podtype.sign.isEmpty())
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
|
|
@ -262,11 +262,11 @@ void LibraryDialog::filterFunctions(QString filter)
|
|||
QList<QListWidgetItem *> allItems = ui->functions->findItems(QString(), Qt::MatchContains);
|
||||
|
||||
if (filter.isEmpty()) {
|
||||
foreach(QListWidgetItem *item, allItems) {
|
||||
foreach (QListWidgetItem *item, allItems) {
|
||||
item->setHidden(false);
|
||||
}
|
||||
} else {
|
||||
foreach(QListWidgetItem *item, allItems) {
|
||||
foreach (QListWidgetItem *item, allItems) {
|
||||
item->setHidden(!item->text().startsWith(filter));
|
||||
}
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ QString LibraryDialog::getArgText(const CppcheckLibraryData::Function::Arg &arg)
|
|||
s += "\n format string: " + QString(arg.formatstr ? "true" : "false");
|
||||
s += "\n strz: " + QString(arg.strz ? "true" : "false");
|
||||
s += "\n valid: " + QString(arg.valid.isEmpty() ? "any" : arg.valid);
|
||||
foreach(const CppcheckLibraryData::Function::Arg::MinSize &minsize, arg.minsizes) {
|
||||
foreach (const CppcheckLibraryData::Function::Arg::MinSize &minsize, arg.minsizes) {
|
||||
s += "\n minsize: " + minsize.type + " " + minsize.arg + " " + minsize.arg2;
|
||||
}
|
||||
return s;
|
||||
|
@ -332,7 +332,7 @@ QString LibraryDialog::getArgText(const CppcheckLibraryData::Function::Arg &arg)
|
|||
void LibraryDialog::updateArguments(const CppcheckLibraryData::Function &function)
|
||||
{
|
||||
ui->arguments->clear();
|
||||
foreach(const CppcheckLibraryData::Function::Arg &arg, function.args) {
|
||||
foreach (const CppcheckLibraryData::Function::Arg &arg, function.args) {
|
||||
ui->arguments->addItem(getArgText(arg));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -530,7 +530,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 + "/";
|
||||
|
@ -642,20 +642,20 @@ Settings MainWindow::GetCppcheckSettings()
|
|||
|
||||
const QStringList defines = pfile->GetDefines();
|
||||
QString define;
|
||||
foreach(define, defines) {
|
||||
foreach (define, defines) {
|
||||
if (!result.userDefines.empty())
|
||||
result.userDefines += ";";
|
||||
result.userDefines += define.toStdString();
|
||||
}
|
||||
|
||||
const QStringList libraries = pfile->GetLibraries();
|
||||
foreach(QString library, libraries) {
|
||||
foreach (QString library, libraries) {
|
||||
const QString filename = library + ".cfg";
|
||||
TryLoadLibrary(&result.library, filename);
|
||||
}
|
||||
|
||||
const QStringList suppressions = pfile->GetSuppressions();
|
||||
foreach(QString suppression, suppressions) {
|
||||
foreach (QString suppression, suppressions) {
|
||||
result.nomsg.addSuppressionLine(suppression.toStdString());
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ bool ProjectFile::Read(const QString &filename)
|
|||
insideProject = false;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
@ -143,7 +143,7 @@ bool ProjectFile::Read(const QString &filename)
|
|||
QStringList ProjectFile::GetIncludeDirs() const
|
||||
{
|
||||
QStringList dirs;
|
||||
foreach(QString path, mIncludeDirs) {
|
||||
foreach (QString path, mIncludeDirs) {
|
||||
dirs << QDir::fromNativeSeparators(path);
|
||||
}
|
||||
return dirs;
|
||||
|
@ -157,7 +157,7 @@ QStringList ProjectFile::GetDefines() const
|
|||
QStringList ProjectFile::GetCheckPaths() const
|
||||
{
|
||||
QStringList paths;
|
||||
foreach(QString path, mPaths) {
|
||||
foreach (QString path, mPaths) {
|
||||
paths << QDir::fromNativeSeparators(path);
|
||||
}
|
||||
return paths;
|
||||
|
@ -166,7 +166,7 @@ QStringList ProjectFile::GetCheckPaths() const
|
|||
QStringList ProjectFile::GetExcludedPaths() const
|
||||
{
|
||||
QStringList paths;
|
||||
foreach(QString path, mExcludedPaths) {
|
||||
foreach (QString path, mExcludedPaths) {
|
||||
paths << QDir::fromNativeSeparators(path);
|
||||
}
|
||||
return paths;
|
||||
|
@ -175,7 +175,7 @@ QStringList ProjectFile::GetExcludedPaths() const
|
|||
QStringList ProjectFile::GetLibraries() const
|
||||
{
|
||||
QStringList libraries;
|
||||
foreach(QString library, mLibraries) {
|
||||
foreach (QString library, mLibraries) {
|
||||
libraries << library;
|
||||
}
|
||||
return libraries;
|
||||
|
@ -184,7 +184,7 @@ QStringList ProjectFile::GetLibraries() const
|
|||
QStringList ProjectFile::GetSuppressions() const
|
||||
{
|
||||
QStringList suppressions;
|
||||
foreach(QString suppression, mSuppressions) {
|
||||
foreach (QString suppression, mSuppressions) {
|
||||
suppressions << suppression;
|
||||
}
|
||||
return suppressions;
|
||||
|
@ -221,7 +221,7 @@ void ProjectFile::ReadIncludeDirs(QXmlStreamReader &reader)
|
|||
allRead = true;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
@ -258,7 +258,7 @@ void ProjectFile::ReadDefines(QXmlStreamReader &reader)
|
|||
allRead = true;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
@ -296,7 +296,7 @@ void ProjectFile::ReadCheckPaths(QXmlStreamReader &reader)
|
|||
allRead = true;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
@ -342,7 +342,7 @@ void ProjectFile::ReadExcludes(QXmlStreamReader &reader)
|
|||
allRead = true;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
@ -381,7 +381,7 @@ void ProjectFile::ReadStringList(QStringList &stringlist, QXmlStreamReader &read
|
|||
allRead = true;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
@ -449,7 +449,7 @@ bool ProjectFile::Write(const QString &filename)
|
|||
|
||||
if (!mIncludeDirs.isEmpty()) {
|
||||
xmlWriter.writeStartElement(IncludeDirElementName);
|
||||
foreach(QString incdir, mIncludeDirs) {
|
||||
foreach (QString incdir, mIncludeDirs) {
|
||||
xmlWriter.writeStartElement(DirElementName);
|
||||
xmlWriter.writeAttribute(DirNameAttrib, incdir);
|
||||
xmlWriter.writeEndElement();
|
||||
|
@ -459,7 +459,7 @@ bool ProjectFile::Write(const QString &filename)
|
|||
|
||||
if (!mDefines.isEmpty()) {
|
||||
xmlWriter.writeStartElement(DefinesElementName);
|
||||
foreach(QString define, mDefines) {
|
||||
foreach (QString define, mDefines) {
|
||||
xmlWriter.writeStartElement(DefineName);
|
||||
xmlWriter.writeAttribute(DefineNameAttrib, define);
|
||||
xmlWriter.writeEndElement();
|
||||
|
@ -469,7 +469,7 @@ bool ProjectFile::Write(const QString &filename)
|
|||
|
||||
if (!mPaths.isEmpty()) {
|
||||
xmlWriter.writeStartElement(PathsElementName);
|
||||
foreach(QString path, mPaths) {
|
||||
foreach (QString path, mPaths) {
|
||||
xmlWriter.writeStartElement(PathName);
|
||||
xmlWriter.writeAttribute(PathNameAttrib, path);
|
||||
xmlWriter.writeEndElement();
|
||||
|
@ -479,7 +479,7 @@ bool ProjectFile::Write(const QString &filename)
|
|||
|
||||
if (!mExcludedPaths.isEmpty()) {
|
||||
xmlWriter.writeStartElement(ExcludeElementName);
|
||||
foreach(QString path, mExcludedPaths) {
|
||||
foreach (QString path, mExcludedPaths) {
|
||||
xmlWriter.writeStartElement(ExcludePathName);
|
||||
xmlWriter.writeAttribute(ExcludePathNameAttrib, path);
|
||||
xmlWriter.writeEndElement();
|
||||
|
@ -508,7 +508,7 @@ void ProjectFile::WriteStringList(QXmlStreamWriter &xmlWriter, const QStringList
|
|||
return;
|
||||
|
||||
xmlWriter.writeStartElement(startelementname);
|
||||
foreach(QString str, stringlist) {
|
||||
foreach (QString str, stringlist) {
|
||||
xmlWriter.writeStartElement(stringelementname);
|
||||
xmlWriter.writeCharacters(str);
|
||||
xmlWriter.writeEndElement();
|
||||
|
|
|
@ -53,12 +53,12 @@ ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
|
|||
if (!datadir.isEmpty())
|
||||
searchPaths << datadir << datadir + "/cfg";
|
||||
QStringList libs;
|
||||
foreach(const QString sp, searchPaths) {
|
||||
foreach (const QString sp, searchPaths) {
|
||||
QDir dir(sp);
|
||||
dir.setSorting(QDir::Name);
|
||||
dir.setNameFilters(QStringList("*.cfg"));
|
||||
dir.setFilter(QDir::Files | QDir::NoDotAndDotDot);
|
||||
foreach(QFileInfo item, dir.entryInfoList()) {
|
||||
foreach (QFileInfo item, dir.entryInfoList()) {
|
||||
QString library = item.fileName();
|
||||
{
|
||||
Library lib;
|
||||
|
@ -75,7 +75,7 @@ ProjectFileDialog::ProjectFileDialog(const QString &path, QWidget *parent)
|
|||
}
|
||||
}
|
||||
qSort(libs);
|
||||
foreach(const QString library, libs) {
|
||||
foreach (const QString library, libs) {
|
||||
QCheckBox *checkbox = new QCheckBox(this);
|
||||
checkbox->setText(library);
|
||||
mUI.librariesLayout->addWidget(checkbox);
|
||||
|
@ -208,7 +208,7 @@ QStringList ProjectFileDialog::GetExcludedPaths() const
|
|||
QStringList ProjectFileDialog::GetLibraries() const
|
||||
{
|
||||
QStringList libraries;
|
||||
foreach(const QCheckBox *checkbox, mLibraryCheckboxes) {
|
||||
foreach (const QCheckBox *checkbox, mLibraryCheckboxes) {
|
||||
if (checkbox->isChecked())
|
||||
libraries << checkbox->text();
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ void ProjectFileDialog::SetRootPath(const QString &root)
|
|||
|
||||
void ProjectFileDialog::SetIncludepaths(const QStringList &includes)
|
||||
{
|
||||
foreach(QString dir, includes) {
|
||||
foreach (QString dir, includes) {
|
||||
AddIncludeDir(dir);
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ void ProjectFileDialog::SetDefines(const QStringList &defines)
|
|||
{
|
||||
QString definestr;
|
||||
QString define;
|
||||
foreach(define, defines) {
|
||||
foreach (define, defines) {
|
||||
definestr += define;
|
||||
definestr += ";";
|
||||
}
|
||||
|
@ -255,14 +255,14 @@ void ProjectFileDialog::SetDefines(const QStringList &defines)
|
|||
|
||||
void ProjectFileDialog::SetPaths(const QStringList &paths)
|
||||
{
|
||||
foreach(QString path, paths) {
|
||||
foreach (QString path, paths) {
|
||||
AddPath(path);
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectFileDialog::SetExcludedPaths(const QStringList &paths)
|
||||
{
|
||||
foreach(QString path, paths) {
|
||||
foreach (QString path, paths) {
|
||||
AddExcludePath(path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -782,7 +782,7 @@ void ResultsTree::HideResult()
|
|||
|
||||
QModelIndexList selectedRows = mSelectionModel->selectedRows();
|
||||
QModelIndex index;
|
||||
foreach(index, selectedRows) {
|
||||
foreach (index, selectedRows) {
|
||||
QStandardItem *item = mModel.itemFromIndex(index);
|
||||
//Set the "hide" flag for this item
|
||||
QVariantMap data = item->data().toMap();
|
||||
|
|
|
@ -338,7 +338,7 @@ void ResultsView::ReadErrorsXml(const QString &filename)
|
|||
}
|
||||
|
||||
ErrorItem item;
|
||||
foreach(item, errors) {
|
||||
foreach (item, errors) {
|
||||
mUI.mTree->AddErrorItem(item);
|
||||
}
|
||||
mUI.mTree->SetCheckDirectory("");
|
||||
|
|
|
@ -106,7 +106,7 @@ void SettingsDialog::InitIncludepathsList()
|
|||
QSettings settings;
|
||||
const QString allPaths = settings.value(SETTINGS_GLOBAL_INCLUDE_PATHS).toString();
|
||||
const QStringList paths = allPaths.split(";", QString::SkipEmptyParts);
|
||||
foreach(QString path, paths) {
|
||||
foreach (QString path, paths) {
|
||||
AddIncludePath(path);
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ void SettingsDialog::InitTranslationsList()
|
|||
{
|
||||
const QString current = mTranslator->GetCurrentLanguage();
|
||||
QList<TranslationInfo> translations = mTranslator->GetTranslations();
|
||||
foreach(TranslationInfo translation, translations) {
|
||||
foreach (TranslationInfo translation, translations) {
|
||||
QListWidgetItem *item = new QListWidgetItem;
|
||||
item->setText(translation.mName);
|
||||
item->setData(LangCodeRole, QVariant(translation.mCode));
|
||||
|
@ -211,7 +211,7 @@ void SettingsDialog::AddApplication()
|
|||
void SettingsDialog::RemoveApplication()
|
||||
{
|
||||
QList<QListWidgetItem *> selected = mUI.mListWidget->selectedItems();
|
||||
foreach(QListWidgetItem *item, selected) {
|
||||
foreach (QListWidgetItem *item, selected) {
|
||||
const int removeIndex = mUI.mListWidget->row(item);
|
||||
const int currentDefault = mTempApplications->GetDefaultApplication();
|
||||
mTempApplications->RemoveApplication(removeIndex);
|
||||
|
@ -230,7 +230,7 @@ void SettingsDialog::EditApplication()
|
|||
{
|
||||
QList<QListWidgetItem *> selected = mUI.mListWidget->selectedItems();
|
||||
QListWidgetItem *item = 0;
|
||||
foreach(item, selected) {
|
||||
foreach (item, selected) {
|
||||
int row = mUI.mListWidget->row(item);
|
||||
Application& app = mTempApplications->GetApplication(row);
|
||||
ApplicationDialog dialog(tr("Modify an application"), app, this);
|
||||
|
|
|
@ -109,7 +109,7 @@ void ThreadResult::SetFiles(const QStringList &files)
|
|||
// Determine the total size of all of the files to check, so that we can
|
||||
// show an accurate progress estimate
|
||||
quint64 sizeOfFiles = 0;
|
||||
foreach(const QString& file, files) {
|
||||
foreach (const QString& file, files) {
|
||||
sizeOfFiles += QFile(file).size();
|
||||
}
|
||||
mMaxProgress = sizeOfFiles;
|
||||
|
|
|
@ -71,7 +71,7 @@ TranslationHandler::~TranslationHandler()
|
|||
const QStringList TranslationHandler::GetNames() const
|
||||
{
|
||||
QStringList names;
|
||||
foreach(TranslationInfo translation, mTranslations) {
|
||||
foreach (TranslationInfo translation, mTranslations) {
|
||||
names.append(translation.mName);
|
||||
}
|
||||
return names;
|
||||
|
|
|
@ -75,7 +75,7 @@ int XmlReport::determineVersion(const QString &filename)
|
|||
}
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::EndElement:
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
|
|
|
@ -132,7 +132,7 @@ QList<ErrorItem> XmlReportV1::Read()
|
|||
insideResults = false;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
|
|
@ -157,7 +157,7 @@ QList<ErrorItem> XmlReportV2::Read()
|
|||
insideResults = false;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
@ -220,7 +220,7 @@ ErrorItem XmlReportV2::ReadError(QXmlStreamReader *reader)
|
|||
errorRead = true;
|
||||
break;
|
||||
|
||||
// Not handled
|
||||
// Not handled
|
||||
case QXmlStreamReader::NoToken:
|
||||
case QXmlStreamReader::Invalid:
|
||||
case QXmlStreamReader::StartDocument:
|
||||
|
|
|
@ -999,7 +999,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
|||
case 'l':
|
||||
if (i+1 != formatString.end() && *(i+1) == *i)
|
||||
specifier += *i++;
|
||||
// fallthrough
|
||||
// fallthrough
|
||||
case 'j':
|
||||
case 'q':
|
||||
case 't':
|
||||
|
@ -1301,7 +1301,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
|||
specifier += *i++;
|
||||
specifier += *i++;
|
||||
}
|
||||
// fallthrough
|
||||
// fallthrough
|
||||
case 'j': // intmax_t or uintmax_t
|
||||
case 'z': // size_t
|
||||
case 't': // ptrdiff_t
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
# If project management wishes to take a newer astyle version into use
|
||||
# just change this string to match the start of astyle version string.
|
||||
ASTYLE_VERSION="Artistic Style Version 2.03"
|
||||
ASTYLE_VERSION="Artistic Style Version 2.05.1"
|
||||
ASTYLE="astyle"
|
||||
|
||||
DETECTED_VERSION=`$ASTYLE --version 2>&1`
|
||||
|
@ -17,7 +17,7 @@ if [[ "$DETECTED_VERSION" != ${ASTYLE_VERSION}* ]]; then
|
|||
fi
|
||||
|
||||
style="--style=stroustrup --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0"
|
||||
options="--options=none --pad-header --unpad-paren --suffix=none --convert-tabs"
|
||||
options="--options=none --pad-header --unpad-paren --suffix=none --convert-tabs --attach-inlines"
|
||||
|
||||
$ASTYLE $style $options cli/*.cpp
|
||||
$ASTYLE $style $options cli/*.h
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
REM A script to run Astyle for the sources
|
||||
@REM Script to run AStyle on the sources
|
||||
|
||||
SET STYLE=--style=stroustrup --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0
|
||||
SET OPTIONS=--pad-header --unpad-paren --suffix=none --convert-tabs
|
||||
@SET STYLE=--style=stroustrup --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0
|
||||
@SET OPTIONS=--pad-header --unpad-paren --suffix=none --convert-tabs --attach-inlines
|
||||
|
||||
astyle %STYLE% %OPTIONS% cli/*.cpp
|
||||
astyle %STYLE% %OPTIONS% cli/*.h
|
||||
|
|
|
@ -876,7 +876,7 @@ private:
|
|||
ASSERT_EQUALS("return -1 ;", tokenizeAndStringify("return - __LINE__;"));
|
||||
}
|
||||
|
||||
void foreach() {
|
||||
void foreach () {
|
||||
// #3690,#5154
|
||||
const char code[] ="void f() { for each ( char c in MyString ) { Console::Write(c); } }";
|
||||
ASSERT_EQUALS("void f ( ) { asm ( \"char c in MyString\" ) { Console :: Write ( c ) ; } }" ,tokenizeAndStringify(code));
|
||||
|
|
|
@ -395,21 +395,21 @@ private:
|
|||
|
||||
void structmember12() { // #7179
|
||||
checkStructMemberUsage("#include <stdio.h>\n"
|
||||
"struct\n"
|
||||
"{\n"
|
||||
" union\n"
|
||||
" {\n"
|
||||
" struct\n"
|
||||
" {\n"
|
||||
" int a;\n"
|
||||
" } struct1;\n"
|
||||
" };\n"
|
||||
"} var = {0};\n"
|
||||
"int main(int argc, char *argv[])\n"
|
||||
"{\n"
|
||||
" printf(\"var.struct1.a = %d\n\", var.struct1.a);\n"
|
||||
" return 1;\n"
|
||||
"}\n");
|
||||
"struct\n"
|
||||
"{\n"
|
||||
" union\n"
|
||||
" {\n"
|
||||
" struct\n"
|
||||
" {\n"
|
||||
" int a;\n"
|
||||
" } struct1;\n"
|
||||
" };\n"
|
||||
"} var = {0};\n"
|
||||
"int main(int argc, char *argv[])\n"
|
||||
"{\n"
|
||||
" printf(\"var.struct1.a = %d\n\", var.struct1.a);\n"
|
||||
" return 1;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue