summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Manuel <johan.manuel@live.fr>2016-07-23 14:47:49 +0200
committerJohan Manuel <johan.manuel@live.fr>2016-07-23 14:58:37 +0200
commit5d52146ff783e8966562b1feb144ef1fee03a6f5 (patch)
tree9a4271959499fa2596b91fcd4f88207dcaad7f34
parent221cb58382ae34d4f91d9923fd979a328feabace (diff)
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).
-rw-r--r--core/variant_op.cpp10
1 files changed, 8 insertions, 2 deletions
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<const Quat*>(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<dv_type>, 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<dv_type>, 0, return arr->get(index))
+ DEFAULT_OP_ARRAY_CMD(m_name, const DVector<dv_type>, ;, 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: {}
}