From 81e584ed17902878579131776b4e5a9f7b54cdab Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 May 2017 14:01:03 +1000 Subject: CMake: Use GCC7's -Wimplicit-fallthrough=5 Use to avoid accidental missing break statements, use ATTR_FALLTHROUGH to suppress. --- source/gameengine/Expressions/intern/PyObjectPlus.cpp | 8 ++++---- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 4 ++-- source/gameengine/Ketsji/KX_ObstacleSimulation.cpp | 1 + source/gameengine/Ketsji/KX_SoundActuator.cpp | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'source/gameengine') diff --git a/source/gameengine/Expressions/intern/PyObjectPlus.cpp b/source/gameengine/Expressions/intern/PyObjectPlus.cpp index de45bee76a7..1e4a59aeb5c 100644 --- a/source/gameengine/Expressions/intern/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/intern/PyObjectPlus.cpp @@ -335,7 +335,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * Py_DECREF(resultlist); return NULL; } - // walkthrough + ATTR_FALLTHROUGH; case KX_PYATTRIBUTE_TYPE_INT: { int *val = reinterpret_cast(ptr); @@ -406,7 +406,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * { return NULL; } - // walkthrough + ATTR_FALLTHROUGH; case KX_PYATTRIBUTE_TYPE_INT: { int *val = reinterpret_cast(ptr); @@ -638,7 +638,7 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt PyErr_Format(PyExc_AttributeError, "Size check error for attribute, \"%s\", report to blender.org", attrdef->m_name); goto UNDO_AND_ERROR; } - // walkthrough + ATTR_FALLTHROUGH; case KX_PYATTRIBUTE_TYPE_INT: { int *var = reinterpret_cast(ptr); @@ -883,7 +883,7 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt PyErr_Format(PyExc_AttributeError, "attribute size check error for attribute \"%s\", report to blender.org", attrdef->m_name); goto FREE_AND_ERROR; } - // walkthrough + ATTR_FALLTHROUGH; case KX_PYATTRIBUTE_TYPE_INT: { int *var = reinterpret_cast(ptr); diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index abb64cf1733..e34a5296139 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -133,7 +133,7 @@ bool SCA_PropertySensor::CheckPropertyCondition() { case KX_PROPSENSOR_NOTEQUAL: reverse = true; - /* fall-through */ + ATTR_FALLTHROUGH; case KX_PROPSENSOR_EQUAL: { CValue* orgprop = GetParent()->FindIdentifier(m_checkpropname); @@ -231,7 +231,7 @@ bool SCA_PropertySensor::CheckPropertyCondition() } case KX_PROPSENSOR_LESSTHAN: reverse = true; - /* fall-through */ + ATTR_FALLTHROUGH; case KX_PROPSENSOR_GREATERTHAN: { CValue* orgprop = GetParent()->FindIdentifier(m_checkpropname); diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp index 239bfde4c98..c84b2474c90 100644 --- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp +++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp @@ -345,6 +345,7 @@ static MT_Point3 nearestPointToObstacle(MT_Point3& pos ,KX_Obstacle* obstacle) MT_Point3 res = obstacle->m_pos + abdir*proj; return res; } + ATTR_FALLTHROUGH; } case KX_OBSTACLE_CIRCLE : default: diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index a27f37c0441..822f2e054f8 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -108,7 +108,7 @@ void KX_SoundActuator::play() case KX_SOUNDACT_LOOPBIDIRECTIONAL: case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP: sound = AUD_Sound_pingpong(sound); - // fall through + ATTR_FALLTHROUGH; case KX_SOUNDACT_LOOPEND: case KX_SOUNDACT_LOOPSTOP: loop = true; -- cgit v1.2.3