]> git.mxchange.org Git - simgear.git/commitdiff
Simplify/Make VS happy
authorThomas Geymayer <tomgey@gmail.com>
Tue, 27 Nov 2012 14:14:54 +0000 (15:14 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Tue, 27 Nov 2012 14:14:54 +0000 (15:14 +0100)
simgear/canvas/CanvasEvent.hxx
simgear/canvas/MouseEvent.hxx
simgear/nasal/cppbind/cppbind_test.cxx
simgear/nasal/cppbind/from_nasal_detail.hxx

index 88cb42161551029c8432fd2b49d48a712659bdcd..b8babfb54682423d1c335acdca8e218882e38068 100644 (file)
@@ -26,7 +26,7 @@ namespace simgear
 namespace canvas
 {
 
-  struct Event
+  class Event
   {
     public:
 
index b5d014f2d02d21c80eb7810f20ac17e693a9ac75..39a6404d7ffbfe905fcf15594f00deee7e31f6db 100644 (file)
@@ -27,24 +27,25 @@ namespace simgear
 namespace canvas
 {
 
-  struct MouseEvent:
+  class MouseEvent:
     public Event
   {
-    MouseEvent():
-      button(-1),
-      state(-1),
-      mod(-1)
-    {}
-
-    osg::Vec2f getPos() const { return pos; }
-    osg::Vec3f getPos3() const { return osg::Vec3f(pos, 0); }
-    osg::Vec2f getDelta() const { return delta; }
-
-    osg::Vec2f  pos,
-                delta;
-    int         button, //<! Button for this event
-                state,  //<! Current button state
-                mod;    //<! Keyboard modifier state
+    public:
+      MouseEvent():
+        button(-1),
+        state(-1),
+        mod(-1)
+      {}
+
+      osg::Vec2f getPos() const { return pos; }
+      osg::Vec3f getPos3() const { return osg::Vec3f(pos, 0); }
+      osg::Vec2f getDelta() const { return delta; }
+
+      osg::Vec2f  pos,
+                  delta;
+      int         button, //<! Button for this event
+                  state,  //<! Current button state
+                  mod;    //<! Keyboard modifier state
   };
 
 } // namespace canvas
index 4a2802ac660ca8e66d0bbbffa2ee514ae8f8d0d2..7543cdf83a40cb682537e194d8466dc29c96a05b 100644 (file)
@@ -42,7 +42,6 @@ typedef boost::shared_ptr<DoubleDerived> DoubleDerivedPtr;
 typedef boost::shared_ptr<DoubleDerived2> DoubleDerived2Ptr;
 
 naRef member(Derived&, const nasal::CallContext&) { return naNil(); }
-naRef member(DerivedPtr&, const nasal::CallContext&) { return naNil(); }
 
 int main(int argc, char* argv[])
 {
index 48a8879ee9f7fcac814dec5d5dfafcd045482192..20a7407f3454d0d5eb688d4fbb451cc9cf6abef1 100644 (file)
@@ -97,28 +97,17 @@ namespace nasal
   /**
    * Convert a Nasal vector to a std::vector
    */
-  template<class Vector>
-  typename boost::enable_if< boost::is_same
-                             < Vector,
-                               std::vector<typename Vector::value_type>
-                             >,
-                             Vector
-                           >::type
-  from_nasal_helper(naContext c, naRef ref, Vector*)
+  template<class T>
+  std::vector<T> from_nasal_helper(naContext c, naRef ref, std::vector<T>*)
   {
     if( !naIsVector(ref) )
       throw bad_nasal_cast("Not a vector");
 
     int size = naVec_size(ref);
-    Vector vec(size);
+    std::vector<T> vec(size);
 
     for(int i = 0; i < size; ++i)
-      vec[i] = from_nasal_helper
-      (
-        c,
-        naVec_get(ref, i),
-        static_cast<typename Vector::value_type*>(0)
-      );
+      vec[i] = from_nasal_helper(c, naVec_get(ref, i), static_cast<T*>(0));
 
     return vec;
   }