From 6d8093972d086360b92effa615ff1ed7737fdb91 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 26 Sep 2011 21:59:53 +0300 Subject: [PATCH 1/6] GUI: Make statistics dialog text translatable. Refactor the code formatting statistics dialog content so that the strings are easier to translate. Old formatting with embedded HTML was practically impossible for translators to translate. New code isn't very beautiful either but at least translating is now possible. Ticket: #2726 (GUI: HTML-formatted statistics report text hard to translate) --- gui/statsdialog.cpp | 199 +++++++++++++++++++++++++++++--------------- 1 file changed, 132 insertions(+), 67 deletions(-) diff --git a/gui/statsdialog.cpp b/gui/statsdialog.cpp index b33b3268b..0582d9f57 100644 --- a/gui/statsdialog.cpp +++ b/gui/statsdialog.cpp @@ -98,76 +98,141 @@ void StatsDialog::copyToClipboard() QClipboard *clipboard = QApplication::clipboard(); if (clipboard) { + const QString projSettings(tr("Project Settings")); + const QString project(tr("Project")); + const QString paths(tr("Paths")); + const QString incPaths(tr("Include paths")); + const QString defines(tr("Defines")); + const QString prevScan(tr("Previous Scan")); + const QString selPath(tr("Path selected")); + const QString numFiles(tr("Number of files scanned")); + const QString duration(tr("Scan duration")); + const QString stats(tr("Statistics")); + const QString errors(tr("Errors")); + const QString warnings(tr("Warnings")); + const QString style(tr("Style warnings")); + const QString portability(tr("Portability warnings")); + const QString performance(tr("Performance warnings")); + const QString information(tr("Information messages")); + // Plain text summary - QString textSummary = tr( - "Project Settings\n" - "\tProject:\t%1\n" - "\tPaths:\t%2\n" - "\tInclude paths:\t%3\n" - "\tDefines:\t%4\n" - "Previous Scan\n" - "\tPath selected:\t%5\n" - "\tNumber of files scanned:\t%6\n" - "\tScan duration:\t%7\n" - "Statistics\n" - "\tErrors:\t%8\n" - "\tWarnings:\t%9\n" - "\tStyle warnings:\t%10\n" - "\tPortability warnings:\t%11\n" - "\tPerformance warnings:\t%12\n" - "\tInformation messages:\t%13\n" - ) - .arg(mUI.mProject->text()) - .arg(mUI.mPaths->text()) - .arg(mUI.mIncludePaths->text()) - .arg(mUI.mDefines->text()) - .arg(mUI.mPath->text()) - .arg(mUI.mNumberOfFilesScanned->text()) - .arg(mUI.mScanDuration->text()) - .arg(mStatistics->GetCount(SHOW_ERRORS)) - .arg(mStatistics->GetCount(SHOW_WARNINGS)) - .arg(mStatistics->GetCount(SHOW_STYLE)) - .arg(mStatistics->GetCount(SHOW_PORTABILITY)) - .arg(mStatistics->GetCount(SHOW_PERFORMANCE)) - .arg(mStatistics->GetCount(SHOW_INFORMATION)); + const QString settings = QString( + "%1\n" + "\t%2:\t%3\n" + "\t%4:\t%5\n" + "\t%6:\t%7\n" + "\t%8:\t%9\n" + ) + .arg(projSettings) + .arg(project) + .arg(mUI.mProject->text()) + .arg(paths) + .arg(mUI.mPaths->text()) + .arg(incPaths) + .arg(mUI.mIncludePaths->text()) + .arg(defines) + .arg(mUI.mDefines->text()); + + const QString previous = QString( + "%1\n" + "\t%2:\t%3\n" + "\t%4:\t%5\n" + "\t%6:\t%7\n" + ) + .arg(prevScan) + .arg(selPath) + .arg(mUI.mPath->text()) + .arg(numFiles) + .arg(mUI.mNumberOfFilesScanned->text()) + .arg(duration) + .arg(mUI.mScanDuration->text()); + + const QString statistics = QString( + "%1\n" + "\t%2:\t%3\n" + "\t%4:\t%5\n" + "\t%6:\t%7\n" + "\t%8:\t%9\n" + "\t%10:\t%11\n" + "\t%12:\t%13\n" + ) + .arg(stats) + .arg(errors) + .arg(mStatistics->GetCount(SHOW_ERRORS)) + .arg(warnings) + .arg(mStatistics->GetCount(SHOW_WARNINGS)) + .arg(style) + .arg(mStatistics->GetCount(SHOW_STYLE)) + .arg(portability) + .arg(mStatistics->GetCount(SHOW_PORTABILITY)) + .arg(performance) + .arg(mStatistics->GetCount(SHOW_PERFORMANCE)) + .arg(information) + .arg(mStatistics->GetCount(SHOW_INFORMATION)); + + const QString textSummary = settings + previous + statistics; // HTML summary - QString htmlSummary = tr( - "

Project Settings

\n" - "\n" - " \n" - " \n" - " \n" - " \n" - "
Project:%1
Paths:%2
Include paths:%3
Defines:%4
\n" - "

Previous Scan

\n" - "\n" - " \n" - " \n" - " \n" - "
Path selected:%5
Number of files scanned:%6
Scan duration:%7
\n" - "

Statistics

\n" - " Errors:%8\n" - " Warnings:%9\n" - " Style warnings:%10\n" - " Portability warnings:%11\n" - " Performance warnings:%12\n" - " Information messages:%13\n" - "\n" - ) - .arg(mUI.mProject->text()) - .arg(mUI.mPaths->text()) - .arg(mUI.mIncludePaths->text()) - .arg(mUI.mDefines->text()) - .arg(mUI.mPath->text()) - .arg(mUI.mNumberOfFilesScanned->text()) - .arg(mUI.mScanDuration->text()) - .arg(mStatistics->GetCount(SHOW_ERRORS)) - .arg(mStatistics->GetCount(SHOW_WARNINGS)) - .arg(mStatistics->GetCount(SHOW_STYLE)) - .arg(mStatistics->GetCount(SHOW_PORTABILITY)) - .arg(mStatistics->GetCount(SHOW_PERFORMANCE)) - .arg(mStatistics->GetCount(SHOW_INFORMATION)); + const QString htmlSettings = QString( + "

%1

\n" + "\n" + " \n" + " \n" + " \n" + " \n" + "
%2:%3
%4:%5
%6:%7
%8:%9
\n" + ) + .arg(projSettings) + .arg(project) + .arg(mUI.mProject->text()) + .arg(paths) + .arg(mUI.mPaths->text()) + .arg(incPaths) + .arg(mUI.mIncludePaths->text()) + .arg(defines) + .arg(mUI.mDefines->text()); + + const QString htmlPrevious = QString( + "

%1

\n" + "\n" + " \n" + " \n" + " \n" + "
%2:%3
%4:%5
%6:%7
\n" + ) + .arg(prevScan) + .arg(selPath) + .arg(mUI.mPath->text()) + .arg(numFiles) + .arg(mUI.mNumberOfFilesScanned->text()) + .arg(duration) + .arg(mUI.mScanDuration->text()); + + const QString htmlStatistics = QString( + "

%1

\n" + " %2:%3\n" + " %4:%5\n" + " %6:%7\n" + " %8:%9\n" + " %10:%11\n" + " %12:%13\n" + "\n" + ) + .arg(stats) + .arg(errors) + .arg(mStatistics->GetCount(SHOW_ERRORS)) + .arg(warnings) + .arg(mStatistics->GetCount(SHOW_WARNINGS)) + .arg(style) + .arg(mStatistics->GetCount(SHOW_STYLE)) + .arg(portability) + .arg(mStatistics->GetCount(SHOW_PORTABILITY)) + .arg(performance) + .arg(mStatistics->GetCount(SHOW_PERFORMANCE)) + .arg(information) + .arg(mStatistics->GetCount(SHOW_INFORMATION)); + + const QString htmlSummary = htmlSettings + htmlPrevious + htmlStatistics; QMimeData *mimeData = new QMimeData(); mimeData->setText(textSummary); From 527524a4c915186da9907dd7f7b4707ce5d44cb1 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 26 Sep 2011 22:03:47 +0300 Subject: [PATCH 2/6] GUI: Update translation files. --- gui/cppcheck_de.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_en.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_es.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_fi.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_fr.ts | 93 +++++++++--------- gui/cppcheck_ja.ts | 191 ++++++++++++++++++++----------------- gui/cppcheck_nl.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_pl.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_ru.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_sr.ts | 189 ++++++++++++++++++++----------------- gui/cppcheck_sv.ts | 228 +++++++++++++++++++++------------------------ 11 files changed, 1104 insertions(+), 920 deletions(-) diff --git a/gui/cppcheck_de.ts b/gui/cppcheck_de.ts index 4644713cf..b6824780e 100644 --- a/gui/cppcheck_de.ts +++ b/gui/cppcheck_de.ts @@ -166,16 +166,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -507,17 +507,17 @@ Parameters: -l(line) (file) &Hilfe - + Select files to check Dateien zum Überprüfen auswählen - + Select directory to check Verzeichnis zum Überprüfen auswählen - + No suitable files found to check! Kein passenden Dateien zum Überprüfen gefunden! @@ -527,96 +527,96 @@ Parameters: -l(line) (file) - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + License Lizenz - + Authors Autoren - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) XML-Dateien (*.xml);;Textdateien (*.txt);;CSV-Dateien (*.csv) - + Save the report file Speichert die Berichtdatei - + XML files (*.xml) XML-Dateien (*.xml) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + You must close the project file before selecting new files or directories! - + Open the report file - + Checking is running. Do you want to stop the checking and exit Cppcheck?. - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) Textdateien (*.txt) - + CSV files (*.csv) CSV-Dateien (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -625,34 +625,34 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) - + Select Project File - - + + Project: - + Select Project Filename - + No project file loaded - + The project file %1 @@ -722,18 +722,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. - + Could not write the project file. @@ -804,7 +804,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1214,11 +1214,13 @@ Legen Sie unter dem Menü Ansicht fest, welche Art von Fehlern angezeigt werden + Statistics + Project @@ -1244,6 +1246,7 @@ Legen Sie unter dem Menü Ansicht fest, welche Art von Fehlern angezeigt werden + Previous Scan @@ -1354,50 +1357,68 @@ Legen Sie unter dem Menü Ansicht fest, welche Art von Fehlern angezeigt werden - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + + + + + Style warnings + + + + + Portability warnings + + + + + Performance warnings + + + + + Information messages diff --git a/gui/cppcheck_en.ts b/gui/cppcheck_en.ts index deee5f072..258ff5a5b 100644 --- a/gui/cppcheck_en.ts +++ b/gui/cppcheck_en.ts @@ -168,16 +168,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -509,17 +509,17 @@ Parameters: -l(line) (file) &Help - + Select files to check Select files to check - + Select directory to check Select directory to check - + No suitable files found to check! No suitable files found to check! @@ -529,96 +529,96 @@ Parameters: -l(line) (file) - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + License License - + Authors Authors - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) - + Save the report file Save the report file - + XML files (*.xml) XML files (*.xml) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + You must close the project file before selecting new files or directories! - + Open the report file - + Checking is running. Do you want to stop the checking and exit Cppcheck?. - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) Text files (*.txt) - + CSV files (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -627,34 +627,34 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) - + Select Project File - - + + Project: - + Select Project Filename - + No project file loaded - + The project file %1 @@ -724,18 +724,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. - + Could not write the project file. @@ -806,7 +806,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1216,11 +1216,13 @@ To toggle what kind of errors are shown, open view menu. + Statistics + Project @@ -1246,6 +1248,7 @@ To toggle what kind of errors are shown, open view menu. + Previous Scan @@ -1356,50 +1359,68 @@ To toggle what kind of errors are shown, open view menu. - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + + + + + Style warnings + + + + + Portability warnings + + + + + Performance warnings + + + + + Information messages diff --git a/gui/cppcheck_es.ts b/gui/cppcheck_es.ts index 8114eeb99..eff038a44 100644 --- a/gui/cppcheck_es.ts +++ b/gui/cppcheck_es.ts @@ -165,16 +165,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -506,44 +506,44 @@ Parameters: -l(line) (file) Mostrar &ocultas - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + No suitable files found to check! ¡No se han encontrado ficheros para comprobar! - + You must close the project file before selecting new files or directories! ¡Tienes que cerrar el fichero de proyecto antes de seleccionar nuevos ficheros o carpetas! - + Select files to check Selecciona ficheros para comprobar - + Select directory to check Selecciona una carpeta para comprobar - + XML files (*.xml) Ficheros XML(*.xml) - + Open the report file Abrir informe - + Checking is running. Do you want to stop the checking and exit Cppcheck?. @@ -552,22 +552,22 @@ Do you want to stop the checking and exit Cppcheck?. ¿Quieres parar la comprobación y salir del Cppcheck?. - + License Licencia - + Authors Autores - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) - + Failed to change the user interface language: %1 @@ -576,7 +576,7 @@ The user interface language has been reset to English. Open the Preferences-dial - + Save the report file Guardar informe @@ -586,73 +586,73 @@ The user interface language has been reset to English. Open the Preferences-dial - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) Ficheros de texto (*.txt) - + CSV files (*.csv) Ficheros CVS (*.cvs) - + Cppcheck - %1 Cppcheck - %1 - - + + Project files (*.cppcheck);;All files(*.*) Ficheros de proyecto (*.cppcheck;;Todos los ficheros (*.*) - + Select Project File Selecciona proyecto - - + + Project: Proyecto: - + Select Project Filename Selecciona el nombre del proyecto - + No project file loaded No hay ningún proyecto cargado - + The project file %1 @@ -721,18 +721,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. No se ha podido leer el fichero. - + Could not write the project file. No se ha podido escribir el fichero de proyecto. @@ -803,7 +803,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1212,11 +1212,13 @@ Para cambiar el tipo de comportamiento, abrir el menú vista. + Statistics Estadísticas + Project Proyecto @@ -1242,6 +1244,7 @@ Para cambiar el tipo de comportamiento, abrir el menú vista. + Previous Scan Revisión anterior @@ -1352,50 +1355,68 @@ Para cambiar el tipo de comportamiento, abrir el menú vista. - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + Advertencias + + + + Style warnings + Estilos de advertencias + + + + Portability warnings + + + + + Performance warnings + Ajustar advertencias + + + + Information messages diff --git a/gui/cppcheck_fi.ts b/gui/cppcheck_fi.ts index f6ab8f163..a8aee03c6 100644 --- a/gui/cppcheck_fi.ts +++ b/gui/cppcheck_fi.ts @@ -168,16 +168,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -509,17 +509,17 @@ Parameters: -l(line) (file) &Ohje - + Select files to check Valitse tarkistettavat tiedostot - + Select directory to check Valitse tarkistettava hakemisto - + No suitable files found to check! Tarkistettavaksi sopivia tiedostoja ei löytynyt! @@ -529,96 +529,96 @@ Parameters: -l(line) (file) - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + License Lisenssi - + Authors Tekijät - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) XML-tiedostot (*.xml);;Tekstitiedostot (*.txt);;CSV-tiedostot (*.csv) - + Save the report file Tallenna raportti - + XML files (*.xml) XML-tiedostot (*xml) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + You must close the project file before selecting new files or directories! - + Open the report file - + Checking is running. Do you want to stop the checking and exit Cppcheck?. - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) Tekstitiedostot (*.txt) - + CSV files (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -627,34 +627,34 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) - + Select Project File - - + + Project: - + Select Project Filename - + No project file loaded - + The project file %1 @@ -724,18 +724,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. - + Could not write the project file. @@ -806,7 +806,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1216,11 +1216,13 @@ Määrittääksesi minkä tyyppisiä virheitä näytetään, avaa näkymä valik + Statistics + Project @@ -1246,6 +1248,7 @@ Määrittääksesi minkä tyyppisiä virheitä näytetään, avaa näkymä valik + Previous Scan @@ -1356,50 +1359,68 @@ Määrittääksesi minkä tyyppisiä virheitä näytetään, avaa näkymä valik - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + + + + + Style warnings + + + + + Portability warnings + + + + + Performance warnings + + + + + Information messages diff --git a/gui/cppcheck_fr.ts b/gui/cppcheck_fr.ts index 59db6b83f..16fbad9d3 100644 --- a/gui/cppcheck_fr.ts +++ b/gui/cppcheck_fr.ts @@ -619,10 +619,6 @@ Do you want to remove the file from the recently used projects -list? Include directories: - - Ignore - - Root: @@ -635,6 +631,10 @@ Do you want to remove the file from the recently used projects -list? Down + + Exclude + + ProjectFileDialog @@ -1061,48 +1061,55 @@ Pour configurer les erreurs affichées, ouvrez le menu d'affichage. - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + Project Settings - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + Paths + + + + Include paths + + + + Defines + + + + Path selected + + + + Number of files scanned + + + + Scan duration + + + + Errors + + + + Warnings + + + + Style warnings + + + + Portability warnings + + + + Performance warnings + + + + Information messages diff --git a/gui/cppcheck_ja.ts b/gui/cppcheck_ja.ts index 5cbbd8412..f7094aa0a 100644 --- a/gui/cppcheck_ja.ts +++ b/gui/cppcheck_ja.ts @@ -165,16 +165,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -506,29 +506,29 @@ Parameters: -l(line) (file) ログ表示 - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + No suitable files found to check! 解析可能なファイルではありません - + You must close the project file before selecting new files or directories! 新しいファイル/ディレクトリを解析するには現在のプロジェクトを閉じてください - + Select files to check チェック対象のファイルを選択 - + Select directory to check チェック対象のディレクトリを選択 @@ -538,31 +538,31 @@ This is probably because the settings were changed between the Cppcheck versions - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + XML files (*.xml) XML ファイル (*.xml) - + Open the report file レポートを開く - + Checking is running. Do you want to stop the checking and exit Cppcheck?. @@ -571,53 +571,53 @@ Do you want to stop the checking and exit Cppcheck?. 解析を停止してCppcheckを終了しますか?. - + License ライセンス - + Authors 作者 - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) XML ファイル (*.xml);;テキストファイル (*.txt);;CSV形式ファイル (*.csv) - + Save the report file レポートを保存 - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) テキストファイル (*.txt) - + CSV files (*.csv) CSV形式ファイル (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -626,34 +626,34 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) プロジェクトファイル (*.cppcheck);;All files(*.*) - + Select Project File プロジェクトファイルを選択 - - + + Project: - + プロジェクト: - + Select Project Filename プロジェクトファイル名を選択 - + No project file loaded プロジェクトファイルが読み込まれていません - + The project file %1 @@ -723,18 +723,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. プロジェクトファイルが読み込めませんでした - + Could not write the project file. プロジェクトファイルが保存できませんでした @@ -805,7 +805,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1214,11 +1214,13 @@ To toggle what kind of errors are shown, open view menu. + Statistics 統計情報 + Project プロジェクト @@ -1244,6 +1246,7 @@ To toggle what kind of errors are shown, open view menu. + Previous Scan 前回の解析 @@ -1354,50 +1357,68 @@ To toggle what kind of errors are shown, open view menu. - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + 警告 + + + + Style warnings + スタイル警告 + + + + Portability warnings + + + + + Performance warnings + パフォーマンス警告 + + + + Information messages diff --git a/gui/cppcheck_nl.ts b/gui/cppcheck_nl.ts index 3b860f845..349de8de9 100644 --- a/gui/cppcheck_nl.ts +++ b/gui/cppcheck_nl.ts @@ -168,16 +168,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -509,17 +509,17 @@ Parameters: -l(line) (file) &Help - + Select files to check Selecteer bestanden om te controleren - + Select directory to check Selecteer een map om te controleren - + No suitable files found to check! Geen geschikte bestanden gevonden om te controleren! @@ -529,96 +529,96 @@ Parameters: -l(line) (file) - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + License Licentie - + Authors Auteurs - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) XML bestanden (*.xml);;Tekst bestanden (*.txt);;CSV bestanden (*.csv) - + Save the report file Rapport opslaan - + XML files (*.xml) XML bestanden (*.xml) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + You must close the project file before selecting new files or directories! - + Open the report file - + Checking is running. Do you want to stop the checking and exit Cppcheck?. - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) Tekst bestanden (*.txt) - + CSV files (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -627,34 +627,34 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) - + Select Project File - - + + Project: - + Select Project Filename - + No project file loaded - + The project file %1 @@ -724,18 +724,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. - + Could not write the project file. @@ -806,7 +806,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1216,11 +1216,13 @@ Gebruik het uitzicht menu om te selecteren welke fouten getoond worden. + Statistics + Project @@ -1246,6 +1248,7 @@ Gebruik het uitzicht menu om te selecteren welke fouten getoond worden. + Previous Scan @@ -1356,50 +1359,68 @@ Gebruik het uitzicht menu om te selecteren welke fouten getoond worden. - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + + + + + Style warnings + + + + + Portability warnings + + + + + Performance warnings + + + + + Information messages diff --git a/gui/cppcheck_pl.ts b/gui/cppcheck_pl.ts index 246112876..15aabee60 100644 --- a/gui/cppcheck_pl.ts +++ b/gui/cppcheck_pl.ts @@ -165,16 +165,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck @@ -506,79 +506,79 @@ Parameters: -l(line) (file) - + No suitable files found to check! - + You must close the project file before selecting new files or directories! - + Select files to check - + Select directory to check - + Open the report file - + License - + Authors - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) - + Save the report file - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - - + + Project: - + Select Project Filename - + No project file loaded - + XML files (*.xml) @@ -588,50 +588,50 @@ Parameters: -l(line) (file) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + Checking is running. Do you want to stop the checking and exit Cppcheck?. - + Text files (*.txt) - + CSV files (*.csv) - + Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -640,18 +640,18 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) - + Select Project File - + The project file %1 @@ -721,18 +721,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck - + Could not read the project file. - + Could not write the project file. @@ -803,7 +803,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1208,11 +1208,13 @@ To toggle what kind of errors are shown, open view menu. + Statistics + Project @@ -1238,6 +1240,7 @@ To toggle what kind of errors are shown, open view menu. + Previous Scan @@ -1348,50 +1351,68 @@ To toggle what kind of errors are shown, open view menu. - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + + + + + Style warnings + + + + + Portability warnings + + + + + Performance warnings + + + + + Information messages diff --git a/gui/cppcheck_ru.ts b/gui/cppcheck_ru.ts index 8b641073f..8ead8f6c3 100644 --- a/gui/cppcheck_ru.ts +++ b/gui/cppcheck_ru.ts @@ -168,16 +168,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -509,17 +509,17 @@ Parameters: -l(line) (file) Помощь - + Select files to check Выберите файлы для проверки - + Select directory to check Выберите каталог для проверки - + No suitable files found to check! @@ -529,96 +529,96 @@ Parameters: -l(line) (file) - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + License Лицензия - + Authors Авторы - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) - + Save the report file - + XML files (*.xml) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + You must close the project file before selecting new files or directories! - + Open the report file - + Checking is running. Do you want to stop the checking and exit Cppcheck?. - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) Текстовые файлы (*.txt) - + CSV files (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -627,34 +627,34 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) - + Select Project File - - + + Project: - + Select Project Filename - + No project file loaded - + The project file %1 @@ -724,18 +724,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. - + Could not write the project file. @@ -806,7 +806,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1213,11 +1213,13 @@ To toggle what kind of errors are shown, open view menu. + Statistics + Project @@ -1243,6 +1245,7 @@ To toggle what kind of errors are shown, open view menu. + Previous Scan @@ -1353,50 +1356,68 @@ To toggle what kind of errors are shown, open view menu. - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + + + + + Style warnings + + + + + Portability warnings + + + + + Performance warnings + + + + + Information messages diff --git a/gui/cppcheck_sr.ts b/gui/cppcheck_sr.ts index 16548cf50..5c00470b8 100644 --- a/gui/cppcheck_sr.ts +++ b/gui/cppcheck_sr.ts @@ -168,16 +168,16 @@ Parameters: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -509,17 +509,17 @@ Parameters: -l(line) (file) &Help - + Select files to check Select files to check - + Select directory to check Select directory to check - + No suitable files found to check! No suitable files found to check! @@ -529,96 +529,96 @@ Parameters: -l(line) (file) - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + License License - + Authors Authors - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) - + Save the report file Save the report file - + XML files (*.xml) XML files (*.xml) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. - + You must close the project file before selecting new files or directories! - + Open the report file - + Checking is running. Do you want to stop the checking and exit Cppcheck?. - + XML files version 1 (*.xml) - + XML files version 2 (*.xml) - + Text files (*.txt) Text files (*.txt) - + CSV files (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -627,34 +627,34 @@ The user interface language has been reset to English. Open the Preferences-dial - - + + Project files (*.cppcheck);;All files(*.*) - + Select Project File - - + + Project: - + Select Project Filename - + No project file loaded - + The project file %1 @@ -724,18 +724,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. - + Could not write the project file. @@ -806,7 +806,7 @@ Do you want to remove the file from the recently used projects -list? - Ignore + Exclude @@ -1216,11 +1216,13 @@ To toggle what kind of errors are shown, open view menu. + Statistics + Project @@ -1246,6 +1248,7 @@ To toggle what kind of errors are shown, open view menu. + Previous Scan @@ -1356,50 +1359,68 @@ To toggle what kind of errors are shown, open view menu. - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - + + Project Settings - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - + + Paths + + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + + + + + Warnings + + + + + Style warnings + + + + + Portability warnings + + + + + Performance warnings + + + + + Information messages diff --git a/gui/cppcheck_sv.ts b/gui/cppcheck_sv.ts index ca1972dc1..093f2368b 100644 --- a/gui/cppcheck_sv.ts +++ b/gui/cppcheck_sv.ts @@ -178,16 +178,16 @@ Parametrar: -l(line) (file) MainWindow - - - - - - - - - - + + + + + + + + + + Cppcheck Cppcheck @@ -520,17 +520,17 @@ Parametrar: -l(line) (file) &Hjälp - + Select files to check Välj filer att kontrollera - + Select directory to check Välj katalog som skall kontrolleras - + No suitable files found to check! Inga lämpliga filer hittades! @@ -540,47 +540,47 @@ Parametrar: -l(line) (file) - + Found project file: %1 Do you want to load this project file instead? - + Found project files from the directory. Do you want to proceed checking without using any of these project files? - + License Licens - + Authors Utvecklare - + XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv) XML files (*.xml);;Text files (*.txt);;CSV files (*.csv) XML filer version 2 (*.xml);;XML filer version 1 (*.xml);;Text filer (*.txt);;CSV filer (*.csv) - + Save the report file Spara rapport - + XML files (*.xml) XML filer (*.xml) - + There was a problem with loading the editor application settings. This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly. @@ -589,17 +589,17 @@ This is probably because the settings were changed between the Cppcheck versions En trolig orsak är att inställningarna ändrats för olika Cppcheck versioner. Kontrollera programinställningarna. - + You must close the project file before selecting new files or directories! Du måste stänga projektfilen innan nya filer eller sökvägar kan väljas! - + Open the report file Öppna rapportfilen - + Checking is running. Do you want to stop the checking and exit Cppcheck?. @@ -608,32 +608,32 @@ Do you want to stop the checking and exit Cppcheck?. Vill du stoppa analysen och avsluta Cppcheck? - + XML files version 1 (*.xml) XML filer version 1 (*.xml) - + XML files version 2 (*.xml) XML filer version 2 (*.xml) - + Text files (*.txt) Text filer (*.txt) - + CSV files (*.csv) CSV filer (*.csv) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change the user interface language: %1 @@ -646,34 +646,34 @@ The user interface language has been reset to English. Open the Preferences-dial Språket har nollställts till Engelska. Öppna Preferences och välj något av de tillgängliga språken. - - + + Project files (*.cppcheck);;All files(*.*) Projektfiler (*.cppcheck);;Alla filer(*.*) - + Select Project File Välj projektfil - - + + Project: Projekt: - + Select Project Filename Välj Projektfil - + No project file loaded Inget projekt laddat - + The project file %1 @@ -743,18 +743,18 @@ Do you want to remove the file from the recently used projects -list? Project - - + + Cppcheck Cppcheck - + Could not read the project file. Kunde ej läsa projektfilen. - + Could not write the project file. Kunde ej skriva projektfilen @@ -825,8 +825,8 @@ Do you want to remove the file from the recently used projects -list? - Ignore - Ignorera + Exclude + @@ -1237,11 +1237,13 @@ För att ställa in vilka fel som skall visas använd visa menyn. + Statistics Statistik + Project Projekt @@ -1267,6 +1269,7 @@ För att ställa in vilka fel som skall visas använd visa menyn. + Previous Scan Föregående analys @@ -1377,84 +1380,69 @@ För att ställa in vilka fel som skall visas använd visa menyn. och - - Project Settings - Project: %1 - Paths: %2 - Include paths: %3 - Defines: %4 -Previous Scan - Path selected: %5 - Number of files scanned: %6 - Scan duration: %7 -Statistics - Errors: %8 - Warnings: %9 - Style warnings: %10 - Portability warnings: %11 - Performance warnings: %12 - Information messages: %13 - - Projectinställningar - Projekt: %1 - Sökvägar: %2 - Include sökvägar: %3 - Defines: %4 -Föregående analys - Sökväg: %5 - Antal analyserade filer: %6 - Tid: %7 -Statistik - Fel: %8 - Varningar: %9 - Stil varningar: %10 - Portability warnings: %11 - Prestanda varningar: %12 - Information meddelanden: %13 + + Project Settings + - - <h3>Project Settings<h3> -<table> - <tr><th>Project:</th><td>%1</td></tr> - <tr><th>Paths:</th><td>%2</td></tr> - <tr><th>Include paths:</th><td>%3</td></tr> - <tr><th>Defines:</th><td>%4</td></tr> -</table> -<h3>Previous Scan</h3> -<table> - <tr><th>Path selected:</th><td>%5</td></tr> - <tr><th>Number of files scanned:</th><td>%6</td></tr> - <tr><th>Scan duration:</th><td>%7</td></tr> -</table> -<h3>Statistics</h3> - <tr><th>Errors:</th><td>%8</td></tr> - <tr><th>Warnings:</th><td>%9</td></tr> - <tr><th>Style warnings:</th><td>%10</td></tr> - <tr><th>Portability warnings:</th><td>%11</td></tr> - <tr><th>Performance warnings:</th><td>%12</td></tr> - <tr><th>Information messages:</th><td>%13</td></tr> -</table> - - orkade inte skriva html koden - Projekt Inställningar -Projekt: %1 -Sökvägar: %2 -Include sökvägar: %3 -Defines: %4 - -Föregående Analys -Vald sökväg: %5 -Antal analyserade filer: %6 -Tid: %7 - -Statistik -Fel: %8 -Varningar: %9 -Style-varningar: %10 -Portabilitets varningar: %11 -Prestanda varningar: %12 -Informations meddelanden: %13 + + Paths + Sökvägar + + + + Include paths + + + + + Defines + + + + + Path selected + + + + + Number of files scanned + + + + + Scan duration + + + + + Errors + Fel + + + + Warnings + Varningar + + + + Style warnings + Stil varningar + + + + Portability warnings + + + + + Performance warnings + Prestanda varningar + + + + Information messages + From bfd3cc102ddfa4dde6997c88dc3a078a161dc10b Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 26 Sep 2011 23:54:08 +0300 Subject: [PATCH 3/6] Update VS solution files for test project name change. --- cppcheck.sln | 20 ++++++++++---------- cppcheck_vs2010.sln | 34 ++++++++++++++++------------------ 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/cppcheck.sln b/cppcheck.sln index 61013a97d..3b5ac7bf7 100644 --- a/cppcheck.sln +++ b/cppcheck.sln @@ -1,8 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 +# Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppcheck", "cli\cppcheck.vcproj", "{230A4467-25A6-3276-A1D0-CB521812CD43}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{5B7869EA-A1CB-3E73-8569-5B385608779E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrunner", "test\testrunner.vcproj", "{A1772A4C-E3F0-33FC-9A59-2189857FB799}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,14 +20,14 @@ Global {230A4467-25A6-3276-A1D0-CB521812CD43}.Release|Win32.Build.0 = Release|Win32 {230A4467-25A6-3276-A1D0-CB521812CD43}.Release-x64|Win32.ActiveCfg = Release-x64|Win32 {230A4467-25A6-3276-A1D0-CB521812CD43}.Release-x64|Win32.Build.0 = Release-x64|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Debug|Win32.ActiveCfg = Debug|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Debug|Win32.Build.0 = Debug|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Debug-x64|Win32.ActiveCfg = Debug-x64|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Debug-x64|Win32.Build.0 = Debug-x64|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Release|Win32.ActiveCfg = Release|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Release|Win32.Build.0 = Release|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Release-x64|Win32.ActiveCfg = Release-x64|Win32 - {5B7869EA-A1CB-3E73-8569-5B385608779E}.Release-x64|Win32.Build.0 = Release-x64|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Debug|Win32.ActiveCfg = Debug|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Debug|Win32.Build.0 = Debug|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Debug-x64|Win32.ActiveCfg = Debug-x64|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Debug-x64|Win32.Build.0 = Debug-x64|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Release|Win32.ActiveCfg = Release|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Release|Win32.Build.0 = Release|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Release-x64|Win32.ActiveCfg = Release-x64|Win32 + {A1772A4C-E3F0-33FC-9A59-2189857FB799}.Release-x64|Win32.Build.0 = Release-x64|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/cppcheck_vs2010.sln b/cppcheck_vs2010.sln index cc1f27116..a117376c1 100644 --- a/cppcheck_vs2010.sln +++ b/cppcheck_vs2010.sln @@ -1,8 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppcheck", "cli\cppcheck.vcxproj", "{7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppcheck", "cli\cppcheck.vcxproj", "{35CBDF51-2456-3EC3-99ED-113C30858883}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcxproj", "{BA98E531-D8B3-39CB-8171-064854404B81}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrunner", "test\testrunner.vcxproj", "{4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,22 +12,20 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Debug|Win32.ActiveCfg = Debug|Win32 - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Debug|Win32.Build.0 = Debug|Win32 - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Debug|x64.ActiveCfg = Debug|x64 - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Debug|x64.Build.0 = Debug|x64 - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Release|Win32.ActiveCfg = Release|Win32 - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Release|Win32.Build.0 = Release|Win32 - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Release|x64.ActiveCfg = Release|x64 - {7D0D241B-E144-3FAC-ABD3-8D1BBA4B600A}.Release|x64.Build.0 = Release|x64 - {BA98E531-D8B3-39CB-8171-064854404B81}.Debug|Win32.ActiveCfg = Debug|Win32 - {BA98E531-D8B3-39CB-8171-064854404B81}.Debug|Win32.Build.0 = Debug|Win32 - {BA98E531-D8B3-39CB-8171-064854404B81}.Debug|x64.ActiveCfg = Debug|x64 - {BA98E531-D8B3-39CB-8171-064854404B81}.Debug|x64.Build.0 = Debug|x64 - {BA98E531-D8B3-39CB-8171-064854404B81}.Release|Win32.ActiveCfg = Release|Win32 - {BA98E531-D8B3-39CB-8171-064854404B81}.Release|Win32.Build.0 = Release|Win32 - {BA98E531-D8B3-39CB-8171-064854404B81}.Release|x64.ActiveCfg = Release|x64 - {BA98E531-D8B3-39CB-8171-064854404B81}.Release|x64.Build.0 = Release|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|Win32.ActiveCfg = Debug|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|Win32.Build.0 = Debug|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|x64.ActiveCfg = Debug|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Debug|x64.Build.0 = Debug|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|Win32.ActiveCfg = Release|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|Win32.Build.0 = Release|Win32 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|x64.ActiveCfg = Release|x64 + {35CBDF51-2456-3EC3-99ED-113C30858883}.Release|x64.Build.0 = Release|x64 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug|Win32.ActiveCfg = Debug|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug|Win32.Build.0 = Debug|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Debug|x64.ActiveCfg = Debug|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release|Win32.ActiveCfg = Release|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release|Win32.Build.0 = Release|Win32 + {4F7DCE5E-6CDE-38C4-9EA7-27AF3B25CEB4}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 2d717d77cd9566320c350479f68673dd7d0ef61e Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Mon, 26 Sep 2011 21:24:34 -0400 Subject: [PATCH 4/6] reduce false negatives for checking for CheckOther::checkSignOfUnsignedVariable() --- lib/checkother.cpp | 12 +++- test/testother.cpp | 147 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 3 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 40405c88f..cdcbf2c0d 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2526,24 +2526,30 @@ void CheckOther::checkSignOfUnsignedVariable() // check all the code in the function for (const Token *tok = scope->classStart; tok && tok != scope->classStart->link(); tok = tok->next()) { - if (Token::Match(tok, "( %var% <|<= 0 )") && tok->next()->varId()) + if (Token::Match(tok, "(|&&|%oror% %var% <|<= 0 )|&&|%oror%") && tok->next()->varId()) { const Variable * var = symbolDatabase->getVariableFromVarId(tok->next()->varId()); if (var && var->typeEndToken()->isUnsigned()) unsignedLessThanZeroError(tok->next(), tok->next()->str()); } - else if (Token::Match(tok, "( 0 > %var% )") && tok->tokAt(3)->varId()) + else if (Token::Match(tok, "(|&&|%oror% 0 > %var% )|&&|%oror%") && tok->tokAt(3)->varId()) { const Variable * var = symbolDatabase->getVariableFromVarId(tok->tokAt(3)->varId()); if (var && var->typeEndToken()->isUnsigned()) unsignedLessThanZeroError(tok->tokAt(3), tok->strAt(3)); } - else if (Token::Match(tok, "( 0 <= %var% )") && tok->tokAt(3)->varId()) + else if (Token::Match(tok, "(|&&|%oror% 0 <= %var% )|&&|%oror%") && tok->tokAt(3)->varId()) { const Variable * var = symbolDatabase->getVariableFromVarId(tok->tokAt(3)->varId()); if (var && var->typeEndToken()->isUnsigned()) unsignedPositiveError(tok->tokAt(3), tok->strAt(3)); } + else if (Token::Match(tok, "(|&&|%oror% %var% >= 0 )|&&|%oror%") && tok->next()->varId()) + { + const Variable * var = symbolDatabase->getVariableFromVarId(tok->next()->varId()); + if (var && var->typeEndToken()->isUnsigned()) + unsignedPositiveError(tok->next(), tok->next()->str()); + } } } } diff --git a/test/testother.cpp b/test/testother.cpp index 9d3569ca4..237ef2a6b 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -3241,6 +3241,153 @@ private: " return false;\n" "}"); ASSERT_EQUALS("", errout.str()); + + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (x < 0 && y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is less than zero.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (x < 0 && y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (0 > x && y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is less than zero.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (0 > x && y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (x >= 0 && y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is positive is always true.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (x >= 0 && y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (y && x < 0)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is less than zero.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (y && x < 0)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (y && 0 > x)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is less than zero.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (y && 0 > x)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (y && x >= 0)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is positive is always true.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (y && x >= 0)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (x < 0 || y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is less than zero.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (x < 0 || y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (0 > x || y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is less than zero.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (0 > x || y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(unsigned int x, bool y) {\n" + " if (x >= 0 || y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("[test.cpp:2]: (style) Checking if unsigned variable 'x' is positive is always true.\n", errout.str()); + + check_signOfUnsignedVariable( + "bool foo(int x, bool y) {\n" + " if (x >= 0 || y)" + " return true;\n" + " return false;\n" + "}"); + ASSERT_EQUALS("", errout.str()); } }; From ec377d24ebd6788e77f6548030f5142f6a12fb62 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Mon, 26 Sep 2011 22:08:24 -0400 Subject: [PATCH 5/6] add support for Microsoft TCHAR character constants --- lib/tokenize.cpp | 12 ++++++++++++ test/testtokenize.cpp | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index a54b77ee5..741c3e43f 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -10633,6 +10633,12 @@ void Tokenizer::simplifyMicrosoftStringFunctions() tok->deleteThis(); tok->deleteNext(); } + else if (Token::Match(tok, "_T ( %any% )") && tok->strAt(2)[0] == '\'') + { + tok->deleteThis(); + tok->deleteThis(); + tok->deleteNext(); + } } } else if (_settings->platformType == Settings::Win32W || @@ -10690,6 +10696,12 @@ void Tokenizer::simplifyMicrosoftStringFunctions() tok->deleteThis(); tok->deleteNext(); } + else if (Token::Match(tok, "_T ( %any% )") && tok->strAt(2)[0] == '\'') + { + tok->deleteThis(); + tok->deleteThis(); + tok->deleteNext(); + } } } } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 827c9b6f9..963b9d2ee 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -6101,6 +6101,7 @@ private: "PCTSTR pctstr;" "LPCTSTR lpctstr;" "void foo() {" + " TCHAR tc = _T(\'c\'); " " TCHAR src[10] = _T(\"123456789\");" " TCHAR dst[10];" " _tcscpy(dst, src);" @@ -6119,6 +6120,7 @@ private: "const char * pctstr ; " "const char * lpctstr ; " "void foo ( ) { " + "char tc ; tc = \'c\' ; " "char src [ 10 ] = \"123456789\" ; " "char dst [ 10 ] ; " "strcpy ( dst , src ) ; " @@ -6142,6 +6144,7 @@ private: "PCTSTR pctstr;" "LPCTSTR lpctstr;" "void foo() {" + " TCHAR tc = _T(\'c\');" " TCHAR src[10] = _T(\"123456789\");" " TCHAR dst[10];" " _tcscpy(dst, src);" @@ -6160,6 +6163,7 @@ private: "const unsigned short * pctstr ; " "const unsigned short * lpctstr ; " "void foo ( ) { " + "unsigned short tc ; tc = \'c\' ; " "unsigned short src [ 10 ] = \"123456789\" ; " "unsigned short dst [ 10 ] ; " "wcscpy ( dst , src ) ; " From 44a926aa4dfe97b0d4ebd27f8434b0256143e889 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Tue, 27 Sep 2011 07:29:36 -0400 Subject: [PATCH 6/6] add a few more Microsoft TCHAR function conversions --- lib/tokenize.cpp | 86 +++++++++++++++++++++++++++++++++++-------- test/testtokenize.cpp | 4 ++ 2 files changed, 75 insertions(+), 15 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 741c3e43f..0f47bad0e 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -10583,30 +10583,62 @@ void Tokenizer::simplifyMicrosoftStringFunctions() { for (Token *tok = _tokens; tok; tok = tok->next()) { - if (Token::simpleMatch(tok, "_tcscpy (")) + if (Token::simpleMatch(tok, "_topen (")) { - tok->str("strcpy"); + tok->str("open"); + } + else if (Token::simpleMatch(tok, "_tfopen (")) + { + tok->str("fopen"); } else if (Token::simpleMatch(tok, "_tcscat (")) { tok->str("strcat"); } - else if (Token::simpleMatch(tok, "_tcsncpy (")) + else if (Token::simpleMatch(tok, "_tcschr (")) { - tok->str("strncpy"); + tok->str("strchr"); } - else if (Token::simpleMatch(tok, "_tcsncat (")) + else if (Token::simpleMatch(tok, "_tcscmp (")) { - tok->str("strncat"); + tok->str("strcmp"); + } + else if (Token::simpleMatch(tok, "_tcsdup (")) + { + tok->str("strdup"); + } + else if (Token::simpleMatch(tok, "_tcscpy (")) + { + tok->str("strcpy"); } else if (Token::simpleMatch(tok, "_tcslen (")) { tok->str("strlen"); } + else if (Token::simpleMatch(tok, "_tcsncat (")) + { + tok->str("strncat"); + } + else if (Token::simpleMatch(tok, "_tcsncpy (")) + { + tok->str("strncpy"); + } else if (Token::simpleMatch(tok, "_tcsnlen (")) { tok->str("strnlen"); } + else if (Token::simpleMatch(tok, "_tcsrchr (")) + { + tok->str("strrchr"); + } + else if (Token::simpleMatch(tok, "_tcsstr (")) + { + tok->str("strstr"); + } + else if (Token::simpleMatch(tok, "_tcstok (")) + { + tok->str("strtok"); + } else if (Token::simpleMatch(tok, "_tprintf (")) { tok->str("printf"); @@ -10646,30 +10678,54 @@ void Tokenizer::simplifyMicrosoftStringFunctions() { for (Token *tok = _tokens; tok; tok = tok->next()) { - if (Token::simpleMatch(tok, "_tcscpy (")) - { - tok->str("wcscpy"); - } - else if (Token::simpleMatch(tok, "_tcscat (")) + if (Token::simpleMatch(tok, "_tcscat (")) { tok->str("wcscat"); } - else if (Token::simpleMatch(tok, "_tcsncpy (")) + else if (Token::simpleMatch(tok, "_tcschr (")) { - tok->str("wcsncpy"); + tok->str("wcschr"); } - else if (Token::simpleMatch(tok, "_tcsncat (")) + else if (Token::simpleMatch(tok, "_tcscmp (")) { - tok->str("wcsncat"); + tok->str("wcscmp"); + } + else if (Token::simpleMatch(tok, "_tcscpy (")) + { + tok->str("wcscpy"); + } + else if (Token::simpleMatch(tok, "_tcsdup (")) + { + tok->str("wcsdup"); } else if (Token::simpleMatch(tok, "_tcslen (")) { tok->str("wcslen"); } + else if (Token::simpleMatch(tok, "_tcsncat (")) + { + tok->str("wcsncat"); + } + else if (Token::simpleMatch(tok, "_tcsncpy (")) + { + tok->str("wcsncpy"); + } else if (Token::simpleMatch(tok, "_tcsnlen (")) { tok->str("wcsnlen"); } + else if (Token::simpleMatch(tok, "_tcsrchr (")) + { + tok->str("wcsrchr"); + } + else if (Token::simpleMatch(tok, "_tcsstr (")) + { + tok->str("wcsstr"); + } + else if (Token::simpleMatch(tok, "_tcstok (")) + { + tok->str("wcstok"); + } else if (Token::simpleMatch(tok, "_tprintf (")) { tok->str("wprintf"); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 963b9d2ee..dc1232703 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -6107,6 +6107,7 @@ private: " _tcscpy(dst, src);" " dst[0] = 0;" " _tcscat(dst, src);" + " LPTSTR d = _tcsdup(str);" " _tprintf(_T(\"Hello world!\n\"));" " _stprintf(dst, _T(\"Hello!\n\"));" " _sntprintf(dst, sizeof(dst) / sizeof(TCHAR), _T(\"Hello world!\n\"));" @@ -6126,6 +6127,7 @@ private: "strcpy ( dst , src ) ; " "dst [ 0 ] = 0 ; " "strcat ( dst , src ) ; " + "char * d ; d = strdup ( str ) ; " "printf ( \"Hello world!\n\" ) ; " "sprintf ( dst , \"Hello!\n\" ) ; " "snprintf ( dst , sizeof ( dst ) / sizeof ( char ) , \"Hello world!\n\" ) ; " @@ -6150,6 +6152,7 @@ private: " _tcscpy(dst, src);" " dst[0] = 0;" " _tcscat(dst, src);" + " LPTSTR d = _tcsdup(str);" " _tprintf(_T(\"Hello world!\n\"));" " _stprintf(dst, _T(\"Hello!\n\"));" " _sntprintf(dst, sizeof(dst) / sizeof(TCHAR), _T(\"Hello world!\n\"));" @@ -6169,6 +6172,7 @@ private: "wcscpy ( dst , src ) ; " "dst [ 0 ] = 0 ; " "wcscat ( dst , src ) ; " + "unsigned short * d ; d = wcsdup ( str ) ; " "wprintf ( \"Hello world!\n\" ) ; " "swprintf ( dst , \"Hello!\n\" ) ; " "snwprintf ( dst , sizeof ( dst ) / sizeof ( unsigned short ) , \"Hello world!\n\" ) ; "