New fix for BTFS on unsigned-char arches, EOF is not a char is an int.

This commit is contained in:
Sérgio M. Basto 2019-02-27 00:38:44 +00:00
parent aa48f41db3
commit 69e87bf4d9
3 changed files with 46 additions and 15 deletions

View File

@ -0,0 +1,41 @@
--- ./Testing/Source/Common/Cxx/TestString2.cxx.orig 2019-02-26 22:01:26.738230841 +0000
+++ ./Testing/Source/Common/Cxx/TestString2.cxx 2019-02-26 22:59:07.751826144 +0000
@@ -16,7 +16,6 @@
#include <iostream>
#include <string.h> // strlen
-#include <stdio.h> // EOF
int TestString2(int , char *[])
{
@@ -26,24 +25,24 @@ int TestString2(int , char *[])
gdcm::String<> s2 = "coucou!";
std::cout << s2 << " -> " << s2.size() << std::endl;
- gdcm::String<EOF,64,0> s3 = "coucou";
+ gdcm::String<'\\',64,0> s3 = "coucou";
std::cout << s3.c_str() << " -> " << s3.size() << std::endl;
- gdcm::String<EOF,64,0> s4 = "coucou!";
+ gdcm::String<'\\',64,0> s4 = "coucou!";
std::cout << s4.c_str() << " -> " << s4.size() << std::endl;
const char *s = "coucou!";
- gdcm::String<EOF,64,0> s5( s, strlen(s) );
+ gdcm::String<'\\',64,0> s5( s, strlen(s) );
std::cout << s5.c_str() << " -> " << s5.size() << std::endl;
std::string ss = "coucou!";
- gdcm::String<EOF,64,0> s6( ss );
+ gdcm::String<'\\',64,0> s6( ss );
std::cout << s6.c_str() << " -> " << s6.size() << std::endl;
- gdcm::String<EOF,64,0> s7( ss, 1, 5 );
+ gdcm::String<'\\',64,0> s7( ss, 1, 5 );
std::cout << s7.c_str() << " -> " << s7.size() << std::endl;
- gdcm::String<EOF,64,0> s8( ss, 1, 6 );
+ gdcm::String<'\\',64,0> s8( ss, 1, 6 );
std::cout << s8.c_str() << " -> " << s8.size() << std::endl;
return 0;

View File

@ -1,11 +0,0 @@
--- ./Source/Common/gdcmString.h.orig 2019-02-25 17:28:26.424232122 +0000
+++ ./Source/Common/gdcmString.h 2019-02-25 17:28:57.986168143 +0000
@@ -27,7 +27,7 @@ namespace gdcm
* TMaxLength is only a hint. Noone actually respect the max length
* TPadChar is the string padding (0 or space)
*/
-template <char TDelimiter = '\\', unsigned int TMaxLength = 64, char TPadChar = ' '>
+template <signed char TDelimiter = '\\', unsigned int TMaxLength = 64, signed char TPadChar = ' '>
class /*GDCM_EXPORT*/ String : public std::string /* PLEASE do not export me */
{
// UI wants \0 for pad character, while ASCII ones wants space char... do not allow anything else

View File

@ -3,7 +3,7 @@
Name: gdcm
Version: 2.8.8
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Grassroots DiCoM is a C++ library to parse DICOM medical files
License: BSD
URL: http://gdcm.sourceforge.net/wiki/index.php/Main_Page
@ -28,7 +28,7 @@ Patch5: 0005-use-cpp-11-standard.patch
Patch6: 0006-Update-for-new-poppler.patch
# Use unversioned directory name
Patch7: 0007-Use-unversioned-dir.patch
Patch8: gdcm-2.8.8-fix-narrow.patch
Patch8: gdcm-2.8.8-dont_use_EOF.patch
BuildRequires: CharLS-devel >= 1.0
BuildRequires: cmake
@ -284,13 +284,14 @@ make test -C %{_target_platform} || exit 0
%{python3_sitearch}/__pycache__/%{name}*
%changelog
* Tue Feb 26 2019 Sérgio Basto <sergio@serjux.com> - 2.8.8-4
- New fix for BTFS on unsigned-char arches, EOF is not a char is an int.
* Mon Feb 25 2019 Sérgio Basto <sergio@serjux.com> - 2.8.8-3
- Manually-specified variables were not used by the project:
GDCM_PDF_DOCUMENTATION
- Patch for poppler breaks builds for previous releases.
- Fix BTFS on unsigned-char arches
- Add -fsigned-char to the build flags. The compiler complaints make sense if
char is unsigned.
* Mon Feb 18 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.8.8-2
- Enable tests