From 5d52146ff783e8966562b1feb144ef1fee03a6f5 Mon Sep 17 00:00:00 2001 From: Johan Manuel Date: Sat, 23 Jul 2016 14:47:49 +0200 Subject: Fix warnings in core/variant_op.cpp Adds default cases in switches where needed, and replaces '0;' with ';;' in macro expansions (as suggested by @vnen in #5587). --- core/variant_op.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core/variant_op.cpp') diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 9182dcde1a..c537ed230f 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -600,6 +600,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& case REAL: { _RETURN( *reinterpret_cast(p_a._data._mem) * p_b._data._real); } break; + default: {} }; r_valid=false; return; @@ -618,6 +619,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& _RETURN( *p_a._data._matrix3 * *p_b._data._matrix3 ); }; + default: {} } ; r_valid=false; return; @@ -635,6 +637,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& _RETURN( *p_a._data._transform * *p_b._data._transform ); }; + default: {} } ; r_valid=false; return; @@ -999,7 +1002,7 @@ Variant Variant::get_named(const StringName& p_index, bool *r_valid) const { DEFAULT_OP_ARRAY_CMD(m_name, DVector, if(skip_cond) return;, arr->set(index, p_value);return) #define DEFAULT_OP_DVECTOR_GET(m_name, dv_type)\ - DEFAULT_OP_ARRAY_CMD(m_name, const DVector, 0, return arr->get(index)) + DEFAULT_OP_ARRAY_CMD(m_name, const DVector, ;, return arr->get(index)) void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) { @@ -2417,7 +2420,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { return *res; } } break; // 20 - DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, 0, return (*arr)[index]) + DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index]) DEFAULT_OP_DVECTOR_GET(RAW_ARRAY, uint8_t) DEFAULT_OP_DVECTOR_GET(INT_ARRAY, int) DEFAULT_OP_DVECTOR_GET(REAL_ARRAY, real_t) @@ -2994,6 +2997,7 @@ bool Variant::iter_init(Variant& r_iter,bool &valid) const { return true; } break; + default: {} } @@ -3137,6 +3141,7 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { r_iter=idx; return true; } break; + default: {} } @@ -3279,6 +3284,7 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; + default: {} } -- cgit v1.2.3