]> git.mxchange.org Git - simgear.git/commitdiff
cppbind: small logging/warning updates.
authorThomas Geymayer <tomgey@gmail.com>
Mon, 5 May 2014 12:51:33 +0000 (14:51 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Mon, 5 May 2014 13:06:15 +0000 (15:06 +0200)
simgear/nasal/cppbind/Ghost.hxx
simgear/nasal/cppbind/detail/to_nasal_helper.hxx

index 2902560572c375666c917febb228c98b7990b329..fa03fba8e074bbd366598d8d2e50e85a2077ee45 100644 (file)
@@ -737,6 +737,17 @@ namespace nasal
             && dynamic_cast<const typename Ghost::raw_type*>(base) != base )
           return 0;
 
+        if( !getSingletonPtr() )
+        {
+          SG_LOG
+          (
+            SG_NASAL,
+            SG_INFO,
+            "Ghost::getTypeFor: can not get type for unregistered ghost"
+          );
+          return 0;
+        }
+
         // Now check if we can further downcast to one of our derived classes.
         for( typename DerivedList::reverse_iterator
                derived = getSingletonPtr()->_derived_types.rbegin();
index a0173ff6a30c2227d3f351bfb560638acefdfa31..559330179e83110569617e4bbb5c43a10ce15492 100644 (file)
@@ -144,7 +144,10 @@ namespace nasal
   {
     // We take just double because in Nasal every number is represented as
     // double
-    double nasal_vec[2] = {vec[0], vec[1]};
+    double nasal_vec[2] = {
+      static_cast<double>(vec[0]),
+      static_cast<double>(vec[1])
+    };
     return to_nasal_helper(c, nasal_vec);
   }