From edaae885ee03c07b18fdfc1417e0def9fd9fce4c Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Mon, 5 May 2014 14:51:33 +0200 Subject: [PATCH] cppbind: small logging/warning updates. --- simgear/nasal/cppbind/Ghost.hxx | 11 +++++++++++ simgear/nasal/cppbind/detail/to_nasal_helper.hxx | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/simgear/nasal/cppbind/Ghost.hxx b/simgear/nasal/cppbind/Ghost.hxx index 29025605..fa03fba8 100644 --- a/simgear/nasal/cppbind/Ghost.hxx +++ b/simgear/nasal/cppbind/Ghost.hxx @@ -737,6 +737,17 @@ namespace nasal && dynamic_cast(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(); diff --git a/simgear/nasal/cppbind/detail/to_nasal_helper.hxx b/simgear/nasal/cppbind/detail/to_nasal_helper.hxx index a0173ff6..55933017 100644 --- a/simgear/nasal/cppbind/detail/to_nasal_helper.hxx +++ b/simgear/nasal/cppbind/detail/to_nasal_helper.hxx @@ -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(vec[0]), + static_cast(vec[1]) + }; return to_nasal_helper(c, nasal_vec); } -- 2.39.5