Merge branch 'master' into epel7

This commit is contained in:
Susi Lehtola 2016-08-09 08:18:46 +02:00
commit a7bef59441
7 changed files with 52 additions and 115 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -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")

View File

@ -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<T>::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<T>::max();
};
return 0;

View File

@ -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} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs>)
+add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs>)
-add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
+add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
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} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs>)
+ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs>)
- add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
+ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
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} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs>)
+ add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs>)
+ target_link_libraries(testrunner -ltinyxml2)
- add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
+ add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if (HAVE_RULES)
target_link_libraries(testrunner pcre)
endif()
+ target_link_libraries(testrunner tinyxml2)
add_custom_target(copy_cfg ALL
COMMENT "Copying cfg files")

View File

@ -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;

View File

@ -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 <jussilehtola@fedoraproject.org> - 1.75-1
- Update to 1.75.
* Tue Aug 02 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.74-2
- Re-enable tests on x86.

View File

@ -1 +1 @@
5ed445dbebc9d6c47afa44964f3618b0 cppcheck-1.74.tar.bz2
645572cdef2b439d19adc317171b9bf4 cppcheck-1.75.tar.bz2