This commit is contained in:
Sébastien Debrard 2011-02-05 00:09:53 +01:00
commit 0fa9881dac
14 changed files with 237 additions and 148 deletions

View File

@ -648,7 +648,7 @@ void CmdLineParser::PrintHelp()
" -i [dir] Give path to ignore. Give several -i parameters to ignore\n"
" several paths. Give directory name or filename with path\n"
" as parameter. Directory name is matched to all parts of the\n"
" path."
" path.\n"
" --inline-suppr Enable inline suppressions. Use them by placing one or\n"
" more comments, like: // cppcheck-suppress warningId\n"
" on the lines before the warning to suppress.\n"

View File

@ -22,7 +22,7 @@
<location filename="about.ui" line="81"/>
<source>Copyright © 2007-2010 Daniel Marjamäki and cppcheck team.</source>
<oldsource>Copyright (C) 2007-2010 Daniel Marjamäki and cppcheck team.</oldsource>
<translation type="unfinished">Copyright (C) 2007-2010 Daniel Marjamäki and cppcheck team.</translation>
<translation>Copyright (C) 2007-2010 Daniel Marjamäki and cppcheck team.</translation>
</message>
<message>
<location filename="about.ui" line="91"/>
@ -83,12 +83,12 @@ kate -l(line) (file)</translation>
<message>
<location filename="application.ui" line="47"/>
<source>Application&apos;s name:</source>
<translation type="unfinished"></translation>
<translation>Programmets namn:</translation>
</message>
<message>
<location filename="application.ui" line="57"/>
<source>Command to execute:</source>
<translation type="unfinished"></translation>
<translation>Kommando</translation>
</message>
<message>
<location filename="application.ui" line="96"/>
@ -142,37 +142,37 @@ kate -l(line) (file)</translation>
<message>
<location filename="helpwindow.ui" line="14"/>
<source>Cppcheck Help</source>
<translation type="unfinished"></translation>
<translation>Cppcheck Hjälp</translation>
</message>
<message>
<location filename="helpwindow.ui" line="22"/>
<source>Go back</source>
<translation type="unfinished"></translation>
<translation> tillbaka</translation>
</message>
<message>
<location filename="helpwindow.ui" line="25"/>
<source>Back</source>
<translation type="unfinished"></translation>
<translation>Bakåt</translation>
</message>
<message>
<location filename="helpwindow.ui" line="42"/>
<source>Go forward</source>
<translation type="unfinished"></translation>
<translation> framåt</translation>
</message>
<message>
<location filename="helpwindow.ui" line="45"/>
<source>Forward</source>
<translation type="unfinished"></translation>
<translation>Fram</translation>
</message>
<message>
<location filename="helpwindow.ui" line="62"/>
<source>Start</source>
<translation type="unfinished"></translation>
<translation>Start</translation>
</message>
<message>
<location filename="helpwindow.ui" line="65"/>
<source>Home</source>
<translation type="unfinished"></translation>
<translation>Hem</translation>
</message>
</context>
<context>
@ -180,42 +180,42 @@ kate -l(line) (file)</translation>
<message>
<location filename="logview.ui" line="17"/>
<source>Checking Log</source>
<translation type="unfinished"></translation>
<translation>Analys logg</translation>
</message>
<message>
<location filename="logview.ui" line="48"/>
<source>&amp;Save</source>
<translation type="unfinished"></translation>
<translation>&amp;Spara</translation>
</message>
<message>
<location filename="logview.ui" line="55"/>
<source>Clear</source>
<translation type="unfinished"></translation>
<translation>Töm</translation>
</message>
<message>
<location filename="logview.ui" line="62"/>
<source>Close</source>
<translation type="unfinished"></translation>
<translation>Stäng</translation>
</message>
<message>
<location filename="logview.cpp" line="65"/>
<source>Save Log</source>
<translation type="unfinished"></translation>
<translation>Spara logg</translation>
</message>
<message>
<location filename="logview.cpp" line="66"/>
<source>Text files (*.txt *.log);;All files (*.*)</source>
<translation type="unfinished"></translation>
<translation>Text filer (*.txt *.log);;Alla filer (*.*)</translation>
</message>
<message>
<location filename="logview.cpp" line="72"/>
<source>Cppcheck</source>
<translation type="unfinished">Cppcheck</translation>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="logview.cpp" line="73"/>
<source>Could not open file for writing: &quot;%1&quot;</source>
<translation type="unfinished"></translation>
<translation>Kunde ej öppna fil för skrivning: &quot;%1&quot;</translation>
</message>
</context>
<context>
@ -285,7 +285,7 @@ kate -l(line) (file)</translation>
<location filename="main.ui" line="208"/>
<location filename="main.ui" line="211"/>
<source>Check files</source>
<translation type="unfinished"></translation>
<translation>Analysera filer</translation>
</message>
<message>
<location filename="main.ui" line="214"/>
@ -301,7 +301,7 @@ kate -l(line) (file)</translation>
<location filename="main.ui" line="226"/>
<location filename="main.ui" line="229"/>
<source>Check directory</source>
<translation type="unfinished"></translation>
<translation>Analysera mapp</translation>
</message>
<message>
<location filename="main.ui" line="232"/>
@ -327,7 +327,7 @@ kate -l(line) (file)</translation>
<location filename="main.ui" line="256"/>
<location filename="main.ui" line="259"/>
<source>Stop checking</source>
<translation type="unfinished"></translation>
<translation>Stoppa analys</translation>
</message>
<message>
<location filename="main.ui" line="262"/>
@ -362,60 +362,60 @@ kate -l(line) (file)</translation>
<message>
<location filename="main.ui" line="327"/>
<source>Errors</source>
<translation type="unfinished"></translation>
<translation>Fel</translation>
</message>
<message>
<location filename="main.ui" line="330"/>
<location filename="main.ui" line="333"/>
<source>Show errors</source>
<translation type="unfinished"></translation>
<translation>Visa fel</translation>
</message>
<message>
<location filename="main.ui" line="455"/>
<source>Warnings</source>
<translation type="unfinished"></translation>
<translation>Varningar</translation>
</message>
<message>
<location filename="main.ui" line="458"/>
<location filename="main.ui" line="461"/>
<source>Show warnings</source>
<translation type="unfinished"></translation>
<translation>Visa varningar</translation>
</message>
<message>
<location filename="main.ui" line="473"/>
<source>Performance warnings</source>
<translation type="unfinished"></translation>
<translation>Prestanda varningar</translation>
</message>
<message>
<location filename="main.ui" line="476"/>
<location filename="main.ui" line="479"/>
<source>Show performance warnings</source>
<translation type="unfinished"></translation>
<translation>Visa prestanda varningar</translation>
</message>
<message>
<location filename="main.ui" line="487"/>
<source>Show &amp;hidden</source>
<translation type="unfinished"></translation>
<translation>Visa dolda</translation>
</message>
<message>
<location filename="main.ui" line="499"/>
<source>Information</source>
<translation type="unfinished"></translation>
<translation>Information</translation>
</message>
<message>
<location filename="main.ui" line="502"/>
<source>Show information messages</source>
<translation type="unfinished"></translation>
<translation>Visa informations meddelanden</translation>
</message>
<message>
<location filename="main.ui" line="514"/>
<source>Portability</source>
<translation type="unfinished"></translation>
<translation>Portabilitet</translation>
</message>
<message>
<location filename="main.ui" line="517"/>
<source>Show portability warnings</source>
<translation type="unfinished"></translation>
<translation>Visa portabilitets varningar</translation>
</message>
<message>
<location filename="main.ui" line="338"/>
@ -466,42 +466,42 @@ kate -l(line) (file)</translation>
<message>
<location filename="main.ui" line="396"/>
<source>&amp;Open XML...</source>
<translation type="unfinished"></translation>
<translation>&amp;Öppna XML...</translation>
</message>
<message>
<location filename="main.ui" line="405"/>
<source>Open P&amp;roject File...</source>
<translation type="unfinished"></translation>
<translation>Öppna Projektfil...</translation>
</message>
<message>
<location filename="main.ui" line="410"/>
<source>&amp;New Project File...</source>
<translation type="unfinished"></translation>
<translation>Ny projektfil...</translation>
</message>
<message>
<location filename="main.ui" line="415"/>
<source>&amp;Log View</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="main.ui" line="418"/>
<source>Log View</source>
<translation type="unfinished"></translation>
<translation>Logg vy</translation>
</message>
<message>
<location filename="main.ui" line="426"/>
<source>C&amp;lose Project File</source>
<translation type="unfinished"></translation>
<translation>Stäng projektfil</translation>
</message>
<message>
<location filename="main.ui" line="434"/>
<source>&amp;Edit Project File...</source>
<translation type="unfinished"></translation>
<translation>Redigera projektfil...</translation>
</message>
<message>
<location filename="main.ui" line="443"/>
<source>&amp;Statistics</source>
<translation type="unfinished"></translation>
<translation>Statistik</translation>
</message>
<message>
<location filename="main.ui" line="369"/>
@ -516,13 +516,13 @@ kate -l(line) (file)</translation>
<message>
<location filename="main.ui" line="309"/>
<source>Style warnings</source>
<translation type="unfinished"></translation>
<translation>Stil varningar</translation>
</message>
<message>
<location filename="main.ui" line="312"/>
<location filename="main.ui" line="315"/>
<source>Show style warnings</source>
<translation type="unfinished"></translation>
<translation>Visa stil varningar</translation>
</message>
<message>
<location filename="main.ui" line="372"/>
@ -583,26 +583,28 @@ kate -l(line) (file)</translation>
<message>
<location filename="mainwindow.cpp" line="234"/>
<source>You must close the project file before selecting new files or directories!</source>
<translation type="unfinished"></translation>
<translation>Du måste stänga projektfilen innan nya filer eller sökvägar kan väljas!</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="306"/>
<location filename="mainwindow.cpp" line="742"/>
<location filename="mainwindow.cpp" line="788"/>
<source>Project: </source>
<translation type="unfinished"></translation>
<translation>Projekt.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="445"/>
<source>Open the report file</source>
<translation type="unfinished"></translation>
<translation>Öppna rapportfilen</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="520"/>
<source>Checking is running.
Do you want to stop the checking and exit Cppcheck?.</source>
<translation type="unfinished"></translation>
<translation>Cppcheck kör.
Vill du stoppa analysen och avsluta Cppcheck?</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="598"/>
@ -639,38 +641,38 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<location filename="mainwindow.cpp" line="709"/>
<location filename="mainwindow.cpp" line="718"/>
<source>Cppcheck Help</source>
<translation type="unfinished"></translation>
<translation>Cppcheck Hjälp</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="709"/>
<source>Failed to load help file (not found)</source>
<translation type="unfinished"></translation>
<translation>Misslyckades att öppna hjälpfilen (hittades ej)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="718"/>
<source>Failed to load help file</source>
<translation type="unfinished"></translation>
<translation>Misslykades att öppna hjälpfilen</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="732"/>
<location filename="mainwindow.cpp" line="777"/>
<source>Project files (*.cppcheck);;All files(*.*)</source>
<translation type="unfinished"></translation>
<translation>Projektfiler (*.cppcheck);;Alla filer(*.*)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="734"/>
<source>Select Project File</source>
<translation type="unfinished"></translation>
<translation>Välj projektfil</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="779"/>
<source>Select Project Filename</source>
<translation type="unfinished"></translation>
<translation>Välj Projektfil</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="812"/>
<source>No project file loaded</source>
<translation type="unfinished"></translation>
<translation>Inget projekt laddat</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="33"/>
@ -711,12 +713,12 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<location filename="translationhandler.cpp" line="38"/>
<source>Japanese</source>
<oldsource>Japanease</oldsource>
<translation type="unfinished"></translation>
<translation>Japanska</translation>
</message>
<message>
<location filename="translationhandler.cpp" line="39"/>
<source>Serbian</source>
<translation type="unfinished"></translation>
<translation>Serbiska</translation>
</message>
</context>
<context>
@ -725,17 +727,17 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<location filename="project.cpp" line="63"/>
<location filename="project.cpp" line="103"/>
<source>Cppcheck</source>
<translation type="unfinished">Cppcheck</translation>
<translation>Cppcheck</translation>
</message>
<message>
<location filename="project.cpp" line="64"/>
<source>Could not read the project file.</source>
<translation type="unfinished"></translation>
<translation>Kunde ej läsa projektfilen.</translation>
</message>
<message>
<location filename="project.cpp" line="104"/>
<source>Could not write the project file.</source>
<translation type="unfinished"></translation>
<translation>Kunde ej skriva projektfilen</translation>
</message>
</context>
<context>
@ -743,33 +745,33 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<message>
<location filename="projectfile.ui" line="14"/>
<source>Project File</source>
<translation type="unfinished"></translation>
<translation>Projektfil</translation>
</message>
<message>
<location filename="projectfile.ui" line="22"/>
<source>Project:</source>
<translation type="unfinished"></translation>
<translation>Projekt:</translation>
</message>
<message>
<location filename="projectfile.ui" line="39"/>
<source>Paths:</source>
<translation type="unfinished"></translation>
<translation>Sökvägar:</translation>
</message>
<message>
<location filename="projectfile.ui" line="52"/>
<location filename="projectfile.ui" line="76"/>
<source>Browse...</source>
<translation type="unfinished"></translation>
<translation>Bläddra...</translation>
</message>
<message>
<location filename="projectfile.ui" line="63"/>
<source>Include paths:</source>
<translation type="unfinished"></translation>
<translation>Include sökvägar:</translation>
</message>
<message>
<location filename="projectfile.ui" line="87"/>
<source>Defines:</source>
<translation type="unfinished"></translation>
<translation>Defines:</translation>
</message>
</context>
<context>
@ -777,17 +779,17 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<message>
<location filename="projectfiledialog.cpp" line="36"/>
<source>Project file: %1</source>
<translation type="unfinished"></translation>
<translation>Projektfil: %1</translation>
</message>
<message>
<location filename="projectfiledialog.cpp" line="153"/>
<source>Select include directory</source>
<translation type="unfinished"></translation>
<translation>Välj include sökväg</translation>
</message>
<message>
<location filename="projectfiledialog.cpp" line="165"/>
<source>Select directory to check</source>
<translation type="unfinished">Välj katalog som skall kontrolleras</translation>
<translation>Välj katalog som skall kontrolleras</translation>
</message>
</context>
<context>
@ -834,7 +836,7 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<location filename="resultstree.cpp" line="59"/>
<location filename="resultstree.cpp" line="978"/>
<source>Summary</source>
<translation type="unfinished"></translation>
<translation>Sammanfattning</translation>
</message>
<message>
<location filename="resultstree.cpp" line="108"/>
@ -859,7 +861,7 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<message>
<location filename="resultstree.cpp" line="511"/>
<source>Hide</source>
<translation type="unfinished"></translation>
<translation>Dölj</translation>
</message>
<message>
<location filename="resultstree.cpp" line="558"/>
@ -875,7 +877,7 @@ Do you want to stop the checking and exit Cppcheck?.</source>
<message>
<location filename="resultstree.cpp" line="586"/>
<source>Could not find the file!</source>
<translation type="unfinished"></translation>
<translation>Kunde inte hitta filen!</translation>
</message>
<message>
<location filename="resultstree.cpp" line="624"/>
@ -891,12 +893,14 @@ Kontrollera att sökvägen och parametrarna är korrekta.</translation>
<source>Could not find file:
%1
Please select the directory where file is located.</source>
<translation type="unfinished"></translation>
<translation>Kunde inte hitta filen:
%1
Välj mappen där filen finns.</translation>
</message>
<message>
<location filename="resultstree.cpp" line="645"/>
<source>Select Directory</source>
<translation type="unfinished"></translation>
<translation>Välj mapp</translation>
</message>
<message>
<location filename="resultstree.cpp" line="827"/>
@ -911,22 +915,22 @@ Please select the directory where file is located.</source>
<message>
<location filename="resultstree.cpp" line="835"/>
<source>warning</source>
<translation type="unfinished"></translation>
<translation>varning</translation>
</message>
<message>
<location filename="resultstree.cpp" line="839"/>
<source>performance</source>
<translation type="unfinished"></translation>
<translation>prestanda</translation>
</message>
<message>
<location filename="resultstree.cpp" line="843"/>
<source>portability</source>
<translation type="unfinished"></translation>
<translation>portabilitet</translation>
</message>
<message>
<location filename="resultstree.cpp" line="847"/>
<source>information</source>
<translation type="unfinished"></translation>
<translation>information</translation>
</message>
</context>
<context>
@ -953,17 +957,17 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<location filename="resultsview.cpp" line="251"/>
<location filename="resultsview.cpp" line="261"/>
<source>Failed to read the report.</source>
<translation type="unfinished"></translation>
<translation>Misslyckades att läsa rapporten.</translation>
</message>
<message>
<location filename="resultsview.cpp" line="302"/>
<source>Summary</source>
<translation type="unfinished"></translation>
<translation>Sammanfattning</translation>
</message>
<message>
<location filename="resultsview.cpp" line="303"/>
<source>Message</source>
<translation type="unfinished"></translation>
<translation>Meddelande</translation>
</message>
<message>
<location filename="resultsview.cpp" line="117"/>
@ -997,12 +1001,12 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<message>
<location filename="settings.ui" line="32"/>
<source>Include paths:</source>
<translation type="unfinished"></translation>
<translation>Include sökvägar:</translation>
</message>
<message>
<location filename="settings.ui" line="45"/>
<source>Add...</source>
<translation type="unfinished"></translation>
<translation>Lägg till...</translation>
</message>
<message>
<location filename="settings.ui" line="65"/>
@ -1012,18 +1016,18 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<message>
<location filename="settings.ui" line="109"/>
<source>Ideal count:</source>
<translation type="unfinished"></translation>
<translation>Optimalt värde:</translation>
</message>
<message>
<location filename="settings.ui" line="116"/>
<source>TextLabel</source>
<translation type="unfinished"></translation>
<translation>TextLabel</translation>
</message>
<message>
<location filename="settings.ui" line="138"/>
<source>Force checking all #ifdef configurations</source>
<oldsource>Check all #ifdef configurations</oldsource>
<translation type="unfinished">Kontrollera alla #ifdef konfigurationer</translation>
<translation>Kontrollera alla #ifdef konfigurationer</translation>
</message>
<message>
<location filename="settings.ui" line="145"/>
@ -1038,12 +1042,12 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<message>
<location filename="settings.ui" line="159"/>
<source>Show internal warnings in log</source>
<translation type="unfinished"></translation>
<translation>Visa interna fel i loggen</translation>
</message>
<message>
<location filename="settings.ui" line="166"/>
<source>Enable inline suppressions</source>
<translation type="unfinished"></translation>
<translation>Använd inline suppressions</translation>
</message>
<message>
<location filename="settings.ui" line="187"/>
@ -1088,7 +1092,7 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<message>
<location filename="settings.ui" line="259"/>
<source>Language</source>
<translation type="unfinished"></translation>
<translation>Språk</translation>
</message>
</context>
<context>
@ -1096,7 +1100,7 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<message>
<location filename="settingsdialog.cpp" line="81"/>
<source>N/A</source>
<translation type="unfinished"></translation>
<translation>Ej tillgängligt</translation>
</message>
<message>
<location filename="settingsdialog.cpp" line="161"/>
@ -1111,7 +1115,7 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<message>
<location filename="settingsdialog.cpp" line="259"/>
<source>Select include directory</source>
<translation type="unfinished"></translation>
<translation>Välj include mapp</translation>
</message>
</context>
<context>
@ -1120,143 +1124,143 @@ För att ställa in vilka fel som skall visas använd visa menyn.</translation>
<location filename="stats.ui" line="14"/>
<location filename="stats.ui" line="228"/>
<source>Statistics</source>
<translation type="unfinished"></translation>
<translation>Statistik</translation>
</message>
<message>
<location filename="stats.ui" line="27"/>
<source>Project</source>
<translation type="unfinished"></translation>
<translation>Projekt</translation>
</message>
<message>
<location filename="stats.ui" line="33"/>
<source>Project:</source>
<translation type="unfinished"></translation>
<translation>Projekt:</translation>
</message>
<message>
<location filename="stats.ui" line="53"/>
<source>Paths:</source>
<translation type="unfinished"></translation>
<translation>Sökvägar:</translation>
</message>
<message>
<location filename="stats.ui" line="85"/>
<source>Include paths:</source>
<translation type="unfinished"></translation>
<translation>Include sökvägar:</translation>
</message>
<message>
<location filename="stats.ui" line="108"/>
<source>Defines:</source>
<translation type="unfinished"></translation>
<translation>Defines:</translation>
</message>
<message>
<location filename="stats.ui" line="145"/>
<source>Previous Scan</source>
<translation type="unfinished"></translation>
<translation>Föregående analys</translation>
</message>
<message>
<location filename="stats.ui" line="151"/>
<source>Path Selected:</source>
<translation type="unfinished"></translation>
<translation>Vald sökväg:</translation>
</message>
<message>
<location filename="stats.ui" line="161"/>
<source>Number of Files Scanned:</source>
<translation type="unfinished"></translation>
<translation>Antal analyserade filer:</translation>
</message>
<message>
<location filename="stats.ui" line="181"/>
<source>Scan Duration:</source>
<translation type="unfinished"></translation>
<translation>Analys tid:</translation>
</message>
<message>
<location filename="stats.ui" line="236"/>
<source>Errors:</source>
<translation type="unfinished"></translation>
<translation>Fel:</translation>
</message>
<message>
<location filename="stats.ui" line="254"/>
<source>Warnings:</source>
<translation type="unfinished"></translation>
<translation>Varningar:</translation>
</message>
<message>
<location filename="stats.ui" line="272"/>
<source>Stylistic warnings:</source>
<translation type="unfinished"></translation>
<translation>Stil varningar:</translation>
</message>
<message>
<location filename="stats.ui" line="290"/>
<source>Portability warnings:</source>
<translation type="unfinished"></translation>
<translation>Portabilitets varningar:</translation>
</message>
<message>
<location filename="stats.ui" line="297"/>
<location filename="stats.ui" line="333"/>
<source>TextLabel</source>
<translation type="unfinished"></translation>
<translation>TextLabel</translation>
</message>
<message>
<location filename="stats.ui" line="308"/>
<source>Performance issues:</source>
<translation type="unfinished"></translation>
<translation>Prestanda varningar:</translation>
</message>
<message>
<location filename="stats.ui" line="326"/>
<source>Information messages:</source>
<translation type="unfinished"></translation>
<translation>Informations meddelanden:</translation>
</message>
<message>
<location filename="stats.ui" line="362"/>
<source>Copy to Clipboard</source>
<translation type="unfinished"></translation>
<translation>Kopiera</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="81"/>
<source>1 day</source>
<translation type="unfinished"></translation>
<translation>1 dag</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="81"/>
<source>%1 days</source>
<translation type="unfinished"></translation>
<translation>%1 dagar</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="83"/>
<source>1 hour</source>
<translation type="unfinished"></translation>
<translation>1 timme</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="83"/>
<source>%1 hours</source>
<translation type="unfinished"></translation>
<translation>%1 timmar</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="85"/>
<source>1 minute</source>
<translation type="unfinished"></translation>
<translation>1 minut</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="85"/>
<source>%1 minutes</source>
<translation type="unfinished"></translation>
<translation>%1 minuter</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="87"/>
<source>1 second</source>
<translation type="unfinished"></translation>
<translation>1 sekund</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="87"/>
<source>%1 seconds</source>
<translation type="unfinished"></translation>
<translation>%1 sekunder</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="91"/>
<source>0.%1 seconds</source>
<translation type="unfinished"></translation>
<translation>0.%1 sekunder</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="93"/>
<source> and </source>
<translation type="unfinished"></translation>
<translation> och </translation>
</message>
<message>
<location filename="statsdialog.cpp" line="102"/>
@ -1277,7 +1281,22 @@ Statistics
Performance warnings: %12
Information messages: %13
</source>
<translation type="unfinished"></translation>
<translation>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</translation>
</message>
<message>
<location filename="statsdialog.cpp" line="135"/>

View File

@ -2708,7 +2708,7 @@ void CheckMemoryLeakInClass::check()
const Scope *scope = *i;
// only check classes and structures
if (scope->type == Scope::eClass)
if (scope->isClassOrStruct())
{
std::list<Variable>::const_iterator var;
for (var = scope->varlist.begin(); var != scope->varlist.end(); ++var)
@ -2999,7 +2999,7 @@ void CheckMemoryLeakStructMember::check()
break;
// Struct member is allocated => check if it is also properly deallocated..
else if (Token::Match(tok2, "%varid% . %var% = malloc|strdup|kmalloc (", vartok->varId()))
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc (", vartok->varId()))
{
const unsigned int structid(vartok->varId());
const unsigned int structmemberid(tok2->tokAt(2)->varId());

View File

@ -289,7 +289,8 @@ void CheckOther::checkSelfAssignment()
const Token *tok = Token::findmatch(_tokenizer->tokens(), selfAssignmentPattern);
while (tok)
{
if (tok->varId() && tok->varId() == tok->tokAt(2)->varId())
if (Token::Match(tok->previous(), "[;{}]") &&
tok->varId() && tok->varId() == tok->tokAt(2)->varId())
{
selfAssignmentError(tok, tok->str());
}
@ -2731,9 +2732,9 @@ void CheckOther::sprintfOverlappingDataError(const Token *tok, const std::string
{
reportError(tok, Severity::error, "sprintfOverlappingData",
"Undefined behavior: variable is used as parameter and destination in s[n]printf().\n"
"The variable '" + varname + "' is used both as parameter and destination in "
"and destination buffer overlap. Quote from glibc (C-library) documentation "
"(http://www.gnu.org/software/libc/manual/html_mono/libc.html#Formatted-Output-Functions): "
"The variable '" + varname + "' is used both as a parameter and as a destination in "
"s[n]printf(). The origin and destination buffers overlap. Quote from glibc (C-library) "
"documentation (http://www.gnu.org/software/libc/manual/html_mono/libc.html#Formatted-Output-Functions): "
"'If copying takes place between objects that overlap as a result of a call "
"to sprintf() or snprintf(), the results are undefined.'");
}
@ -2846,8 +2847,9 @@ void CheckOther::sizeofsizeofError(const Token *tok)
{
reportError(tok, Severity::warning,
"sizeofsizeof", "Calling sizeof for 'sizeof'.\n"
"This is suspicious code and most likely there should be just"
"one 'sizeof'. The current code is equivalent to 'sizeof(size_t)'");
"Calling sizeof for 'sizeof looks like a suspicious code and "
"most likely there should be just one 'sizeof'. The current "
"code is equivalent to 'sizeof(size_t)'");
}
void CheckOther::sizeofCalculation()
@ -2901,6 +2903,7 @@ void CheckOther::assignmentInAssertError(const Token *tok, const std::string &va
{
reportError(tok, Severity::warning,
"assignmentInAssert", "Assert statement modifies '" + varname + "'.\n"
"Variable '" + varname + "' is modified insert assert statement. "
"Assert statements are removed from release builds so the code inside "
"assert statement is not run. If the code is needed also in release "
"builds this is a bug.");

View File

@ -63,6 +63,7 @@ public:
checkOther.checkRedundantAssignmentInSwitch();
checkOther.checkAssignmentInAssert();
checkOther.checkSizeofForArrayParameter();
checkOther.checkSelfAssignment();
}
/** @brief Run checks against the simplified token list */
@ -82,7 +83,6 @@ public:
checkOther.checkFflushOnInputStream();
checkOther.invalidScanf();
checkOther.checkSelfAssignment();
checkOther.checkIncorrectLogicOperator();
checkOther.checkMisusedScopedObject();
checkOther.checkCatchExceptionByValue();

View File

@ -101,6 +101,7 @@ void CheckPostfixOperator::postfixOperatorError(const Token *tok)
{
reportError(tok, Severity::performance, "postfixOperator",
"Prefer prefix ++/-- operators for non-primitive types.\n"
"Prefix ++/-- operators should be preferred for non-primitive types. "
"Pre-increment/decrement can be more efficient than "
"post-increment/decrement. Post-increment/decrement usually "
"involves keeping a copy of the previous value around and "

View File

@ -724,6 +724,7 @@ void CheckStl::stlBoundriesError(const Token *tok, const std::string &container_
{
reportError(tok, Severity::error, "stlBoundries",
"Dangerous container iterator compare using < operator for " + container_name + "\n"
"Container '" + container_name + "' iterator compared with < operator. "
"Using < operator with container type iterators is dangerous since the order of "
"the items is not guaranteed. One should use != operator instead when comparing "
"iterators in the container.");
@ -782,6 +783,7 @@ void CheckStl::if_findError(const Token *tok, bool str)
if (str)
reportError(tok, Severity::warning, "stlIfStrFind",
"Suspicious checking of string::find() return value.\n"
"Checking of string::find() return value looks Suspicious. "
"string::find will return 0 if the string is found at position 0. "
"If that is wanted to check then string::compare is a faster alternative "
"because it doesn't scan through the string.");
@ -870,6 +872,7 @@ void CheckStl::sizeError(const Token *tok)
const std::string varname(tok ? tok->str().c_str() : "list");
reportError(tok, Severity::performance, "stlSize",
"Possible inefficient checking for '" + varname + "' emptiness.\n"
"Checking for '" + varname + "' emptiness might be inefficient. "
"Using " + varname + ".empty() instead of " + varname + ".size() can be faster. " +
varname + ".size() can take linear time but " + varname + ".empty() is "
"guaranteed to take constant time.");
@ -907,7 +910,9 @@ void CheckStl::redundantCondition()
void CheckStl::redundantIfRemoveError(const Token *tok)
{
reportError(tok, Severity::style, "redundantIfRemove", "Redundant checking of STL container element.\n"
reportError(tok, Severity::style, "redundantIfRemove",
"Redundant checking of STL container element.\n"
"Redundant checking of STL container element existence before removing it. "
"The remove method in the STL will not do anything if element doesn't exist");
}

View File

@ -150,7 +150,7 @@ std::string ErrorLogger::ErrorMessage::getXMLHeader(int xml_version)
// standard xml header
std::ostringstream ostr;
ostr << "<?xml version=\"1.0\"?>\n";
ostr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
// version 1 header
if (xml_version <= 1)

View File

@ -581,7 +581,9 @@ bool SymbolDatabase::isFunction(const Token *tok, const Token **funcStart, const
}
// regular function?
else if (Token::Match(tok, "%var% (") && Token::Match(tok->next()->link(), ") const| ;|{|=|:"))
else if (Token::Match(tok, "%var% (") &&
(Token::Match(tok->next()->link(), ") const| ;|{|=") ||
Token::Match(tok->next()->link(), ") : %var% (")))
{
*funcStart = tok;
*argStart = tok->next();

View File

@ -106,21 +106,24 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
<arg choice="opt"><option>-D[id]</option></arg>
<arg choice="opt"><option>--enable=[id]</option></arg>
<arg choice="opt"><option>--error-exitcode=[n]</option></arg>
<arg choice="opt"><option>--exitcode-suppressions [file]</option></arg>
<arg choice="opt"><option>--errorlist</option></arg>
<arg choice="opt"><option>--exitcode-suppressions=[file]</option></arg>
<arg choice="opt"><option>--file-list=file</option></arg>
<arg choice="opt"><option>--force</option></arg>
<arg choice="opt"><option>--help</option></arg>
<arg choice="opt"><option>-I[dir]</option></arg>
<arg choice="opt"><option>-i[dir]</option></arg>
<arg choice="opt"><option>--inline-suppr</option></arg>
<arg choice="opt"><option>-j[jobs]</option></arg>
<arg choice="opt"><option>--quiet</option></arg>
<arg choice="opt"><option>--report-progress</option></arg>
<arg choice="opt"><option>--style</option></arg>
<arg choice="opt"><option>--suppressions [file]</option></arg>
<arg choice="opt"><option>--suppressions-list=[file]</option></arg>
<arg choice="opt"><option>--template '[text]'</option></arg>
<arg choice="opt"><option>--verbose</option></arg>
<arg choice="opt"><option>--version</option></arg>
<arg choice="opt"><option>--xml</option></arg>
<arg choice="opt"><option>--xml-version=[version]</option></arg>
<arg choice="opt"><option>file or path</option></arg>
<arg choice="plain"><option>...</option></arg>
</cmdsynopsis>
@ -158,34 +161,40 @@ Example: -DDEBUG=1 -D__cplusplus</para>
<varlistentry>
<term><option>--enable=[id]</option></term>
<listitem>
<para>Enable specific checks. The available ids are:
<para>Enable additional checks. The available ids are:
<glosslist>
<glossentry>
<glossterm>all</glossterm>
<glossdef>
<para>Enable all checks.</para>
<para>Enable all checks</para>
</glossdef>
</glossentry>
<glossentry>
<glossterm>style</glossterm>
<glossdef>
<para>Check coding style.</para>
<para>Check coding style</para>
</glossdef>
</glossentry>
<glossentry>
<glossterm>information</glossterm>
<glossdef>
<para>Enable information messages</para>
</glossdef>
</glossentry>
<glossentry>
<glossterm>unusedFunction</glossterm>
<glossdef>
<para>Check for unused functions.</para>
<para>Check for unused functions</para>
</glossdef>
</glossentry>
<glossentry>
<glossterm>missingInclude</glossterm>
<glossdef>
<para>check for missing includes</para>
<para>Check for missing includes</para>
</glossdef>
</glossentry>
</glosslist>
Several ids can be given if you separate them with commas, e.g. --enable=style,unusedFunction.
By default none of the additional checks are enabled. Several ids can be given if you separate them with commas, e.g. --enable=style,unusedFunction.
</para>
</listitem>
</varlistentry>
@ -199,7 +208,13 @@ Example: -DDEBUG=1 -D__cplusplus</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--exitcode-suppressions [file]</option></term>
<term><option>--errorlist</option></term>
<listitem>
<para>Print a list of all possible error messages in XML format.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--exitcode-suppressions=[file]</option></term>
<listitem>
<para>Used when certain messages should be displayed but should not cause a non-zero exitcode.</para>
</listitem>
@ -232,6 +247,15 @@ default.</para>
files, this is not needed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-i [dir]</option></term>
<listitem>
<para>Give path to ignore. Give several -i parameters to ignore several paths. Give directory name or filename with path as parameter.
Directory name is matched to all parts of the path.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--inline-suppr</option></term>
<listitem>
@ -266,7 +290,7 @@ files, this is not needed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--suppressions [file]</option></term>
<term><option>--suppressions-list=[file]</option></term>
<listitem>
<para>Suppress warnings listed in the file. Filename and line are optional. The format of the single line in file is: [error id]:[filename]:[line].
You can use --template or --xml to see the error id.</para>
@ -297,11 +321,17 @@ files, this is not needed.</para>
<para>Write results in XML to error stream</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--xml-version=[version]</option></term>
<listitem>
<para>Select the XML file version. Currently versions 1 and 2 are available. The default version is 1.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="author">
<title>AUTHOR</title>
<para>The program was written by Bill Egert, Daniel Marjamäki, Gianluca Scacco, Hoang Tuan Su, Kimmo Varis, Leandro Penz, Martin Ettl, Nguyen Duong Tuan, Nicolas Le Cam, Reijo Tomperi, Robert Reif, Slava Semushin, Vesa Pikki and Zachary Blair</para>
<para>The program was written by Daniel Marjamäki and Cppcheck team. See AUTHORS file for list of team members.</para>
</refsect1>
<refsect1 id="see_also">
<title>SEE ALSO</title>

View File

@ -189,6 +189,7 @@ private:
TEST_CASE(symboldatabase8); // ticket #2252
TEST_CASE(symboldatabase9); // ticket #2525
TEST_CASE(symboldatabase10); // ticket #2537
TEST_CASE(symboldatabase11); // ticket #2539
}
// Check the operator Equal
@ -5505,6 +5506,17 @@ private:
ASSERT_EQUALS("", errout.str());
}
void symboldatabase11()
{
// ticket #2539 - segmentation fault
checkConst("int g ();\n"
"struct S {\n"
" int i : (false ? g () : 1);\n"
"};\n");
ASSERT_EQUALS("", errout.str());
}
};
REGISTER_TEST(TestClass)

View File

@ -125,7 +125,7 @@ private:
std::list<ErrorLogger::ErrorMessage::FileLocation> locs;
locs.push_back(loc);
ErrorMessage msg(locs, Severity::error, "Programming error.\nVerbose error", "errorId");
ASSERT_EQUALS("<?xml version=\"1.0\"?>\n<results>", ErrorLogger::ErrorMessage::getXMLHeader(1));
ASSERT_EQUALS("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<results>", ErrorLogger::ErrorMessage::getXMLHeader(1));
ASSERT_EQUALS("</results>", ErrorLogger::ErrorMessage::getXMLFooter(1));
ASSERT_EQUALS("<error file=\"foo.cpp\" line=\"5\" id=\"errorId\" severity=\"error\" msg=\"Programming error.\"/>", msg.toXML(false,1));
}
@ -138,7 +138,7 @@ private:
std::list<ErrorLogger::ErrorMessage::FileLocation> locs;
locs.push_back(loc);
ErrorMessage msg(locs, Severity::error, "Programming error.\nVerbose error", "errorId");
ASSERT_EQUALS("<?xml version=\"1.0\"?>\n<results>", ErrorLogger::ErrorMessage::getXMLHeader(1));
ASSERT_EQUALS("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<results>", ErrorLogger::ErrorMessage::getXMLHeader(1));
ASSERT_EQUALS("</results>", ErrorLogger::ErrorMessage::getXMLFooter(1));
ASSERT_EQUALS("<error file=\"foo.cpp\" line=\"5\" id=\"errorId\" severity=\"error\" msg=\"Verbose error\"/>", msg.toXML(true,1));
}
@ -151,7 +151,7 @@ private:
std::list<ErrorLogger::ErrorMessage::FileLocation> locs;
locs.push_back(loc);
ErrorMessage msg(locs, Severity::error, "Programming error.\nVerbose error", "errorId");
std::string header("<?xml version=\"1.0\"?>\n<results version=\"2\">\n");
std::string header("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<results version=\"2\">\n");
header += " <cppcheck version=\"";
header += CppCheck::version();
header += "\"/>\n <errors>";

View File

@ -4253,7 +4253,8 @@ private:
TEST_CASE(ret2);
// assignments
TEST_CASE(assign);
TEST_CASE(assign1);
TEST_CASE(assign2);
// Failed allocation
TEST_CASE(failedAllocation);
@ -4356,7 +4357,7 @@ private:
ASSERT_EQUALS("", errout.str());
}
void assign()
void assign1()
{
check("static void foo()\n"
"{\n"
@ -4385,6 +4386,15 @@ private:
}
void assign2()
{
check("static void foo() {\n"
" struct ABC *abc = malloc(123);\n"
" abc->a = abc->b = malloc(10)\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void failedAllocation()
{
check("static struct ABC * foo()\n"

View File

@ -1160,7 +1160,7 @@ private:
" std::string var = var = \"test\";\n"
" return 0;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:3]: (warning) Redundant assignment of \"var\" to itself\n", errout.str());
TODO_ASSERT_EQUALS("[test.cpp:3]: (warning) Redundant assignment of \"var\" to itself\n", "", errout.str());
check("void foo()\n"
"{\n"
@ -1169,6 +1169,13 @@ private:
" return 0;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
check("void foo()\n"
"{\n"
" int *x = getx();\n"
" *x = x;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void testScanf1()