Commit: a331d5c99299c4514ca33c843b1c79b872f2728d Author: Sergey Sharybin Date: Fri Nov 6 13:18:48 2020 +0100 Branches: master https://developer.blender.org/rBa331d5c99299c4514ca33c843b1c79b872f2728d
Cleanup: Clang-Tidy, modernize-redundant-void-arg =================================================================== M .clang-tidy M source/blender/depsgraph/intern/debug/deg_debug.cc M source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp M source/blender/gpu/intern/gpu_context.cc M source/blender/gpu/intern/gpu_framebuffer.cc M source/blender/gpu/intern/gpu_immediate.cc M source/blender/gpu/intern/gpu_platform.cc M source/blender/gpu/intern/gpu_shader_interface.cc M source/blender/gpu/intern/gpu_state.cc M source/blender/gpu/intern/gpu_vertex_buffer.cc M source/blender/gpu/opengl/gl_backend.cc M source/blender/gpu/opengl/gl_batch.cc M source/blender/gpu/opengl/gl_context.cc M source/blender/gpu/opengl/gl_debug.cc M source/blender/gpu/opengl/gl_debug_layer.cc M source/blender/gpu/opengl/gl_drawlist.cc M source/blender/gpu/opengl/gl_framebuffer.cc M source/blender/gpu/opengl/gl_immediate.cc M source/blender/gpu/opengl/gl_index_buffer.cc M source/blender/gpu/opengl/gl_query.cc M source/blender/gpu/opengl/gl_shader.cc M source/blender/gpu/opengl/gl_state.cc M source/blender/gpu/opengl/gl_texture.cc M source/blender/gpu/opengl/gl_uniform_buffer.cc M source/blender/gpu/opengl/gl_vertex_buffer.cc M source/blender/io/usd/intern/usd_capi.cc M source/blender/nodes/intern/node_socket.cc =================================================================== diff --git a/.clang-tidy b/.clang-tidy index 25be61ff649..92926de9eca 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -43,7 +43,6 @@ Checks: > -modernize-use-emplace, -modernize-use-nodiscard, -modernize-use-using, - -modernize-redundant-void-arg, -modernize-use-bool-literals, -modernize-loop-convert, -modernize-pass-by-value, diff --git a/source/blender/depsgraph/intern/debug/deg_debug.cc b/source/blender/depsgraph/intern/debug/deg_debug.cc index ab6adea6416..b7310f3713e 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug.cc @@ -73,7 +73,7 @@ void DepsgraphDebug::end_graph_evaluation() is_ever_evaluated = true; } -bool terminal_do_color(void) +bool terminal_do_color() { return (G.debug & G_DEBUG_DEPSGRAPH_PRETTY) != 0; } @@ -90,7 +90,7 @@ string color_for_pointer(const void *pointer) return string(buffer); } -string color_end(void) +string color_end() { if (!terminal_do_color()) { return ""; diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 2f465a973fc..92df844d0b3 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -188,7 +188,7 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer() BKE_main_free(freestyle_bmain); } -float BlenderStrokeRenderer::get_stroke_vertex_z(void) const +float BlenderStrokeRenderer::get_stroke_vertex_z() const { float z = _z; BlenderStrokeRenderer *self = const_cast<BlenderStrokeRenderer *>(this); @@ -199,7 +199,7 @@ float BlenderStrokeRenderer::get_stroke_vertex_z(void) const return -z; } -unsigned int BlenderStrokeRenderer::get_stroke_mesh_id(void) const +unsigned int BlenderStrokeRenderer::get_stroke_mesh_id() const { unsigned mesh_id = _mesh_id; BlenderStrokeRenderer *self = const_cast<BlenderStrokeRenderer *>(this); diff --git a/source/blender/gpu/intern/gpu_context.cc b/source/blender/gpu/intern/gpu_context.cc index 119c1ef9c55..3ebfd80241d 100644 --- a/source/blender/gpu/intern/gpu_context.cc +++ b/source/blender/gpu/intern/gpu_context.cc @@ -80,12 +80,12 @@ Context::~Context() delete imm; } -bool Context::is_active_on_thread(void) +bool Context::is_active_on_thread() { return (this == active_ctx) && pthread_equal(pthread_self(), thread_); } -Context *Context::get(void) +Context *Context::get() { return active_ctx; } @@ -188,7 +188,7 @@ void GPU_backend_exit(void) g_backend = NULL; } -GPUBackend *GPUBackend::get(void) +GPUBackend *GPUBackend::get() { return g_backend; } diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 8d9a1301be0..a16856e0dec 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -496,7 +496,7 @@ static void gpuPushFrameBuffer(GPUFrameBuffer *fb) FrameBufferStack.top++; } -static GPUFrameBuffer *gpuPopFrameBuffer(void) +static GPUFrameBuffer *gpuPopFrameBuffer() { BLI_assert(FrameBufferStack.top > 0); FrameBufferStack.top--; diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc index 44c6cac02ca..9437f18cb14 100644 --- a/source/blender/gpu/intern/gpu_immediate.cc +++ b/source/blender/gpu/intern/gpu_immediate.cc @@ -41,17 +41,17 @@ using namespace blender::gpu; static thread_local Immediate *imm = NULL; -void immActivate(void) +void immActivate() { imm = Context::get()->imm; } -void immDeactivate(void) +void immDeactivate() { imm = NULL; } -GPUVertFormat *immVertexFormat(void) +GPUVertFormat *immVertexFormat() { GPU_vertformat_clear(&imm->vertex_format); return &imm->vertex_format; @@ -81,7 +81,7 @@ void immBindBuiltinProgram(eGPUBuiltinShader shader_id) imm->builtin_shader_bound = shader_id; } -void immUnbindProgram(void) +void immUnbindProgram() { BLI_assert(imm->shader != NULL); @@ -90,7 +90,7 @@ void immUnbindProgram(void) } /* XXX do not use it. Special hack to use OCIO with batch API. */ -GPUShader *immGetShader(void) +GPUShader *immGetShader() { return imm->shader; } @@ -187,7 +187,7 @@ static void wide_line_workaround_start(GPUPrimType prim_type) } } -static void wide_line_workaround_end(void) +static void wide_line_workaround_end() { if (imm->prev_shader) { immUnbindProgram(); @@ -249,7 +249,7 @@ GPUBatch *immBeginBatchAtMost(GPUPrimType prim_type, uint vertex_len) return immBeginBatch(prim_type, vertex_len); } -void immEnd(void) +void immEnd() { BLI_assert(imm->prim_type != GPU_PRIM_NONE); /* Make sure we're between a Begin/End pair. */ BLI_assert(imm->vertex_data || imm->batch); @@ -480,7 +480,7 @@ void immAttrSkip(uint attr_id) setAttrValueBit(attr_id); } -static void immEndVertex(void) /* and move on to the next vertex */ +static void immEndVertex() /* and move on to the next vertex */ { BLI_assert(imm->prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ BLI_assert(imm->vertex_idx < imm->vertex_len); diff --git a/source/blender/gpu/intern/gpu_platform.cc b/source/blender/gpu/intern/gpu_platform.cc index ad7142878e7..6b9878f2ba4 100644 --- a/source/blender/gpu/intern/gpu_platform.cc +++ b/source/blender/gpu/intern/gpu_platform.cc @@ -77,7 +77,7 @@ void GPUPlatformGlobal::create_gpu_name(const char *vendor, BLI_str_replace_char(gpu_name, '\r', ' '); } -void GPUPlatformGlobal::clear(void) +void GPUPlatformGlobal::clear() { MEM_SAFE_FREE(GPG.support_key); MEM_SAFE_FREE(GPG.gpu_name); @@ -94,12 +94,12 @@ void GPUPlatformGlobal::clear(void) using namespace blender::gpu; -eGPUSupportLevel GPU_platform_support_level(void) +eGPUSupportLevel GPU_platform_support_level() { return GPG.support_level; } -const char *GPU_platform_support_level_key(void) +const char *GPU_platform_support_level_key() { return GPG.support_key; } diff --git a/source/blender/gpu/intern/gpu_shader_interface.cc b/source/blender/gpu/intern/gpu_shader_interface.cc index e5fb8025e7f..81c1e013877 100644 --- a/source/blender/gpu/intern/gpu_shader_interface.cc +++ b/source/blender/gpu/intern/gpu_shader_interface.cc @@ -32,12 +32,12 @@ namespace blender::gpu { -ShaderInterface::ShaderInterface(void) +ShaderInterface::ShaderInterface() { /* TODO(fclem): add unique ID for debugging. */ } -ShaderInterface::~ShaderInterface(void) +ShaderInterface::~ShaderInterface() { /* Free memory used by name_buffer. */ MEM_freeN(name_buffer_); @@ -70,14 +70,14 @@ static void sort_input_list(MutableSpan<ShaderInput> dst) /* Sorts all inputs inside their respective array. * This is to allow fast hash collision detection. * See ShaderInterface::input_lookup for more details. */ -void ShaderInterface::sort_inputs(void) +void ShaderInterface::sort_inputs() { sort_input_list(MutableSpan<ShaderInput>(inputs_, attr_len_)); sort_input_list(MutableSpan<ShaderInput>(inputs_ + attr_len_, ubo_len_)); sort_input_list(MutableSpan<ShaderInput>(inputs_ + attr_len_ + ubo_len_, uniform_len_)); } -void ShaderInterface::debug_print(void) +void ShaderInterface::debug_print() { Span<ShaderInput> attrs = Span<ShaderInput>(inputs_, attr_len_); Span<ShaderInput> ubos = Span<ShaderInput>(inputs_ + attr_len_, ubo_len_); diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc index 0b2e4989a33..407a8dd6e2b 100644 --- a/source/blender/gpu/intern/gpu_state.cc +++ b/source/blender/gpu/intern/gpu_state.cc @@ -260,7 +260,7 @@ eGPUStencilTest GPU_stencil_test_get() } /* NOTE: Already premultiplied by U.pixelsize. */ -float GPU_line_width_get(void) +float GPU_line_width_get() { GPUStateMutable &state = Context::get()->state_manager->mutable_state; return state.line_width; @@ -285,13 +285,13 @@ void GPU_viewport_size_get_i(int coords[4]) Context::get()->active_fb->viewport_get(coords); } -bool GPU_depth_mask_get(void) +bool GPU_depth_mask_get() { GPUState &state = Context::get()->state_manager->state; return (state.write_mask & GPU_WRITE_DEPTH) != 0; } -bool GPU_mipmap_enabled(void) +bool GPU_mipmap_enabled() { /* TODO(fclem): this used to be a userdef option. */ return true; @@ -303,17 +303,17 @@ bool GPU_mipmap_enabled(void) /** \name Context Utils * \{ */ -void GPU_flush(void) +void GPU_flush() { Context::get()->flush(); } -void GPU_finish(void) +void GPU_finish() { Context::get()->finish(); } -void GPU_apply_state(void) +void GPU_apply_state() { Context::get()->state_manager->apply_state(); } @@ -328,7 +328,7 @@ void GPU_apply_state(void) * bgl functions. * \{ */ -void GPU_bgl_start(void) +void GPU_bgl_start() { Context *ctx = Context::get(); if (!(ctx && ctx->state_manager)) { @@ -345,7 +345,7 @@ void GPU_bgl_start(void) } /* Just turn off the bgl safeguard system. Can be called even without GPU_bgl_start. */ -void GPU_bgl_end(void) +void GPU_bgl_end() { Context *ctx = Context::get(); if (!(ctx && ctx->state_manager)) { @@ -359,7 +359,7 @@ void GPU_bgl_end(void) } } -bool GPU_bgl_get(void) +bool GPU_bgl_get() { return Context::get()->state_manager->use_bgl; } @@ -381,7 +381,7 @@ void GPU_memory_barrier(eGPUBarrier barrier) /** \name Default State * \{ */ -StateManager::StateManager(void) +StateManager::StateManager() { /* Set default state. */ state.write_mask = GPU_WRITE_COLOR; diff --git a/source/blender/gpu/intern/gpu_vertex_buffer.cc b/source/blender/gpu/intern/gpu_vertex_buffer.cc index 29fa8a89d27..be66d91b025 100644 --- a/source/blender/gpu/intern/gpu_vertex_buffer.cc +++ b/source/blender/gpu/intern/gpu_vertex_buffer.cc @@ -66,13 +66,13 @@ void VertBuf::init(const GPUVertFormat *format, GPUUsageType usage) flag |= GPU_VERTBUF_INIT; } -void VertBuf::clear(void) +void VertBuf::clear() { this->release_data(); flag = GPU_VERTBUF_INVALID; } -VertBuf *VertBuf::duplicate(void) +VertBuf *VertBuf::duplicate() { VertBuf *dst = GPUBackend::get()->vertbuf_alloc(); @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs