[Fencommits] libvob: Fix some template and other code to be strict c++ as g++-3.4 demands.

Matti J. Katila majukati at cc.jyu.fi
Tue Feb 7 23:05:20 EET 2006


Tue Feb  7 02:38:03 EET 2006  Matti J. Katila <majukati at cc.jyu.fi>
  * Fix some template and other code to be strict c++ as g++-3.4 demands.

diff -rN -u libvob-old/include/vob/jni/Generate.hxx libvob-new/include/vob/jni/Generate.hxx
--- libvob-old/include/vob/jni/Generate.hxx	2006-02-07 23:05:18.950084907 +0200
+++ libvob-new/include/vob/jni/Generate.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -259,7 +259,7 @@
 
 #define VOB_PRIMITIVETRANS_DEFINED_LEAF(x, n)  \
     static JNI::TransJNIGenerator<x> x##generator(#x, n); \
-    const char *Primitives::PrimitiveHierarchicalTransform<x>::name = #x
+    template<> const char *Primitives::PrimitiveHierarchicalTransform<x>::name = #x
 
 #define VOB_PRIMITIVETRANS_DEFINED_NONLEAF(x, n)  
 
diff -rN -u libvob-old/include/vob/jni/Types.hxx libvob-new/include/vob/jni/Types.hxx
--- libvob-old/include/vob/jni/Types.hxx	2006-02-07 23:05:18.951084756 +0200
+++ libvob-new/include/vob/jni/Types.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -110,7 +110,7 @@
     typedef std::vector<float> floatvector;
 
 #define START_VOB_JNI_CONVERSION(type, javaName_, jnitype_) 	\
-    struct JParameter<type> {					\
+    template<> struct JParameter<type> {					\
 	typedef jnitype_ jniType; 				\
 	static std::string javaParam(std::string paramPrefix) {  	\
 	    return std::string(javaName_)+" "+paramPrefix;  	\
@@ -147,7 +147,7 @@
 	    END_VOB_JNI_CONVERSION
 
 #define START_VOB_JNI_CONVERSION_IDDED(type, javaName_)		\
-    struct JParameter<type> {					\
+    template<> struct JParameter<type> {					\
 	typedef jint jniType; 				\
 	static std::string javaParam(std::string paramPrefix) {  	\
 	    return std::string(javaName_)+" "+paramPrefix;  	\
diff -rN -u libvob-old/include/vob/trans/LinearPrimitives.hxx libvob-new/include/vob/trans/LinearPrimitives.hxx
--- libvob-old/include/vob/trans/LinearPrimitives.hxx	2006-02-07 23:05:18.971081741 +0200
+++ libvob-new/include/vob/trans/LinearPrimitives.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -66,6 +66,21 @@
 	}
     };
 
+    struct TranslateXYZ_Explicit : 
+	    public TranslateXYZ, 
+	    public ParametrizedPrimitiveTransform {
+    public:
+	enum { NParams = 3 };
+	
+	template<class Ptr> void setParams(Ptr p) {
+	    vec.x = p[0];
+	    vec.y = p[1];
+	    vec.z = p[2];
+	}
+    };
+    VOB_PRIMITIVETRANS_DEFINED(TranslateXYZ_Explicit, "translate");
+
+
     /** A simple scale in 3 dimensions.
      * Can't be used in HierarchicalTransform directly
      * because parameters are required.
@@ -90,16 +105,29 @@
 	    into.vec = ZPt(1.0/vec.x, 1.0/vec.y, 1.0/vec.z);
 	}
     };
+    struct ScaleXYZ_Explicit : 
+	    public ScaleXYZ, 
+	    public ParametrizedPrimitiveTransform {
+    public:
+	enum { NParams = 3 };
+	
+	template<class Ptr> void setParams(Ptr p) {
+	    vec.x = p[0];
+	    vec.y = p[1];
+	    vec.z = p[2];
+	}
+    };
+    VOB_PRIMITIVETRANS_DEFINED(ScaleXYZ_Explicit, "scale");
 
     /** Expose the vec in TranslateXYZ and ScaleXYZ and possibly
      * others explicitly.
-     */
+     * /
     template<class T> struct Vec_Explicit : 
 	    public T, 
 	    public ParametrizedPrimitiveTransform {
 
 	enum { NParams = 3 };
-
+	
 	template<class Ptr> void setParams(Ptr p) {
 	    vec.x = p[0];
 	    vec.y = p[1];
@@ -109,15 +137,16 @@
 
     /** An explicit translation by a 3D vector.
      * Parameters: x, y, z.
-     */
+     * /
     typedef Vec_Explicit<TranslateXYZ> TranslateXYZ_Explicit;
     /** An explicit scale by a 3D vector.
      * Parameters: sx, sy, sz.
-     */
+     * /
     typedef Vec_Explicit<ScaleXYZ> ScaleXYZ_Explicit;
-
+    
     VOB_PRIMITIVETRANS_DEFINED(TranslateXYZ_Explicit, "translate");
     VOB_PRIMITIVETRANS_DEFINED(ScaleXYZ_Explicit, "scale");
+    */
 
     /** Rotation clockwise. 
      */
diff -rN -u libvob-old/include/vob/trans/Primitives.hxx libvob-new/include/vob/trans/Primitives.hxx
--- libvob-old/include/vob/trans/Primitives.hxx	2006-02-07 23:05:18.967082344 +0200
+++ libvob-new/include/vob/trans/Primitives.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -28,6 +28,7 @@
 #define VOB_PRIMITIVES_HXX
 
 #include <vob/Vec23.hxx>
+#include <vob/VecGL.hxx>
 #include <vob/Templates.hxx>
 #include <vob/Transform.hxx>
 #include <boost/type_traits.hpp>
diff -rN -u libvob-old/include/vob/vobs/Fillet.hxx libvob-new/include/vob/vobs/Fillet.hxx
--- libvob-old/include/vob/vobs/Fillet.hxx	2006-02-07 23:05:18.961083248 +0200
+++ libvob-new/include/vob/vobs/Fillet.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -48,10 +48,10 @@
 #endif
 
 using namespace Vob::Geom;
+using namespace Vob::VecGL;
 
 namespace Vob {
 namespace Vobs {
-using namespace Vob::VecGL;
 
     PREDBGVAR(dbg_vfillets);
 
diff -rN -u libvob-old/include/vob/vobs/GLState.hxx libvob-new/include/vob/vobs/GLState.hxx
--- libvob-old/include/vob/vobs/GLState.hxx	2006-02-07 23:05:18.965082645 +0200
+++ libvob-new/include/vob/vobs/GLState.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -43,9 +43,12 @@
 #endif
 
 namespace Vob {
+
+//using namespace VecGL;
+
 namespace Vobs {
 
-using namespace Vob::VecGL;
+//using namespace Vob::VecGL;
 
 /** Cause the given GL matrix with to contain the matrix
  * for the given transformation.
diff -rN -u libvob-old/include/vob/vobs/Paper.hxx libvob-new/include/vob/vobs/Paper.hxx
--- libvob-old/include/vob/vobs/Paper.hxx	2006-02-07 23:05:18.956084002 +0200
+++ libvob-new/include/vob/vobs/Paper.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -779,14 +779,14 @@
     }
 
     template<class T> void render(const T &coords1, const T &coords2) const {
-	    DBG(dbg) << "Paper\\n";
+	    DBG(dbg_paperquad) << "Paper\\n";
 	    GLERR;
 
 	    const Transform &cs1inv = coords1.getInverse();
 	    const Transform &cs2inv = coords2.getInverse();
 
 	    for(Paper::Paper::iterator it = paper->begin(); it != paper->end(); ++it) {
-		if (dbg) cout << "Pass\\n";
+		if (dbg_paperquad) cout << "Pass\\n";
 
 		GLERR;
 
diff -rN -u libvob-old/include/vob/vobs/Texture.hxx libvob-new/include/vob/vobs/Texture.hxx
--- libvob-old/include/vob/vobs/Texture.hxx	2006-02-07 23:05:18.963082947 +0200
+++ libvob-new/include/vob/vobs/Texture.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -43,10 +43,11 @@
 #define VOB_DEFINED(t)
 #endif
 
+using namespace Vob::VecGL;
+
 namespace Vob {
 namespace Vobs {
 
-using namespace Vob::VecGL;
 
 /** Copy into the currently bound texture
  * a rectangle from the screen.
diff -rN -u libvob-old/include/vob/vobs/Trivial.hxx libvob-new/include/vob/vobs/Trivial.hxx
--- libvob-old/include/vob/vobs/Trivial.hxx	2006-02-07 23:05:18.962083098 +0200
+++ libvob-new/include/vob/vobs/Trivial.hxx	2006-02-07 22:10:36.000000000 +0200
@@ -45,7 +45,8 @@
 namespace Vob {
 namespace Vobs {
 
-using namespace Vob::VecGL;
+//using namespace Vob::VecGL;
+//    using Vob::VecGL;
 
 /** A line (in screen space)
  * drawn between the centers of two coordinate systems.
@@ -296,8 +297,8 @@
 		glBegin(GL_QUAD_STRIP);
 		for(int j=0; j<(dicey+1); j++) {
 		    float y = boxwh.y * j / (dicey+0.);
-		    glVertex(ZPt(x0,y,0));
-		    glVertex(ZPt(x1,y,0));
+		    VecGL::glVertex(ZPt(x0,y,0));
+		    VecGL::glVertex(ZPt(x1,y,0));
 		}
 		glEnd();
 	    }
@@ -309,8 +310,8 @@
 		glBegin(GL_QUAD_STRIP);
 		for(int j=0; j<(dicey+1); j++) {
 		    float y = boxwh.y * j / (dicey+0.);
-		    glVertex(t.transform(ZPt(x0,y,0)));
-		    glVertex(t.transform(ZPt(x1,y,0)));
+		    VecGL::glVertex(t.transform(ZPt(x0,y,0)));
+		    VecGL::glVertex(t.transform(ZPt(x1,y,0)));
 		}
 		glEnd();
 	    }




More information about the Fencommits mailing list