[packages/3DLDF] - added gcc 5 fixes from Debian - rel 5

baggins baggins at pld-linux.org
Sun Dec 27 11:19:32 CET 2015


commit 359ef529cddf6af936502131d5676c4a711386dd
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Dec 27 11:19:13 2015 +0100

    - added gcc 5 fixes from Debian
    - rel 5

 3DLDF.spec                                 |  10 +-
 upstream-cleanup-permissive_cxx_code.patch | 300 +++++++++++++++++++++++++++++
 upstream-gcc-init_priority.patch           |  80 ++++++++
 upstream-sys-std_numeric_limits.patch      |  34 ++++
 upstream-w2help2man.patch                  | 101 ++++++++++
 5 files changed, 524 insertions(+), 1 deletion(-)
---
diff --git a/3DLDF.spec b/3DLDF.spec
index 3993ed8..6449dea 100644
--- a/3DLDF.spec
+++ b/3DLDF.spec
@@ -2,12 +2,16 @@ Summary:	Three-dimensional drawing with MetaPost output
 Summary(pl.UTF-8):	Tworzenie trójwymiarowej grafiki z wyjściem w formacie MetaPost
 Name:		3DLDF
 Version:	2.0.3
-Release:	4
+Release:	5
 License:	GPL v2+
 Group:		Applications/Graphics
 Source0:	http://ftp.gnu.org/gnu/3dldf/%{name}-%{version}.tar.gz
 # Source0-md5:	5e669f4efd3d576d42308ba61619a63f
 Patch0:		%{name}-info.patch
+Patch1:		upstream-cleanup-permissive_cxx_code.patch
+Patch2:		upstream-gcc-init_priority.patch
+Patch3:		upstream-sys-std_numeric_limits.patch
+Patch4:		upstream-w2help2man.patch
 URL:		http://www.gnu.org/software/3dldf/
 # ps2pdf
 BuildRequires:	ghostscript
@@ -33,6 +37,10 @@ w TeXu.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 # only 3dlfb binary uses libs, symbols are messed - no sense in building shared libs
diff --git a/upstream-cleanup-permissive_cxx_code.patch b/upstream-cleanup-permissive_cxx_code.patch
new file mode 100644
index 0000000..2fd697d
--- /dev/null
+++ b/upstream-cleanup-permissive_cxx_code.patch
@@ -0,0 +1,300 @@
+Description: permissive code cleanup
+ Clarify C++ permissive code as detected by gcc-5; closes RC bug #777763.
+Origin: debian
+Forwarded: https://savannah.gnu.org/bugs/?44314
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-06-26
+
+--- a/src/pspglb.web
++++ b/src/pspglb.web
+@@ -5075,12 +5075,7 @@
+ void*
+ polyhedron_path_intersection_func(Polyhedron* p,
+                                   Path* q,
+-                                  void* parameter = 0);  
+-                      
+-template <class C>
+-int
+-show_func(C* c, string text = "", void* parameter = 0);
+-
++                                  void* parameter = 0);
+ 
+ void*
+ plane_intersection_func(void* v, void* w, void* parameter = 0);
+--- a/src/io.web
++++ b/src/io.web
+@@ -4937,22 +4937,22 @@
+    template <class C>
+    friend 
+    void*
+-   Scan_Parse::get_point_func(real r, C* c, void* parameter = 0);
++   Scan_Parse::get_point_func(real r, C* c, void* parameter);
+ 
+    template <class C>
+    friend
+    void*
+-   Scan_Parse::get_center_func(C* c, void* parameter = 0);
++   Scan_Parse::get_center_func(C* c, void* parameter);
+ 
+    template <class C>
+    friend
+    void*
+-   Scan_Parse::get_focus_func(C* c, const unsigned short s = 0, void* parameter = 0);
++   Scan_Parse::get_focus_func(C* c, const unsigned short s, void* parameter);
+ 
+    template <class C>
+    friend
+    void*
+-   Scan_Parse::get_vertex_func(C* c, const unsigned short s = 0, void* parameter = 0);
++   Scan_Parse::get_vertex_func(C* c, const unsigned short s, void* parameter);
+ 
+ 
+ @q **** (4) Functions for |Focuses|.@>   
+@@ -5009,8 +5009,8 @@
+    friend
+    string*
+    Scan_Parse::sub_binary_number_string_func(C c, 
+-                              bool oversize_switch = false,
+-                              Scanner_Node scanner_node = 0);
++                              bool oversize_switch,
++                              Scanner_Node scanner_node);
+ 
+ 
+ @q **** (4) @>   
+@@ -5035,7 +5035,7 @@
+        int 
+        Scan_Parse::shape_decl_func(Scanner_Node,
+                                    int,
+-                                   C* dummy = 0);
++                                   C*);
+ 
+    template <class C>
+      friend
+@@ -5164,7 +5164,7 @@
+ template <class C>
+ friend 
+ void*
+-Scan_Parse::normal_func(C* c, Scanner_Node scanner_node = 0);
++Scan_Parse::normal_func(C* c, Scanner_Node scanner_node);
+ 
+ 
+ @q **** (4)@> 
+@@ -5226,7 +5226,7 @@
+      Scan_Parse::vector_type_decl(Scanner_Node scanner_node,
+                                        int vector_type_num,
+                                        int array_type_num,
+-                                       C* dummy = 0);
++                                       C* dummy);
+ 
+ 
+      template <class C>
+@@ -5237,7 +5237,7 @@
+                                            int vector_type_num,
+                                            int array_type_num,
+                                            C* object,
+-                                           bool copy_object = true);
++                                           bool copy_object);
+ 
+      template <class C, class D>
+      friend
+@@ -5245,7 +5245,7 @@
+      Scan_Parse::vector_type_assign(Scanner_Node scanner_node,
+                                     Id_Map_Entry_Node entry,
+                                     const Pointer_Vector<D>* object_vector,
+-                                    C* dummy = 0);
++                                    C* dummy);
+      friend
+      int 
+      Scan_Parse::conditional(Scanner_Node scanner_node,
+@@ -5367,7 +5367,7 @@
+      template<class C>
+      friend 
+      int
+-     Scan_Parse::reverse_func(void* v, void* parameter, C* c = 0);
++     Scan_Parse::reverse_func(void* v, void* parameter, C* c);
+ 
+ 
+      friend 
+@@ -5447,7 +5447,7 @@
+ template<class C>
+ friend 
+ void*
+-standardize_func(C* c, void* v = 0);
++standardize_func(C* c, void* v);
+ 
+ friend
+ void*
+@@ -5610,11 +5610,11 @@
+                                    int increment_value,
+                                    const unsigned short conic_section_type,
+                                    C* c, 
+-                                   void* parameter = 0,
+-                                   bool test_points = true,
+-                                   bool rectify_points = true,
+-                                   real tolerance = -1,
+-                                   bool ignore_extra_points = true);
++                                   void* parameter,
++                                   bool test_points,
++                                   bool rectify_points,
++                                   real tolerance,
++                                   bool ignore_extra_points);
+ 
+ friend 
+ void* 
+@@ -5677,23 +5677,23 @@
+ template<class C>
+ friend 
+ int
+-Scan_Parse::cull_func(void* v, 
+-                      const unsigned short comparison = 0,
+-                      Scanner_Node scanner_node = 0, 
+-                      real tolerance = -1,
+-                      C* c = 0);
++Scan_Parse::cull_func(void* v,
++                      const unsigned short comparison,
++                      Scanner_Node scanner_node,
++                      real tolerance,
++                      C* c);
+ 
+ template<class C>
+ friend
+ int 
+ Scan_Parse::rectify_func(void* v,
+-                         Scanner_Node scanner_node = 0,
+-                         bool do_test = true,
+-                         bool do_cull = true,
+-                         bool do_transform = true,
+-                         real tolerance = -1,
+-                         Transform* t = 0,
+-                         C* c = 0);
++                         Scanner_Node scanner_node,
++                         bool do_test,
++                         bool do_cull,
++                         bool do_transform,
++                         real tolerance,
++                         Transform* t,
++                         C* c);
+ 
+ @q ***** (5) |cuboid| expressions.@>  
+ @*4 {\bf cuboid} expressions.
+@@ -5709,12 +5709,12 @@
+ template<class C>
+ friend 
+ void*
+-Scan_Parse::in_cuboid_func(C* c, void* parameter = 0);
++Scan_Parse::in_cuboid_func(C* c, void* parameter);
+ 
+ template<class C>
+ friend 
+ void*
+-Scan_Parse::out_cuboid_func(C* c, void* parameter = 0);
++Scan_Parse::out_cuboid_func(C* c, void* parameter);
+ 
+ @q ***** (5) Functions for |Polyhedra|.@>   
+ @*4 Functions for {\bf Polyhedra}.
+@@ -6033,7 +6033,7 @@
+ template<class C>
+ friend
+ void*
+-Scan_Parse::is_whatever_func(C* c, void* parameter = 0);
++Scan_Parse::is_whatever_func(C* c, void* parameter);
+ 
+ 
+ friend
+@@ -6047,10 +6047,10 @@
+ template <class C, class D, class E>
+ friend
+ void*
+-Scan_Parse::intersection_points_func(C* c, 
+-                                     D* d, 
+-                                     void* parameter = 0, 
+-                                     E* e = 0);
++Scan_Parse::intersection_points_func(C* c,
++                                     D* d,
++                                     void* parameter,
++                                     E* e);
+ friend
+ Pointer_Vector<Bool_Point>*
+ Scan_Parse::convert(Bool_Point_Quadruple* bpq, 
+@@ -6061,22 +6061,22 @@
+ template<class C, class D>
+ friend
+ void*
+-Scan_Parse::ellipse_like_intersection_func(C* c, D* d, void* parameter = 0);
++Scan_Parse::ellipse_like_intersection_func(C* c, D* d, void* parameter);
+ 
+ template<class C>
+ friend 
+ void*
+-Scan_Parse::ellipse_like_plane_intersection_func(C* c, void* w, void* parameter = 0);
++Scan_Parse::ellipse_like_plane_intersection_func(C* c, void* w, void* parameter);
+ 
+ template<class C, class D>
+ friend 
+ void*
+-Scan_Parse::conic_section_intersection_func(C* c, D* d, void* parameter = 0);
++Scan_Parse::conic_section_intersection_func(C* c, D* d, void* parameter);
+ 
+ template<class C, class D>
+ friend
+ void*
+-Scan_Parse::polygon_like_intersection_func(C* c, D* d, void* parameter = 0);
++Scan_Parse::polygon_like_intersection_func(C* c, D* d, void* parameter);
+ 
+ 
+ template<class C>
+@@ -6084,7 +6084,7 @@
+ void*
+ Scan_Parse::ellipsoid_like_plane_intersection_func(C* c,
+                                                    Plane* p,
+-                                                   void* parameter = 0);
++                                                   void* parameter);
+ friend 
+ void*
+ Scan_Parse::sphere_line_intersection_func(Sphere* s,
+@@ -6100,12 +6100,12 @@
+ template<class C>
+ friend 
+ void*
+-Scan_Parse::plane_cast_func(C* c, void* parameter = 0); 
++Scan_Parse::plane_cast_func(C* c, void* parameter);
+ 
+ template <class C>
+ friend 
+ void*
+-Scan_Parse::plane_assignment_func(void* entry, C* c, void* parameter = 0);
++Scan_Parse::plane_assignment_func(void* entry, C* c, void* parameter);
+ 
+ friend 
+ int
+@@ -6114,7 +6114,7 @@
+ template <class C>
+ friend 
+ int
+-Scan_Parse::show_func(C* c, string text = "", void* parameter = 0);
++Scan_Parse::show_func(C* c, string text, void* parameter);
+ 
+ friend
+ void*
+--- a/src/scanprse.web
++++ b/src/scanprse.web
+@@ -6245,7 +6245,7 @@
+ Scan_Parse::vector_type_decl(Scanner_Node scanner_node,
+                              int vector_type_num,
+                              int array_type_num,
+-                             C* dummy = 0)
++                             C* dummy)
+ {
+ 
+ 
+@@ -8147,8 +8147,8 @@
+ Scan_Parse::cull_func(void* v, 
+                       const unsigned short comparison,
+                       Scanner_Node scanner_node, 
+-                      real tolerance = -1,
+-                      C* c = 0)
++                      real tolerance,
++                      C* c)
+ {
+ 
+ @q ***** (5) Preliminaries.@>   
diff --git a/upstream-gcc-init_priority.patch b/upstream-gcc-init_priority.patch
new file mode 100644
index 0000000..7f3db3f
--- /dev/null
+++ b/upstream-gcc-init_priority.patch
@@ -0,0 +1,80 @@
+Description: random pre-main initialization: prioritize
+ Clarify C++ pre-main initialization with the help of the gcc specific
+ attribute init_priority; closes RC bug #759696.
+Origin: debian
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-11-23
+
+--- a/src/points.web
++++ b/src/points.web
+@@ -704,18 +704,16 @@
+ 
+ @<Global constants@>=
+ 
+-extern const Point INVALID_POINT(INVALID_REAL, INVALID_REAL, INVALID_REAL);
+-extern const Point ORIGIN(0, 0, 0);
+-extern const Point_Pair INVALID_POINT_PAIR(INVALID_POINT, INVALID_POINT);
++extern const Point __attribute__((init_priority(500))) INVALID_POINT(INVALID_REAL, INVALID_REAL, INVALID_REAL);
++extern const Point __attribute__((init_priority(500))) ORIGIN(0, 0, 0);
++extern const Point_Pair __attribute__((init_priority(1000))) INVALID_POINT_PAIR(INVALID_POINT, INVALID_POINT);
+ 
+-extern const Bool_Point INVALID_BOOL_POINT(false, INVALID_POINT);
+-extern const Bool_Point_Pair INVALID_BOOL_POINT_PAIR(INVALID_BOOL_POINT,
+-                                       INVALID_BOOL_POINT); 
++extern const Bool_Point __attribute__((init_priority(1000))) INVALID_BOOL_POINT(false, INVALID_POINT);
++extern const Bool_Point_Pair __attribute__((init_priority(2000))) INVALID_BOOL_POINT_PAIR(INVALID_BOOL_POINT, INVALID_BOOL_POINT);
+ 
+ 
+-extern const Bool_Real_Point INVALID_BOOL_REAL_POINT(false, INVALID_REAL,
+-                                       INVALID_POINT);
+-extern const Bool_Point_Quadruple
++extern const Bool_Real_Point __attribute__((init_priority(1000))) INVALID_BOOL_REAL_POINT(false, INVALID_REAL, INVALID_POINT);
++extern const Bool_Point_Quadruple __attribute__((init_priority(2000)))
+    INVALID_BOOL_POINT_QUADRUPLE(INVALID_BOOL_POINT,
+                                 INVALID_BOOL_POINT,
+                                 INVALID_BOOL_POINT,
+--- a/src/lines.web
++++ b/src/lines.web
+@@ -1032,7 +1032,7 @@
+ @q * Global constants for Line.@>
+ @ Global constants for {\bf Line}.
+ @<|Line| global constants@>=
+-extern const Line INVALID_LINE(INVALID_POINT, INVALID_POINT);
++extern const Line __attribute__((init_priority(1000))) INVALID_LINE(INVALID_POINT, INVALID_POINT);
+ 
+ @
+ @<Declarations for the header file@>=
+--- a/src/planes.web
++++ b/src/planes.web
+@@ -1617,8 +1617,7 @@
+ @q * (1) Global constants for Plane.@>
+ @* Global constants for {\bf Plane}.
+ @<|Plane| global constants@>=
+-extern const Plane INVALID_PLANE(INVALID_POINT,
+-                                 INVALID_POINT);
++extern const Plane __attribute__((init_priority(1000))) INVALID_PLANE(INVALID_POINT, INVALID_POINT);
+ 
+ @
+ @<Declarations for the header file@>=
+--- a/src/complex.web
++++ b/src/complex.web
+@@ -143,7 +143,7 @@
+ 
+ @<Global constants@>=
+ 
+-extern const Complex INVALID_COMPLEX(INVALID_REAL, INVALID_REAL);
++extern const Complex __attribute__((init_priority(500))) INVALID_COMPLEX(INVALID_REAL, INVALID_REAL);
+ 
+ @q *** (3)@>
+ @
+--- a/src/transfor.web
++++ b/src/transfor.web
+@@ -1517,7 +1517,7 @@
+ @q * Global constants. @>
+ @ Global constants.
+ @<Global constants@>=
+-extern const Transform INVALID_TRANSFORM(INVALID_REAL);
++extern const Transform __attribute__((init_priority(500))) INVALID_TRANSFORM(INVALID_REAL);
+ extern const Transform IDENTITY_TRANSFORM;
+ 
+ @
diff --git a/upstream-sys-std_numeric_limits.patch b/upstream-sys-std_numeric_limits.patch
new file mode 100644
index 0000000..25b9445
--- /dev/null
+++ b/upstream-sys-std_numeric_limits.patch
@@ -0,0 +1,34 @@
+Description: system: set second-largest-FP from std::numeric_limits
+ System::get_second_largest <(float|double)> is as transportable as
+ reinterpret_cast , that is, NOT. As suggested in gsltmplt.web ,
+ it is replaced with std::numeric_limits<(float|double)>::max() .
+Origin: debian
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-11-23
+
+--- a/src/main.web
++++ b/src/main.web
+@@ -1032,10 +1032,20 @@
+   @<Print version, copyright, and license information@>;
+ 
+   if (ldf_real_float)
+-    MAX_REAL = System::get_second_largest<float>(FLT_MAX, false);
++    MAX_REAL =
++#if 0
++			System::get_second_largest<float>(FLT_MAX, false);
++#else
++			std::numeric_limits<float>::max();
++#endif
+   else if (ldf_real_double)
+-    MAX_REAL = System::get_second_largest<double>(DBL_MAX, false);
+-  
++    MAX_REAL =
++#if 0
++			System::get_second_largest<double>(DBL_MAX, false);
++#else
++			std::numeric_limits<double>::max();
++#endif
++
+   MAX_REAL_SQRT = sqrt(MAX_REAL);
+ 
+   cerr.setf(ios::fixed, ios::floatfield);
diff --git a/upstream-w2help2man.patch b/upstream-w2help2man.patch
new file mode 100644
index 0000000..d1e674e
--- /dev/null
+++ b/upstream-w2help2man.patch
@@ -0,0 +1,101 @@
+Description: re-format the help option
+ Attempt to re-format the help option of the 3dldf
+ interpreter wrt to GNU traditions.
+Origin: debian
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2014-05-22
+
+--- a/src/main.web
++++ b/src/main.web
+@@ -450,53 +450,44 @@
+ 
+         else if (option_index == HELP_INDEX)
+           {
+-            cerr_mutex.lock(); 
+-            cerr << "GNU 3DLDF Version " << VERSION_3DLDF << ". "
+-                 << COPYRIGHT_3DLDF << endl 
+-                 << endl
+-                 << "Valid options for GNU 3DLDF are:" << endl
+-                 << endl
+-                 << "--bison-trace:           Prints information generated by Bison "
+-                 << endl << "                         "
+-                 << "for tracing which parser rules are reduced "
+-                 << endl << "                         "
+-                 << "and the state of the Bison stack." << endl
+-                 << endl
+-                 << "--help:                  Prints this message and exits "
+-                 << "with return value 0." << endl
+-                 << endl
+-                 << "--multithread-input:     Enables the use of multiple "
+-                 << "threads for input."
+-                 << endl
+-                 << endl
+-                 << "--multithread-output:    Enables the use of multiple "
+-                 << "threads for output."
+-                 << endl
+-                 << endl
+-                 << "--multithread-include:   Enables the use of multiple "
+-                 << "threads for input" << endl 
+-                 << "                         files included in other input files."
+-                 << endl
+-                 << endl
+-                 << "--quiet:                 Suppresses some output to standard "
+-                 << "output"
+-                 << endl 
+-                 << "                         and standard error when `3dldf' is run." 
+-                 << endl << endl
+-                 << "--silent:                Suppresses almost all output "
+-                 << "to standard output" << endl
+-                 << "                         and standard error when "
+-                 << "`3dldf' is run."
+-                 << endl << endl
+-                 << "--verbose:               Causes status information to be "
+-                 << "printed to standard output" << endl 
+-                 << "                         when `3dldf' is run."
+-                 << endl << endl 
+-                 << "--version:               Prints the version number of "
+-                 << "GNU 3DLDF" << endl 
+-                 << "                         to standard output and exits with "
+-                 << "return value 0."
+-                 << endl << endl; 
++            cerr_mutex.lock();
++            cerr
++						     << "Usage: 3ldf [OPTION]... 3DLDFNAME[.ldf]"
++								   << endl << endl
++						     << "This is GNU 3DLDF Version " << VERSION_3DLDF << ". "
++								   << endl
++								 << COPYRIGHT_3DLDF << "."
++								   << endl << endl
++                 << "Valid options for GNU 3DLDF are:"
++								   << endl << endl
++                 << "  --bison-trace          Prints information generated by Bison "
++								   << "for tracing which parser rules are reduced "
++                   << "and the state of the Bison stack"
++								   << endl << endl
++                 << "  --multithread-input    Enables the use of multiple threads for input"
++                   << endl << endl
++                 << "  --multithread-output   Enables the use of multiple threads for output"
++                   << endl << endl
++                 << "  --multithread-include  Enables the use of multiple threads for input"
++                   << "files included in other input files"
++                   << endl << endl
++                 << "  --quiet                Suppresses some output to standard output"
++                   << "and standard error when `3dldf' is running"
++                   << endl << endl
++                 << "  --silent               Suppresses almost all output to standard output"
++                   << "and standard error when `3dldf' is running"
++                   << endl << endl
++                 << "  --verbose              Causes status information to be "
++                   << "printed to standard output when `3dldf' is running"
++                   << endl << endl
++                 << "  --help                 Prints this message and exits with return value 0"
++                   << endl << endl
++                 << "  --version              Prints the version number of GNU 3DLDF "
++                   << "to standard output and exits with return value 0"
++                   << endl << endl
++                 << "Report bugs to <" << PACKAGE_BUGREPORT << ">."
++								   << endl
++                 ;
+ 
+ 
+ #if DEBUG_COMPILE
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/3DLDF.git/commitdiff/359ef529cddf6af936502131d5676c4a711386dd



More information about the pld-cvs-commit mailing list