From 91694b9b58ab953f3b313be9389cc1303e472fc2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 7 Aug 2020 09:50:34 +0200 Subject: Code Style: use "#pragma once" in source directory This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466 --- source/blender/gpu/intern/gpu_attr_binding_private.h | 5 +---- source/blender/gpu/intern/gpu_batch_private.h | 5 +---- source/blender/gpu/intern/gpu_codegen.h | 5 +---- source/blender/gpu/intern/gpu_context_private.h | 5 +---- source/blender/gpu/intern/gpu_material_library.h | 5 +---- source/blender/gpu/intern/gpu_matrix_private.h | 5 +---- source/blender/gpu/intern/gpu_node_graph.h | 5 +---- source/blender/gpu/intern/gpu_primitive_private.h | 5 +---- source/blender/gpu/intern/gpu_private.h | 5 +---- source/blender/gpu/intern/gpu_select_private.h | 5 +---- source/blender/gpu/intern/gpu_shader_private.h | 5 +---- source/blender/gpu/intern/gpu_vertex_format_private.h | 5 +---- 12 files changed, 12 insertions(+), 48 deletions(-) (limited to 'source/blender/gpu/intern') diff --git a/source/blender/gpu/intern/gpu_attr_binding_private.h b/source/blender/gpu/intern/gpu_attr_binding_private.h index 301ec3333dd..4f18655ec62 100644 --- a/source/blender/gpu/intern/gpu_attr_binding_private.h +++ b/source/blender/gpu/intern/gpu_attr_binding_private.h @@ -23,8 +23,7 @@ * GPU vertex attribute binding */ -#ifndef __GPU_ATTR_BINDING_PRIVATE_H__ -#define __GPU_ATTR_BINDING_PRIVATE_H__ +#pragma once #include "GPU_shader_interface.h" #include "GPU_vertex_format.h" @@ -35,5 +34,3 @@ void get_attr_locations(const GPUVertFormat *format, GPUAttrBinding *binding, const GPUShaderInterface *shaderface); uint read_attr_location(const GPUAttrBinding *binding, uint a_idx); - -#endif /* __GPU_ATTR_BINDING_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_batch_private.h b/source/blender/gpu/intern/gpu_batch_private.h index 58d1810ac7a..93745b9ca9b 100644 --- a/source/blender/gpu/intern/gpu_batch_private.h +++ b/source/blender/gpu/intern/gpu_batch_private.h @@ -24,8 +24,7 @@ * Contains VAOs + VBOs + Shader representing a drawable entity. */ -#ifndef __GPU_BATCH_PRIVATE_H__ -#define __GPU_BATCH_PRIVATE_H__ +#pragma once #include "GPU_batch.h" #include "GPU_context.h" @@ -40,5 +39,3 @@ void gpu_batch_remove_interface_ref(GPUBatch *batch, const GPUShaderInterface *i #ifdef __cplusplus } #endif - -#endif /* __GPU_BATCH_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index e12e0c0ba08..1454edeb1e0 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -23,8 +23,7 @@ * Generate shader code from the intermediate node graph. */ -#ifndef __GPU_CODEGEN_H__ -#define __GPU_CODEGEN_H__ +#pragma once struct GPUMaterial; struct GPUNodeGraph; @@ -62,5 +61,3 @@ void GPU_pass_release(GPUPass *pass); void gpu_codegen_init(void); void gpu_codegen_exit(void); - -#endif /* __GPU_CODEGEN_H__ */ diff --git a/source/blender/gpu/intern/gpu_context_private.h b/source/blender/gpu/intern/gpu_context_private.h index f64cdf439a1..08fbefe3b3f 100644 --- a/source/blender/gpu/intern/gpu_context_private.h +++ b/source/blender/gpu/intern/gpu_context_private.h @@ -23,8 +23,7 @@ * This interface allow GPU to manage GL objects for multiple context and threads. */ -#ifndef __GPU_CONTEXT_PRIVATE_H__ -#define __GPU_CONTEXT_PRIVATE_H__ +#pragma once #include "GPU_context.h" @@ -64,5 +63,3 @@ struct GPUMatrixState *gpu_context_active_matrix_state_get(void); #ifdef __cplusplus } #endif - -#endif /* __GPU_CONTEXT_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_material_library.h b/source/blender/gpu/intern/gpu_material_library.h index f69c25b9490..da7b1636fa3 100644 --- a/source/blender/gpu/intern/gpu_material_library.h +++ b/source/blender/gpu/intern/gpu_material_library.h @@ -22,8 +22,7 @@ * * Parsing of and code generation using GLSL shaders in gpu/shaders/material. */ -#ifndef __GPU_MATERIAL_LIBRARY_H__ -#define __GPU_MATERIAL_LIBRARY_H__ +#pragma once #include "GPU_material.h" @@ -65,5 +64,3 @@ char *gpu_material_library_generate_code(struct GSet *used_libraries, const char char *gpu_str_skip_token(char *str, char *token, int max); const char *gpu_data_type_to_string(const eGPUType type); - -#endif /* __ __GPU_MATERIAL_LIBRARY_H__ */ diff --git a/source/blender/gpu/intern/gpu_matrix_private.h b/source/blender/gpu/intern/gpu_matrix_private.h index 862ef065481..3448b0a95aa 100644 --- a/source/blender/gpu/intern/gpu_matrix_private.h +++ b/source/blender/gpu/intern/gpu_matrix_private.h @@ -18,8 +18,7 @@ * \ingroup gpu */ -#ifndef __GPU_MATRIX_PRIVATE_H__ -#define __GPU_MATRIX_PRIVATE_H__ +#pragma once #ifdef __cplusplus extern "C" { @@ -31,5 +30,3 @@ void GPU_matrix_state_discard(struct GPUMatrixState *state); #ifdef __cplusplus } #endif - -#endif /* __GPU_MATRIX_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_node_graph.h b/source/blender/gpu/intern/gpu_node_graph.h index bf59b720cff..21bb139f610 100644 --- a/source/blender/gpu/intern/gpu_node_graph.h +++ b/source/blender/gpu/intern/gpu_node_graph.h @@ -23,8 +23,7 @@ * Intermediate node graph for generating GLSL shaders. */ -#ifndef __GPU_NODE_GRAPH_H__ -#define __GPU_NODE_GRAPH_H__ +#pragma once #include "DNA_customdata_types.h" #include "DNA_listBase.h" @@ -165,5 +164,3 @@ struct GPUTexture **gpu_material_ramp_texture_row_set(struct GPUMaterial *mat, float *row); struct GSet *gpu_material_used_libraries(struct GPUMaterial *material); - -#endif /* __GPU_NODE_GRAPH_H__ */ diff --git a/source/blender/gpu/intern/gpu_primitive_private.h b/source/blender/gpu/intern/gpu_primitive_private.h index abefa6abd20..b3b6bd7fc88 100644 --- a/source/blender/gpu/intern/gpu_primitive_private.h +++ b/source/blender/gpu/intern/gpu_primitive_private.h @@ -23,9 +23,6 @@ * GPU geometric primitives */ -#ifndef __GPU_PRIMITIVE_PRIVATE_H__ -#define __GPU_PRIMITIVE_PRIVATE_H__ +#pragma once GLenum convert_prim_type_to_gl(GPUPrimType); - -#endif /* __GPU_PRIMITIVE_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_private.h b/source/blender/gpu/intern/gpu_private.h index 7846bff87f4..a5caa816ef4 100644 --- a/source/blender/gpu/intern/gpu_private.h +++ b/source/blender/gpu/intern/gpu_private.h @@ -18,8 +18,7 @@ * \ingroup gpu */ -#ifndef __GPU_PRIVATE_H__ -#define __GPU_PRIVATE_H__ +#pragma once /* call this before running any of the functions below */ void gpu_platform_init(void); @@ -40,5 +39,3 @@ void gpu_framebuffer_module_exit(void); /* gpu_pbvh.c */ void gpu_pbvh_init(void); void gpu_pbvh_exit(void); - -#endif /* __GPU_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_select_private.h b/source/blender/gpu/intern/gpu_select_private.h index a0619bd4293..e364b78bff2 100644 --- a/source/blender/gpu/intern/gpu_select_private.h +++ b/source/blender/gpu/intern/gpu_select_private.h @@ -23,8 +23,7 @@ * Selection implementations. */ -#ifndef __GPU_SELECT_PRIVATE_H__ -#define __GPU_SELECT_PRIVATE_H__ +#pragma once /* gpu_select_pick */ void gpu_select_pick_begin(uint (*buffer)[4], uint bufsize, const rcti *input, char mode); @@ -43,5 +42,3 @@ bool gpu_select_query_load_id(uint id); uint gpu_select_query_end(void); #define SELECT_ID_NONE ((uint)0xffffffff) - -#endif /* __GPU_SELECT_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_shader_private.h b/source/blender/gpu/intern/gpu_shader_private.h index e4443e79a8d..e04d8655421 100644 --- a/source/blender/gpu/intern/gpu_shader_private.h +++ b/source/blender/gpu/intern/gpu_shader_private.h @@ -18,8 +18,7 @@ * \ingroup gpu */ -#ifndef __GPU_SHADER_PRIVATE_H__ -#define __GPU_SHADER_PRIVATE_H__ +#pragma once #include "GPU_glew.h" #include "GPU_shader_interface.h" @@ -46,5 +45,3 @@ struct GPUShader { /* XXX do not use it. Special hack to use OCIO with batch API. */ void immGetProgram(GLuint *program, GPUShaderInterface **shaderface); - -#endif /* __GPU_SHADER_PRIVATE_H__ */ diff --git a/source/blender/gpu/intern/gpu_vertex_format_private.h b/source/blender/gpu/intern/gpu_vertex_format_private.h index a850d17a1dd..a80c085b44a 100644 --- a/source/blender/gpu/intern/gpu_vertex_format_private.h +++ b/source/blender/gpu/intern/gpu_vertex_format_private.h @@ -23,11 +23,8 @@ * GPU vertex format */ -#ifndef __GPU_VERTEX_FORMAT_PRIVATE_H__ -#define __GPU_VERTEX_FORMAT_PRIVATE_H__ +#pragma once void VertexFormat_pack(GPUVertFormat *format); uint padding(uint offset, uint alignment); uint vertex_buffer_size(const GPUVertFormat *format, uint vertex_len); - -#endif /* __GPU_VERTEX_FORMAT_PRIVATE_H__ */ -- cgit v1.2.3