diff --git a/AUTHORS b/AUTHORS index 3c07611a2..c7910516d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,6 +6,7 @@ Gianluca Scacco Hoang Tuan Su Kimmo Varis Leandro Penz +Nguyen Duong Tuan Nicolas Le Cam Reijo Tomperi Slava Semushin diff --git a/cppcheck.cbp b/cppcheck.cbp index 0a86f190f..61fadfc9f 100644 --- a/cppcheck.cbp +++ b/cppcheck.cbp @@ -30,20 +30,24 @@ - - + + + + + + diff --git a/gui/applicationdialog.cpp b/gui/applicationdialog.cpp index 4ea909d60..ced506fdc 100644 --- a/gui/applicationdialog.cpp +++ b/gui/applicationdialog.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/applicationdialog.h b/gui/applicationdialog.h index 7c32667d6..60488d050 100644 --- a/gui/applicationdialog.h +++ b/gui/applicationdialog.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index 074c346ba..4a52a0694 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/applicationlist.h b/gui/applicationlist.h index 09aa64cb8..5a2970299 100644 --- a/gui/applicationlist.h +++ b/gui/applicationlist.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/checkthread.cpp b/gui/checkthread.cpp index edc9943b1..e8e841034 100644 --- a/gui/checkthread.cpp +++ b/gui/checkthread.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/checkthread.h b/gui/checkthread.h index 44b0f18e5..b4c578c08 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/common.h b/gui/common.h index 2538cc0f5..d8b0105c8 100644 --- a/gui/common.h +++ b/gui/common.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/main.cpp b/gui/main.cpp index f95fa4183..4b6d524b6 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 07bdb0b18..d923e9de9 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 8b35b23eb..84d8b532c 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 372daaf0d..abae0f879 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/resultstree.h b/gui/resultstree.h index 557d8db5c..602a47769 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index b1e4628b9..5ee439fa5 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/resultsview.h b/gui/resultsview.h index e4448a321..1e349e0b9 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index e1ad3d83f..6567ae738 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index 7a086971a..fcf327866 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 5633f34cb..b68eba1e3 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/threadhandler.h b/gui/threadhandler.h index df34e6db6..21bb8d93b 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index ec8a4fcaf..6c2c0fb12 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/threadresult.h b/gui/threadresult.h index e2705e1f1..15e23ec44 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/check.h b/src/check.h index d88047c01..8dae9419c 100644 --- a/src/check.h +++ b/src/check.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkautovariables.cpp b/src/checkautovariables.cpp index ef976ff76..83eb2869d 100644 --- a/src/checkautovariables.cpp +++ b/src/checkautovariables.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki, Gianluca Scacco + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkautovariables.h b/src/checkautovariables.h index d1ce96fe0..6dbfcd217 100644 --- a/src/checkautovariables.h +++ b/src/checkautovariables.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki, Gianluca Scacco + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkbufferoverrun.cpp b/src/checkbufferoverrun.cpp index 5d455670d..a33ae69b6 100644 --- a/src/checkbufferoverrun.cpp +++ b/src/checkbufferoverrun.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkbufferoverrun.h b/src/checkbufferoverrun.h index f3fc9a38b..d8b1f47bd 100644 --- a/src/checkbufferoverrun.h +++ b/src/checkbufferoverrun.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkclass.cpp b/src/checkclass.cpp index b2cd45872..39a95dbbe 100644 --- a/src/checkclass.cpp +++ b/src/checkclass.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkclass.h b/src/checkclass.h index 96ea923fb..3246add7a 100644 --- a/src/checkclass.h +++ b/src/checkclass.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkdangerousfunctions.cpp b/src/checkdangerousfunctions.cpp index 2badee020..740076423 100644 --- a/src/checkdangerousfunctions.cpp +++ b/src/checkdangerousfunctions.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkdangerousfunctions.h b/src/checkdangerousfunctions.h index fb26180f1..467c8ab53 100644 --- a/src/checkdangerousfunctions.h +++ b/src/checkdangerousfunctions.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkfunctionusage.cpp b/src/checkfunctionusage.cpp index c7102dc56..546db0ad8 100644 --- a/src/checkfunctionusage.cpp +++ b/src/checkfunctionusage.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkfunctionusage.h b/src/checkfunctionusage.h index 2fd945b0e..1f9128672 100644 --- a/src/checkfunctionusage.h +++ b/src/checkfunctionusage.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkheaders.cpp b/src/checkheaders.cpp index 234c525c4..1e349ed6e 100644 --- a/src/checkheaders.cpp +++ b/src/checkheaders.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkheaders.h b/src/checkheaders.h index 04eb0acd4..9a41f1068 100644 --- a/src/checkheaders.h +++ b/src/checkheaders.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkmemoryleak.cpp b/src/checkmemoryleak.cpp index 6011f47e8..9c3f16c27 100644 --- a/src/checkmemoryleak.cpp +++ b/src/checkmemoryleak.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkmemoryleak.h b/src/checkmemoryleak.h index 9ce1729e6..a714a5cfd 100644 --- a/src/checkmemoryleak.h +++ b/src/checkmemoryleak.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkother.cpp b/src/checkother.cpp index 306b7b11f..8e5c34d1f 100644 --- a/src/checkother.cpp +++ b/src/checkother.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkother.h b/src/checkother.h index 1c8863674..3883ef7c0 100644 --- a/src/checkother.h +++ b/src/checkother.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checksecurity.cpp b/src/checksecurity.cpp index 42687e358..a2f20c639 100644 --- a/src/checksecurity.cpp +++ b/src/checksecurity.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checksecurity.h b/src/checksecurity.h index bbf57dc64..22e2ce9f4 100644 --- a/src/checksecurity.h +++ b/src/checksecurity.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkstl.cpp b/src/checkstl.cpp index a851831f2..d2b82b69c 100644 --- a/src/checkstl.cpp +++ b/src/checkstl.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/checkstl.h b/src/checkstl.h index 846cc25ab..7702a20d5 100644 --- a/src/checkstl.h +++ b/src/checkstl.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cppcheck.cpp b/src/cppcheck.cpp index 3aa88f808..36682b8a8 100644 --- a/src/cppcheck.cpp +++ b/src/cppcheck.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cppcheck.h b/src/cppcheck.h index ae993bc5c..7ee35134f 100644 --- a/src/cppcheck.h +++ b/src/cppcheck.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cppcheckexecutor.cpp b/src/cppcheckexecutor.cpp index 5e8a94072..90a4bef58 100644 --- a/src/cppcheckexecutor.cpp +++ b/src/cppcheckexecutor.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cppcheckexecutor.h b/src/cppcheckexecutor.h index 392e69074..ac954b306 100644 --- a/src/cppcheckexecutor.h +++ b/src/cppcheckexecutor.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/errorlogger.cpp b/src/errorlogger.cpp index 58359f3e1..fb2df69d3 100644 --- a/src/errorlogger.cpp +++ b/src/errorlogger.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/errorlogger.h b/src/errorlogger.h index 092654efb..0fc50c323 100644 --- a/src/errorlogger.h +++ b/src/errorlogger.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/filelister.cpp b/src/filelister.cpp index 4e9358a11..958bf0107 100644 --- a/src/filelister.cpp +++ b/src/filelister.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/filelister.h b/src/filelister.h index 2d3f0048d..279c5d5ea 100644 --- a/src/filelister.h +++ b/src/filelister.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main.cpp b/src/main.cpp index 2fd6502e2..ad4dcb935 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/mathlib.cpp b/src/mathlib.cpp index cbdcf3376..8b4543f73 100644 --- a/src/mathlib.cpp +++ b/src/mathlib.cpp @@ -1,7 +1,6 @@ -/* - * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki, Nguyen Duong Tuan +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/mathlib.h b/src/mathlib.h index 36d8b8108..b9bd1e9a1 100644 --- a/src/mathlib.h +++ b/src/mathlib.h @@ -1,7 +1,6 @@ -/* - * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki, Nguyen Duong Tuan +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/preprocessor.cpp b/src/preprocessor.cpp index 6f5e66099..3936180fc 100644 --- a/src/preprocessor.cpp +++ b/src/preprocessor.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/preprocessor.h b/src/preprocessor.h index 07063b3ad..4f1234717 100644 --- a/src/preprocessor.h +++ b/src/preprocessor.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/settings.cpp b/src/settings.cpp index d22132dbb..89661ab6a 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/settings.h b/src/settings.h index 05298757b..5186d06bf 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/threadexecutor.cpp b/src/threadexecutor.cpp index 831a11ee3..3a4c83493 100644 --- a/src/threadexecutor.cpp +++ b/src/threadexecutor.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/threadexecutor.h b/src/threadexecutor.h index c45def24d..5673c9e11 100644 --- a/src/threadexecutor.h +++ b/src/threadexecutor.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/token.cpp b/src/token.cpp index 593c6fc55..3b955dd11 100644 --- a/src/token.cpp +++ b/src/token.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/token.h b/src/token.h index 6cab748d3..4383e09a2 100644 --- a/src/token.h +++ b/src/token.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 1be7ccf04..d13aeb137 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1744,28 +1743,54 @@ bool Tokenizer::simplifyConditions() if (! tok4) break; if ((tok->str() == "&&" || tok->str() == "||" || tok->str() == "(") && - Token::Match(tok->tokAt(1), "%num% %any% %num%") && + (Token::Match(tok->tokAt(1), "%num% %any% %num%") || + Token::Match(tok->tokAt(1), "%bool% %any% %bool%")) && (tok4->str() == "&&" || tok4->str() == "||" || tok4->str() == ")")) { - double op1 = (strstr(tok->strAt(1), "0x")) ? std::strtol(tok->strAt(1), 0, 16) : std::atof(tok->strAt(1)); - double op2 = (strstr(tok->strAt(3), "0x")) ? std::strtol(tok->strAt(3), 0, 16) : std::atof(tok->strAt(3)); std::string cmp = tok->strAt(2); - bool result = false; - if (cmp == "==") - result = (op1 == op2); - else if (cmp == "!=") - result = (op1 != op2); - else if (cmp == ">=") - result = (op1 >= op2); - else if (cmp == ">") - result = (op1 > op2); - else if (cmp == "<=") - result = (op1 <= op2); - else if (cmp == "<") - result = (op1 < op2); + if (Token::Match(tok->tokAt(1), "%num%")) + { + // Compare numbers + double op1 = (strstr(tok->strAt(1), "0x")) ? std::strtol(tok->strAt(1), 0, 16) : std::atof(tok->strAt(1)); + double op2 = (strstr(tok->strAt(3), "0x")) ? std::strtol(tok->strAt(3), 0, 16) : std::atof(tok->strAt(3)); + + if (cmp == "==") + result = (op1 == op2); + else if (cmp == "!=") + result = (op1 != op2); + else if (cmp == ">=") + result = (op1 >= op2); + else if (cmp == ">") + result = (op1 > op2); + else if (cmp == "<=") + result = (op1 <= op2); + else if (cmp == "<") + result = (op1 < op2); + else + cmp = ""; + } else - cmp = ""; + { + // Compare boolean + bool op1 = (tok->strAt(1) == std::string("true")); + bool op2 = (tok->strAt(3) == std::string("true")); + + if (cmp == "==") + result = (op1 == op2); + else if (cmp == "!=") + result = (op1 != op2); + else if (cmp == ">=") + result = (op1 >= op2); + else if (cmp == ">") + result = (op1 > op2); + else if (cmp == "<=") + result = (op1 <= op2); + else if (cmp == "<") + result = (op1 < op2); + else + cmp = ""; + } if (! cmp.empty()) { @@ -2387,36 +2412,40 @@ bool Tokenizer::elseif() bool Tokenizer::simplifyRedundantParanthesis() { + if (!createLinks()) + return false; + bool ret = false; for (Token *tok = _tokens; tok; tok = tok->next()) { - bool foundSomething = true; - while (foundSomething && Token::simpleMatch(tok, "( (")) + if (tok->str() != "(") + continue; + + while (Token::simpleMatch(tok, "( (") && + tok->link()->previous() == tok->next()->link()) { - foundSomething = false; - int parlevel = 0; + // We have "(( *something* ))", remove the inner + // paranthesis + tok->deleteNext(); + tok->link()->previous()->previous()->deleteNext(); + ret = true; + } - for (Token *tok2 = tok; tok2; tok2 = tok2->next()) - { - if (tok2->str() == "(") - ++parlevel; + if (Token::Match(tok, "( ( %bool% )") || + Token::Match(tok, "( ( %num% )")) + { + tok->tokAt(2)->deleteNext(); + tok->deleteNext(); + ret = true; + } - else if (tok2->str() == ")") - { - --parlevel; - if (parlevel == 1) - { - if (Token::simpleMatch(tok2, ") )")) - { - tok->deleteNext(); - tok2->deleteNext(); - ret = true; - foundSomething = true; - } - break; - } - } - } + if (Token::Match(tok, "( %bool% ) )") || + Token::Match(tok, "( %num% ) )")) + { + tok = tok->next(); + tok->deleteNext(); + tok->previous()->deleteThis(); + ret = true; } } return ret; diff --git a/src/tokenize.h b/src/tokenize.h index b14c0e375..583cef046 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index 2d611a38d..7f3549598 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki, Gianluca Scacco + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index 5578b205d..2b22f783c 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testcharvar.cpp b/test/testcharvar.cpp index 8cde41664..5f6db17ba 100644 --- a/test/testcharvar.cpp +++ b/test/testcharvar.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testclass.cpp b/test/testclass.cpp index 4b883a028..997da88ad 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testconstructors.cpp b/test/testconstructors.cpp index f9ed45660..0658bf378 100644 --- a/test/testconstructors.cpp +++ b/test/testconstructors.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index 97c11bc23..0330c8673 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testdangerousfunctions.cpp b/test/testdangerousfunctions.cpp index 9de8f3303..09e26d94f 100644 --- a/test/testdangerousfunctions.cpp +++ b/test/testdangerousfunctions.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testdivision.cpp b/test/testdivision.cpp index f2e67874a..9260a3ba6 100644 --- a/test/testdivision.cpp +++ b/test/testdivision.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testfilelister.cpp b/test/testfilelister.cpp index 265293244..4e83b1664 100644 --- a/test/testfilelister.cpp +++ b/test/testfilelister.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testfunctionusage.cpp b/test/testfunctionusage.cpp index 402b3af7a..a21734ebd 100644 --- a/test/testfunctionusage.cpp +++ b/test/testfunctionusage.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index 4ebd85f6a..10c6751fc 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index d8a14ed5e..63db3cb27 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 2184ce0ab..d3a010edb 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testmemleakmp.cpp b/test/testmemleakmp.cpp index 9a73a0afc..e93b4319f 100644 --- a/test/testmemleakmp.cpp +++ b/test/testmemleakmp.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testother.cpp b/test/testother.cpp index 46a0b967c..91b67ab85 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 6c1413f0a..7d2776c32 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testredundantif.cpp b/test/testredundantif.cpp index ee5c4e301..662cf64e3 100644 --- a/test/testredundantif.cpp +++ b/test/testredundantif.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testrunner.cpp b/test/testrunner.cpp index b6f64aa55..0c989a745 100644 --- a/test/testrunner.cpp +++ b/test/testrunner.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testsecurity.cpp b/test/testsecurity.cpp index 3ad34b078..f16641de7 100644 --- a/test/testsecurity.cpp +++ b/test/testsecurity.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index a3eb14611..51d1addd3 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/teststl.cpp b/test/teststl.cpp index 8bb99cc6a..888f6d380 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testsuite.cpp b/test/testsuite.cpp index 964b20b03..04c5d01ea 100644 --- a/test/testsuite.cpp +++ b/test/testsuite.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testsuite.h b/test/testsuite.h index dd41a469a..2bc092aee 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 2ee40d642..75706db76 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 2e7c66af0..4e27158c6 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1616,22 +1615,43 @@ private: void removeParantheses3() { - const char code[] = "void foo()\n" - "{\n" - " if (( true )==true){}\n" - "}"; + { + const char code[] = "void foo()\n" + "{\n" + " if (( true )==(true)){}\n" + "}"; - // tokenize.. - Tokenizer tokenizer; - std::istringstream istr(code); - tokenizer.tokenize(istr, "test.cpp"); + // tokenize.. + Tokenizer tokenizer; + std::istringstream istr(code); + tokenizer.tokenize(istr, "test.cpp"); - tokenizer.simplifyTokenList(); + tokenizer.simplifyTokenList(); - std::ostringstream ostr; - for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next()) - ostr << " " << tok->str(); - TODO_ASSERT_EQUALS(std::string(" void foo ( ) { { } }"), ostr.str()); + std::ostringstream ostr; + for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next()) + ostr << " " << tok->str(); + ASSERT_EQUALS(std::string(" void foo ( ) { { } }"), ostr.str()); + } + + { + const char code[] = "void foo()\n" + "{\n" + " if (( 2 )==(2)){}\n" + "}"; + + // tokenize.. + Tokenizer tokenizer; + std::istringstream istr(code); + tokenizer.tokenize(istr, "test.cpp"); + + tokenizer.simplifyTokenList(); + + std::ostringstream ostr; + for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next()) + ostr << " " << tok->str(); + ASSERT_EQUALS(std::string(" void foo ( ) { { } }"), ostr.str()); + } } void simplify_numeric_condition() diff --git a/test/testunusedprivfunc.cpp b/test/testunusedprivfunc.cpp index 4241ac192..d73297fcd 100644 --- a/test/testunusedprivfunc.cpp +++ b/test/testunusedprivfunc.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index 49d20bc1c..73e8f3578 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tools/dmake.cpp b/tools/dmake.cpp index bcb2ab7c2..3d2d7f1a8 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/tools/errmsg.cpp b/tools/errmsg.cpp index 94c960240..e38daf549 100644 --- a/tools/errmsg.cpp +++ b/tools/errmsg.cpp @@ -1,7 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, - * Leandro Penz, Kimmo Varis, Vesa Pikki + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by