From d836748befdcaf56167c30b62acbc2c942867e2f Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Tue, 9 Aug 2016 08:16:33 +0200 Subject: [PATCH] Update to 1.75. --- .gitignore | 1 + cppcheck-1.73-link.patch | 34 ----------- cppcheck-1.74-test.patch | 38 ------------ ...nyxml.patch => cppcheck-1.75-tinyxml.patch | 60 +++++++++++-------- ....patch => cppcheck-1.75-translations.patch | 18 +++--- cppcheck.spec | 14 ++--- sources | 2 +- 7 files changed, 52 insertions(+), 115 deletions(-) delete mode 100644 cppcheck-1.73-link.patch delete mode 100644 cppcheck-1.74-test.patch rename cppcheck-1.73-tinyxml.patch => cppcheck-1.75-tinyxml.patch (52%) rename cppcheck-1.73-translations.patch => cppcheck-1.75-translations.patch (60%) diff --git a/.gitignore b/.gitignore index 0d2c7ea..9fd22e7 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ cppcheck-1.44.tar.bz2 /cppcheck-1.71.tar.bz2 /cppcheck-1.73.tar.bz2 /cppcheck-1.74.tar.bz2 +/cppcheck-1.75.tar.bz2 diff --git a/cppcheck-1.73-link.patch b/cppcheck-1.73-link.patch deleted file mode 100644 index 0f5ff28..0000000 --- a/cppcheck-1.73-link.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -up cppcheck-1.73/cli/CMakeLists.txt.link cppcheck-1.73/cli/CMakeLists.txt ---- cppcheck-1.73/cli/CMakeLists.txt.link 2016-04-10 03:25:25.329210822 +0200 -+++ cppcheck-1.73/cli/CMakeLists.txt 2016-04-10 03:26:51.813213485 +0200 -@@ -11,6 +11,7 @@ if (HAVE_RULES) - target_link_libraries(cppcheck pcre) - endif() - target_link_libraries(cppcheck -ltinyxml2) -+set_target_properties(cppcheck PROPERTIES LINKER_LANGUAGE C++) - - install(TARGETS cppcheck - RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} -diff -up cppcheck-1.73/gui/CMakeLists.txt.link cppcheck-1.73/gui/CMakeLists.txt ---- cppcheck-1.73/gui/CMakeLists.txt.link 2016-04-10 03:25:25.322210822 +0200 -+++ cppcheck-1.73/gui/CMakeLists.txt 2016-04-10 03:25:25.331210822 +0200 -@@ -26,7 +26,7 @@ if (BUILD_GUI) - if (HAVE_RULES) - target_link_libraries(cppcheck-gui pcre) - endif() -- -+ set_target_properties(cppcheck-gui PROPERTIES LINKER_LANGUAGE C++) - - install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) - install(FILES ${qms} DESTINATION share/${PROJECT_NAME}/lang/ COMPONENT applications) -diff -up cppcheck-1.73/test/CMakeLists.txt.link cppcheck-1.73/test/CMakeLists.txt ---- cppcheck-1.73/test/CMakeLists.txt.link 2016-04-10 03:25:25.317210822 +0200 -+++ cppcheck-1.73/test/CMakeLists.txt 2016-04-10 03:25:25.333210822 +0200 -@@ -10,6 +10,7 @@ if (BUILD_TESTS) - if (HAVE_RULES) - target_link_libraries(testrunner pcre) - endif() -+ set_target_properties(testrunner PROPERTIES LINKER_LANGUAGE C++) - - add_custom_target(copy_cfg ALL - COMMENT "Copying cfg files") diff --git a/cppcheck-1.74-test.patch b/cppcheck-1.74-test.patch deleted file mode 100644 index 8a03166..0000000 --- a/cppcheck-1.74-test.patch +++ /dev/null @@ -1,38 +0,0 @@ -Index: lib/checkcondition.cpp -=================================================================== ---- lib/checkcondition.cpp (revision a5cfa2b12c034e59b5805ac51b53e893c8bc2d1b) -+++ lib/checkcondition.cpp (revision 9bda97975aeec2c18198946e72524f13b4308d8e) -@@ -569,14 +569,6 @@ - // 5 => return value that is larger than both value1 and value2 - switch (test) { -- case 1: { -- const T ret = std::min(value1, value2); -- if ((ret - (T)1) < ret) -- return ret - (T)1; -- else if ((ret / (T)2) < ret) -- return ret / (T)2; -- else if ((ret * (T)2) < ret) -- return ret * (T)2; -- return ret; -- } -+ case 1: -+ return std::numeric_limits::lowest(); - case 2: - return value1; -@@ -585,14 +577,6 @@ - case 4: - return value2; -- case 5: { -- const T ret = std::max(value1, value2); -- if ((ret + (T)1) > ret) -- return ret + (T)1; -- else if ((ret / (T)2) > ret) -- return ret / (T)2; -- else if ((ret * (T)2) > ret) -- return ret * (T)2; -- return ret; -- } -+ case 5: -+ return std::numeric_limits::max(); - }; - return 0; diff --git a/cppcheck-1.73-tinyxml.patch b/cppcheck-1.75-tinyxml.patch similarity index 52% rename from cppcheck-1.73-tinyxml.patch rename to cppcheck-1.75-tinyxml.patch index 4a0400e..603734a 100644 --- a/cppcheck-1.73-tinyxml.patch +++ b/cppcheck-1.75-tinyxml.patch @@ -1,39 +1,39 @@ -diff -up cppcheck-1.73/cli/CMakeLists.txt.tinyxml cppcheck-1.73/cli/CMakeLists.txt ---- cppcheck-1.73/cli/CMakeLists.txt.tinyxml 2016-04-08 20:47:43.000000000 +0200 -+++ cppcheck-1.73/cli/CMakeLists.txt 2016-04-10 03:24:45.678212832 +0200 +diff -up cppcheck-1.75/cli/CMakeLists.txt.tinyxml cppcheck-1.75/cli/CMakeLists.txt +--- cppcheck-1.75/cli/CMakeLists.txt.tinyxml 2016-08-09 06:43:08.152146498 +0200 ++++ cppcheck-1.75/cli/CMakeLists.txt 2016-08-09 06:44:12.819146690 +0200 @@ -1,5 +1,4 @@ include_directories(${PROJECT_SOURCE_DIR}/lib/) -include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) + include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) file(GLOB hdrs "*.h") - file(GLOB srcs "*.cpp") -@@ -7,10 +6,11 @@ file(GLOB mainfile "main.cpp") +@@ -8,10 +7,11 @@ file(GLOB mainfile "main.cpp") list(REMOVE_ITEM srcs ${mainfile}) add_library(cli_objs OBJECT ${hdrs} ${srcs}) --add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) -+add_executable(cppcheck ${hdrs} ${mainfile} $ $) +-add_executable(cppcheck ${hdrs} ${mainfile} $ $ $ $) ++add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) if (HAVE_RULES) target_link_libraries(cppcheck pcre) endif() -+target_link_libraries(cppcheck -ltinyxml2) ++target_link_libraries(cppcheck tinyxml2) install(TARGETS cppcheck RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} -diff -up cppcheck-1.73/CMakeLists.txt.tinyxml cppcheck-1.73/CMakeLists.txt ---- cppcheck-1.73/CMakeLists.txt.tinyxml 2016-04-08 20:47:43.000000000 +0200 -+++ cppcheck-1.73/CMakeLists.txt 2016-04-10 03:23:36.158210959 +0200 +diff -up cppcheck-1.75/CMakeLists.txt.tinyxml cppcheck-1.75/CMakeLists.txt +--- cppcheck-1.75/CMakeLists.txt.tinyxml 2016-08-09 06:43:08.153146498 +0200 ++++ cppcheck-1.75/CMakeLists.txt 2016-08-09 06:43:31.191146016 +0200 @@ -16,7 +16,6 @@ if (BUILD_TESTS) enable_testing() endif() -add_subdirectory(externals/tinyxml) + add_subdirectory(externals/simplecpp) add_subdirectory(lib) # CppCheck Library add_subdirectory(cli) # Client application - add_subdirectory(test) # Tests -diff -up cppcheck-1.73/gui/CMakeLists.txt.tinyxml cppcheck-1.73/gui/CMakeLists.txt ---- cppcheck-1.73/gui/CMakeLists.txt.tinyxml 2016-04-08 20:47:43.000000000 +0200 -+++ cppcheck-1.73/gui/CMakeLists.txt 2016-04-10 03:23:36.160210959 +0200 +diff -up cppcheck-1.75/gui/CMakeLists.txt.tinyxml cppcheck-1.75/gui/CMakeLists.txt +--- cppcheck-1.75/gui/CMakeLists.txt.tinyxml 2016-08-06 18:49:40.000000000 +0200 ++++ cppcheck-1.75/gui/CMakeLists.txt 2016-08-09 06:44:44.234147074 +0200 @@ -11,7 +11,6 @@ if (BUILD_GUI) endif() @@ -42,32 +42,40 @@ diff -up cppcheck-1.73/gui/CMakeLists.txt.tinyxml cppcheck-1.73/gui/CMakeLists.t file(GLOB hdrs "*.h") file(GLOB srcs "*.cpp") -@@ -21,8 +20,9 @@ if (BUILD_GUI) +@@ -21,12 +20,12 @@ if (BUILD_GUI) QT4_ADD_RESOURCES(resources "gui.qrc") QT4_ADD_TRANSLATION(qms ${tss}) -- add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $) -+ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $) +- add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $ $) ++ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $) target_link_libraries(cppcheck-gui ${QT_LIBRARIES}) -+ target_link_libraries(cppcheck-gui -ltinyxml2) if (HAVE_RULES) target_link_libraries(cppcheck-gui pcre) endif() -diff -up cppcheck-1.73/test/CMakeLists.txt.tinyxml cppcheck-1.73/test/CMakeLists.txt ---- cppcheck-1.73/test/CMakeLists.txt.tinyxml 2016-04-08 20:47:43.000000000 +0200 -+++ cppcheck-1.73/test/CMakeLists.txt 2016-04-10 03:23:36.161210959 +0200 -@@ -1,12 +1,12 @@ +- ++ target_link_libraries(cppcheck-gui tinyxml2) + + install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) + install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) +diff -up cppcheck-1.75/test/CMakeLists.txt.tinyxml cppcheck-1.75/test/CMakeLists.txt +--- cppcheck-1.75/test/CMakeLists.txt.tinyxml 2016-08-09 06:43:08.155146498 +0200 ++++ cppcheck-1.75/test/CMakeLists.txt 2016-08-09 06:45:26.020153572 +0200 +@@ -1,16 +1,16 @@ if (BUILD_TESTS) include_directories(${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/cli/) - include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml) + include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) file(GLOB hdrs "*.h") file(GLOB srcs "*.cpp") -- add_executable(testrunner ${hdrs} ${srcs} $ $ $) -+ add_executable(testrunner ${hdrs} ${srcs} $ $) -+ target_link_libraries(testrunner -ltinyxml2) +- add_executable(testrunner ${hdrs} ${srcs} $ $ $ $) ++ add_executable(testrunner ${hdrs} ${srcs} $ $ $) if (HAVE_RULES) target_link_libraries(testrunner pcre) endif() ++ target_link_libraries(testrunner tinyxml2) + + add_custom_target(copy_cfg ALL + COMMENT "Copying cfg files") diff --git a/cppcheck-1.73-translations.patch b/cppcheck-1.75-translations.patch similarity index 60% rename from cppcheck-1.73-translations.patch rename to cppcheck-1.75-translations.patch index 92eab04..fafebcb 100644 --- a/cppcheck-1.73-translations.patch +++ b/cppcheck-1.75-translations.patch @@ -1,8 +1,8 @@ -diff -up cppcheck-1.73/gui/CMakeLists.txt.translations cppcheck-1.73/gui/CMakeLists.txt ---- cppcheck-1.73/gui/CMakeLists.txt.translations 2016-04-10 03:12:17.000000000 +0200 -+++ cppcheck-1.73/gui/CMakeLists.txt 2016-04-10 03:13:24.959212031 +0200 -@@ -29,7 +29,7 @@ if (BUILD_GUI) - +diff -up cppcheck-1.75/gui/CMakeLists.txt.translations cppcheck-1.75/gui/CMakeLists.txt +--- cppcheck-1.75/gui/CMakeLists.txt.translations 2016-08-09 06:46:30.206146245 +0200 ++++ cppcheck-1.75/gui/CMakeLists.txt 2016-08-09 06:47:27.829146179 +0200 +@@ -28,7 +28,7 @@ if (BUILD_GUI) + target_link_libraries(cppcheck-gui tinyxml2) install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) - install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) @@ -10,10 +10,10 @@ diff -up cppcheck-1.73/gui/CMakeLists.txt.translations cppcheck-1.73/gui/CMakeLi set(CMAKE_AUTOMOC OFF) -diff -up cppcheck-1.73/gui/translationhandler.cpp.translations cppcheck-1.73/gui/translationhandler.cpp ---- cppcheck-1.73/gui/translationhandler.cpp.translations 2016-04-08 20:47:43.000000000 +0200 -+++ cppcheck-1.73/gui/translationhandler.cpp 2016-04-10 03:12:17.819211809 +0200 -@@ -113,15 +113,7 @@ bool TranslationHandler::SetLanguage(con +diff -up cppcheck-1.75/gui/translationhandler.cpp.translations cppcheck-1.75/gui/translationhandler.cpp +--- cppcheck-1.75/gui/translationhandler.cpp.translations 2016-08-06 18:49:40.000000000 +0200 ++++ cppcheck-1.75/gui/translationhandler.cpp 2016-08-09 06:46:30.207146245 +0200 +@@ -116,15 +116,7 @@ bool TranslationHandler::SetLanguage(con if (datadir.isEmpty()) datadir = appPath; diff --git a/cppcheck.spec b/cppcheck.spec index 3ece53d..4536363 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -1,6 +1,6 @@ Name: cppcheck -Version: 1.74 -Release: 2%{?dist} +Version: 1.75 +Release: 1%{?dist} Summary: Tool for static C/C++ code analysis Group: Development/Languages License: GPLv3+ @@ -10,11 +10,9 @@ Source1: cppcheck.desktop BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # Use system tinyxml2 -Patch0: cppcheck-1.73-tinyxml.patch +Patch0: cppcheck-1.75-tinyxml.patch # Fix location of translations -Patch1: cppcheck-1.73-translations.patch -# Fix tests on x86 -Patch2: cppcheck-1.74-test.patch +Patch1: cppcheck-1.75-translations.patch BuildRequires: pcre-devel BuildRequires: tinyxml2-devel >= 2.1.0 @@ -44,7 +42,6 @@ This package contains the graphical user interface for cppcheck. %setup -q %patch0 -p1 -b .tinyxml %patch1 -p1 -b .translations -%patch2 -p0 -b .test # Make sure bundled tinyxml is not used rm -r externals/tinyxml @@ -93,6 +90,9 @@ rm -rf %{buildroot} %changelog +* Mon Aug 08 2016 Susi Lehtola - 1.75-1 +- Update to 1.75. + * Tue Aug 02 2016 Susi Lehtola - 1.74-2 - Re-enable tests on x86. diff --git a/sources b/sources index 7f20d88..122b189 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5ed445dbebc9d6c47afa44964f3618b0 cppcheck-1.74.tar.bz2 +645572cdef2b439d19adc317171b9bf4 cppcheck-1.75.tar.bz2