Kaynağa Gözat

src/*: code-style: move break before closing brace

Daniele Bartolini 3 yıl önce
ebeveyn
işleme
a5905435f3

+ 3 - 3
src/device/input_manager.cpp

@@ -281,8 +281,8 @@ void InputManager::read(const OsEvent& event)
 				_joypad[ev.device_num]->set_button(ev.button_num, ev.pressed);
 				break;
 			}
+			break;
 		}
-		break;
 
 	case OsEventType::AXIS:
 		{
@@ -313,8 +313,8 @@ void InputManager::read(const OsEvent& event)
 					);
 				break;
 			}
+			break;
 		}
-		break;
 
 	case OsEventType::STATUS:
 		{
@@ -325,8 +325,8 @@ void InputManager::read(const OsEvent& event)
 				_joypad[ev.device_num]->_connected = ev.connected;
 				break;
 			}
+			break;
 		}
-		break;
 
 	default:
 		CE_FATAL("Unknown input event type");

+ 1 - 1
src/device/main_android.cpp

@@ -92,8 +92,8 @@ struct AndroidDevice
 						, _opts
 						);
 				}
+				break;
 			}
-			break;
 
 		case APP_CMD_TERM_WINDOW:
 			// The window is being hidden or closed, clean it up.

+ 4 - 4
src/device/main_linux.cpp

@@ -281,8 +281,8 @@ struct Joypad
 								, 0
 								);
 						}
+						break;
 					}
-					break;
 
 				case JS_EVENT_BUTTON:
 					if (ev.number < countof(s_button))
@@ -487,8 +487,8 @@ struct LinuxDevice
 								, event.type == ButtonPress
 								);
 						}
+						break;
 					}
-					break;
 
 				case MotionNotify:
 					{
@@ -543,8 +543,8 @@ struct LinuxDevice
 							);
 						_mouse_last_x = (s16)mx;
 						_mouse_last_y = (s16)my;
+						break;
 					}
-					break;
 
 				case KeyPress:
 				case KeyRelease:
@@ -579,8 +579,8 @@ struct LinuxDevice
 									_queue.push_text_event(len, utf8);
 							}
 						}
+						break;
 					}
-					break;
 				case KeymapNotify:
 					XRefreshKeyboardMapping(&event.xmapping);
 					break;

+ 7 - 7
src/device/main_windows.cpp

@@ -441,8 +441,8 @@ struct WindowsDevice
 					ClipCursor(&clipRect);
 				}
 				_queue.push_resolution_event(width, height);
+				break;
 			}
-			break;
 
 		case WM_SYSCOMMAND:
 			switch (wparam)
@@ -455,8 +455,8 @@ struct WindowsDevice
 					{
 						PostMessage(parent, id, wparam, lparam);
 					}
+					break;
 				}
-				break;
 			}
 			break;
 
@@ -470,8 +470,8 @@ struct WindowsDevice
 					, delta / WHEEL_DELTA
 					, 0
 					);
+				break;
 			}
-			break;
 
 		case WM_MOUSEMOVE:
 			{
@@ -521,8 +521,8 @@ struct WindowsDevice
 					, (s16)my
 					, 0
 					);
+				break;
 			}
-			break;
 
 		case WM_LBUTTONDOWN:
 		case WM_LBUTTONUP:
@@ -549,8 +549,8 @@ struct WindowsDevice
 					, mb
 					, down
 					);
+				break;
 			}
-			break;
 
 		case WM_KEYDOWN:
 		case WM_SYSKEYDOWN:
@@ -567,8 +567,8 @@ struct WindowsDevice
 						, (id == WM_KEYDOWN || id == WM_SYSKEYDOWN)
 						);
 				}
+				break;
 			}
-			break;
 
 		case WM_CHAR:
 			{
@@ -585,8 +585,8 @@ struct WindowsDevice
 
 				if (len)
 					_queue.push_text_event(len, utf8);
+				break;
 			}
-			break;
 
 		case WM_SETCURSOR:
 			if (LOWORD(lparam) == HTCLIENT)

+ 1 - 1
src/resource/data_compiler.cpp

@@ -1260,8 +1260,8 @@ void DataCompiler::file_monitor_callback(FileMonitorEvent::Enum fme, bool is_dir
 					remove_tree(resource_name.c_str());
 					add_tree(resource_name_renamed.c_str());
 				}
+				break;
 			}
-			break;
 
 		case FileMonitorEvent::CHANGED:
 			if (!is_dir)

+ 3 - 3
src/resource/material_resource.cpp

@@ -249,8 +249,8 @@ namespace material_resource_internal
 					data.z = 0.0f;
 					data.w = 0.0f;
 					reserve_dynamic_data(dynamic, data);
+					break;
 				}
-				break;
 
 			case UniformType::VECTOR2:
 				{
@@ -261,8 +261,8 @@ namespace material_resource_internal
 					data.z = 0.0f;
 					data.w = 0.0f;
 					reserve_dynamic_data(dynamic, data);
+					break;
 				}
-				break;
 
 			case UniformType::VECTOR3:
 				{
@@ -273,8 +273,8 @@ namespace material_resource_internal
 					data.z = value.z;
 					data.w = 0.0f;
 					reserve_dynamic_data(dynamic, data);
+					break;
 				}
-				break;
 
 			case UniformType::VECTOR4:
 				reserve_dynamic_data(dynamic, sjson::parse_vector4(uniform["value"]));

+ 4 - 4
src/world/physics_world_bullet.cpp

@@ -310,8 +310,8 @@ struct PhysicsWorldImpl
 				const btScalar* points = (btScalar*)(data + sizeof(u32));
 
 				child_shape = CE_NEW(*_allocator, btConvexHullShape)(points, (int)num, sizeof(Vector3));
+				break;
 			}
-			break;
 
 		case ColliderType::MESH:
 			{
@@ -336,8 +336,8 @@ struct PhysicsWorldImpl
 				const btVector3 aabb_min(-1000.0f,-1000.0f,-1000.0f);
 				const btVector3 aabb_max(1000.0f,1000.0f,1000.0f);
 				child_shape = CE_NEW(*_allocator, btBvhTriangleMeshShape)(vertex_array, false, aabb_min, aabb_max);
+				break;
 			}
-			break;
 
 		case ColliderType::HEIGHTFIELD:
 			CE_FATAL("Not implemented");
@@ -788,8 +788,8 @@ struct PhysicsWorldImpl
 					, frame_0
 					, frame_1
 					);
+				break;
 			}
-			break;
 
 		case JointType::SPRING:
 			joint = CE_NEW(*_allocator, btPoint2PointConstraint)(*body_0
@@ -820,8 +820,8 @@ struct PhysicsWorldImpl
 					);
 
 				joint = hinge;
+				break;
 			}
-			break;
 
 		default:
 			CE_FATAL("Unknown joint type");

+ 2 - 2
src/world/render_world.cpp

@@ -1072,8 +1072,8 @@ void RenderWorld::LightManager::debug_draw(u32 start_index, u32 num, DebugLine&
 				const Vector3 end = pos + dir*3.0f;
 				dl.add_line(pos, end, COLOR4_YELLOW);
 				dl.add_cone(pos + dir*2.8f, end, 0.1f, COLOR4_YELLOW);
+				break;
 			}
-			break;
 
 		case LightType::OMNI:
 			dl.add_sphere(pos, _data.range[i], COLOR4_YELLOW);
@@ -1085,8 +1085,8 @@ void RenderWorld::LightManager::debug_draw(u32 start_index, u32 num, DebugLine&
 				const f32 range  = _data.range[i];
 				const f32 radius = ftan(angle)*range;
 				dl.add_cone(pos + range*dir, pos, radius, COLOR4_YELLOW);
+				break;
 			}
-			break;
 
 		default:
 			CE_FATAL("Unknown light type");

+ 3 - 3
src/world/world.cpp

@@ -185,8 +185,8 @@ void World::update_scene(f32 dt)
 					const SpriteFrameChangeEvent& ptev = *(SpriteFrameChangeEvent*)data;
 					const SpriteInstance si = _render_world->sprite_instance(ptev.unit);
 					_render_world->sprite_set_frame(si, ptev.frame_num);
+					break;
 				}
-				break;
 
 			default:
 				CE_FATAL("Unknown event type");
@@ -229,15 +229,15 @@ void World::update_scene(f32 dt)
 					const TransformInstance ti = _scene_graph->instance(ptev.unit_id);
 					if (is_valid(ti)) // User code may have destroyed the actor
 						_scene_graph->set_world_pose_and_rescale(ti, ptev.world);
+					break;
 				}
-				break;
 
 			case EventType::PHYSICS_COLLISION:
 				{
 					const PhysicsCollisionEvent& pcev = *(PhysicsCollisionEvent*)data;
 					script_world::collision(*_script_world, pcev);
+					break;
 				}
-				break;
 
 			case EventType::PHYSICS_TRIGGER:
 				break;