From 48ed52184d9d96159a1bf06be313dcf5bc869bbe Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 25 Feb 2018 01:11:03 +0200 Subject: [PATCH] Add missing return statements (iOS and server). (cherry picked from commit e3c2778d7ecf84d362bae74b93572e7775171cad) --- drivers/dummy/audio_driver_dummy.h | 6 +++--- drivers/dummy/rasterizer_dummy.h | 24 ++++++++++++++---------- platform/iphone/icloud.mm | 2 ++ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/dummy/audio_driver_dummy.h b/drivers/dummy/audio_driver_dummy.h index c3d8e107673..b3f0fcee07d 100644 --- a/drivers/dummy/audio_driver_dummy.h +++ b/drivers/dummy/audio_driver_dummy.h @@ -43,13 +43,13 @@ public: virtual Error init() { return OK; } virtual void start(){}; - virtual int get_mix_rate() const {}; - virtual SpeakerMode get_speaker_mode() const {}; + virtual int get_mix_rate() const { return DEFAULT_MIX_RATE; }; + virtual SpeakerMode get_speaker_mode() const { return SPEAKER_MODE_STEREO; }; virtual void lock(){}; virtual void unlock(){}; virtual void finish(){}; - virtual float get_latency(){}; + virtual float get_latency() { return 0; }; AudioDriverDummy(){}; ~AudioDriverDummy(){}; diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h index 4a7b8fd3a42..2015388fd61 100644 --- a/drivers/dummy/rasterizer_dummy.h +++ b/drivers/dummy/rasterizer_dummy.h @@ -269,7 +269,10 @@ public: PoolVector p; return p; } - PoolVector mesh_surface_get_index_array(RID p_mesh, int p_surface) const {} + PoolVector mesh_surface_get_index_array(RID p_mesh, int p_surface) const { + PoolVector p; + return p; + } uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const { return 0; } VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const { return VS::PRIMITIVE_POINTS; } @@ -301,9 +304,9 @@ public: RID multimesh_get_mesh(RID p_multimesh) const { return RID(); } - Transform multimesh_instance_get_transform(RID p_multimesh, int p_index) const {} - Transform2D multimesh_instance_get_transform_2d(RID p_multimesh, int p_index) const {} - Color multimesh_instance_get_color(RID p_multimesh, int p_index) const {} + Transform multimesh_instance_get_transform(RID p_multimesh, int p_index) const { return Transform(); } + Transform2D multimesh_instance_get_transform_2d(RID p_multimesh, int p_index) const { return Transform2D(); } + Color multimesh_instance_get_color(RID p_multimesh, int p_index) const { return Color(); } void multimesh_set_visible_instances(RID p_multimesh, int p_visible) {} int multimesh_get_visible_instances(RID p_multimesh) const { return 0; } @@ -370,7 +373,7 @@ public: VS::LightType light_get_type(RID p_light) const { return VS::LIGHT_OMNI; } AABB light_get_aabb(RID p_light) const { return AABB(); } float light_get_param(RID p_light, VS::LightParam p_param) { return 0.0; } - Color light_get_color(RID p_light) {} + Color light_get_color(RID p_light) { return Color(); } uint64_t light_get_version(RID p_light) const { return 0; } /* PROBE API */ @@ -391,7 +394,7 @@ public: void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers) {} AABB reflection_probe_get_aabb(RID p_probe) const { return AABB(); } - VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const {} + VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const { return VisualServer::REFLECTION_PROBE_UPDATE_ONCE; } uint32_t reflection_probe_get_cull_mask(RID p_probe) const { return 0; } Vector3 reflection_probe_get_extents(RID p_probe) const { return Vector3(); } Vector3 reflection_probe_get_origin_offset(RID p_probe) const { return Vector3(); } @@ -581,7 +584,7 @@ public: RID canvas_light_occluder_create() { return RID(); } void canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector &p_lines) {} - VS::InstanceType get_base_type(RID p_rid) const {} + VS::InstanceType get_base_type(RID p_rid) const { return VS::INSTANCE_NONE; } bool free(RID p_rid) { if (texture_owner.owns(p_rid)) { @@ -590,9 +593,10 @@ public: texture_owner.free(p_rid); memdelete(texture); } + return true; } - bool has_os_feature(const String &p_feature) const {} + bool has_os_feature(const String &p_feature) const { return false; } void update_dirty_resources() {} @@ -600,9 +604,9 @@ public: void render_info_begin_capture() {} void render_info_end_capture() {} - int get_captured_render_info(VS::RenderInfo p_info) {} + int get_captured_render_info(VS::RenderInfo p_info) { return 0; } - int get_render_info(VS::RenderInfo p_info) {} + int get_render_info(VS::RenderInfo p_info) { return 0; } static RasterizerStorage *base_singleton; diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index 7508a480ce1..a9748bf562e 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -131,6 +131,8 @@ Variant nsobject_to_variant(NSObject *object) { return Variant([num floatValue]); } else if (strcmp([num objCType], @encode(double)) == 0) { return Variant((float)[num doubleValue]); + } else { + return Variant(); } } else if ([object isKindOfClass:[NSDate class]]) { //this is a type that icloud supports...but how did you submit it in the first place?