From 7f2d356a672d838c90cf47e9ff4006b15c104148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 4 Dec 2020 12:46:43 +0100 Subject: Cleanup: Clang-Tidy, modernize-use-using Replace `typedef` with `using` in C++ code. In the case of `typedef struct SomeName { ... } SomeName;` I removed the `typedef` altogether, as this is unnecessary in C++. Such cases have been rewritten to `struct SomeName { ... };` No functional changes. --- source/blender/gpu/intern/gpu_matrix.cc | 12 ++++++------ source/blender/gpu/intern/gpu_select_sample_query.cc | 4 ++-- source/blender/gpu/opengl/gl_drawlist.cc | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/intern/gpu_matrix.cc b/source/blender/gpu/intern/gpu_matrix.cc index dae56e39db6..4ccb28fedbd 100644 --- a/source/blender/gpu/intern/gpu_matrix.cc +++ b/source/blender/gpu/intern/gpu_matrix.cc @@ -39,15 +39,15 @@ using namespace blender::gpu; #define MATRIX_STACK_DEPTH 32 -typedef float Mat4[4][4]; -typedef float Mat3[3][3]; +using Mat4 = float[4][4]; +using Mat3 = float[3][3]; -typedef struct MatrixStack { +struct MatrixStack { Mat4 stack[MATRIX_STACK_DEPTH]; uint top; -} MatrixStack; +}; -typedef struct GPUMatrixState { +struct GPUMatrixState { MatrixStack model_view_stack; MatrixStack projection_stack; @@ -59,7 +59,7 @@ typedef struct GPUMatrixState { * TODO: separate Model from View transform? Batches/objects have model, * camera/eye has view & projection */ -} GPUMatrixState; +}; #define ModelViewStack Context::get()->matrix_state->model_view_stack #define ModelView ModelViewStack.stack[ModelViewStack.top] diff --git a/source/blender/gpu/intern/gpu_select_sample_query.cc b/source/blender/gpu/intern/gpu_select_sample_query.cc index 74506232655..5d8689c0d6a 100644 --- a/source/blender/gpu/intern/gpu_select_sample_query.cc +++ b/source/blender/gpu/intern/gpu_select_sample_query.cc @@ -47,7 +47,7 @@ using namespace blender; using namespace blender::gpu; -typedef struct GPUSelectQueryState { +struct GPUSelectQueryState { /* Tracks whether a query has been issued so that gpu_load_id can end the previous one */ bool query_issued; /* GPU queries abstraction. Contains an array of queries. */ @@ -68,7 +68,7 @@ typedef struct GPUSelectQueryState { int scissor[4]; eGPUWriteMask write_mask; eGPUDepthTest depth_test; -} GPUSelectQueryState; +}; static GPUSelectQueryState g_query_state = {false}; diff --git a/source/blender/gpu/opengl/gl_drawlist.cc b/source/blender/gpu/opengl/gl_drawlist.cc index c374a7bdc9d..f0a18deafd3 100644 --- a/source/blender/gpu/opengl/gl_drawlist.cc +++ b/source/blender/gpu/opengl/gl_drawlist.cc @@ -43,20 +43,20 @@ using namespace blender::gpu; -typedef struct GLDrawCommand { +struct GLDrawCommand { GLuint v_count; GLuint i_count; GLuint v_first; GLuint i_first; -} GLDrawCommand; +}; -typedef struct GLDrawCommandIndexed { +struct GLDrawCommandIndexed { GLuint v_count; GLuint i_count; GLuint v_first; GLuint base_index; GLuint i_first; -} GLDrawCommandIndexed; +}; #define MDI_ENABLED (buffer_size_ != 0) #define MDI_DISABLED (buffer_size_ == 0) -- cgit v1.2.3