Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-10-04 01:37:25 +0300
committerHans Goudey <h.goudey@me.com>2022-10-04 01:38:16 +0300
commit97746129d5870beedc40e3c035c7982ce8a6bebc (patch)
treeb819b8e7875e6684aad7ea1f6bb7922d4fa1c8fc /source/blender/gpu/intern
parented7f5713f8f9d605e3cd4cce42e40fb5c6bf4bf5 (diff)
Cleanup: replace UNUSED macro with commented args in C++ code
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.cc2
-rw-r--r--source/blender/gpu/intern/gpu_shader_builder_stubs.cc134
-rw-r--r--source/blender/gpu/intern/gpu_texture.cc2
-rw-r--r--source/blender/gpu/intern/gpu_vertex_format.cc2
4 files changed, 68 insertions, 72 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc
index 62ec6c1b7da..5fe876fc658 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.cc
+++ b/source/blender/gpu/intern/gpu_framebuffer.cc
@@ -673,7 +673,7 @@ void GPU_offscreen_bind(GPUOffScreen *ofs, bool save)
unwrap(gpu_offscreen_fb_get(ofs))->bind(false);
}
-void GPU_offscreen_unbind(GPUOffScreen *UNUSED(ofs), bool restore)
+void GPU_offscreen_unbind(GPUOffScreen * /*ofs*/, bool restore)
{
GPUFrameBuffer *fb = nullptr;
if (restore) {
diff --git a/source/blender/gpu/intern/gpu_shader_builder_stubs.cc b/source/blender/gpu/intern/gpu_shader_builder_stubs.cc
index 28456e18354..7a06ede5c6d 100644
--- a/source/blender/gpu/intern/gpu_shader_builder_stubs.cc
+++ b/source/blender/gpu/intern/gpu_shader_builder_stubs.cc
@@ -41,7 +41,7 @@ UserDef U;
/** \name Stubs of BLI_imbuf_types.h
* \{ */
-void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
+void IMB_freeImBuf(ImBuf * /*ibuf*/)
{
BLI_assert_unreachable();
}
@@ -52,48 +52,45 @@ void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
/** \name Stubs of UI_resources.h
* \{ */
-void UI_GetThemeColor4fv(int UNUSED(colorid), float UNUSED(col[4]))
+void UI_GetThemeColor4fv(int /*colorid*/, float UNUSED(col[4]))
{
BLI_assert_unreachable();
}
-void UI_GetThemeColor3fv(int UNUSED(colorid), float UNUSED(col[3]))
+void UI_GetThemeColor3fv(int /*colorid*/, float UNUSED(col[3]))
{
BLI_assert_unreachable();
}
-void UI_GetThemeColorShade4fv(int UNUSED(colorid), int UNUSED(offset), float UNUSED(col[4]))
+void UI_GetThemeColorShade4fv(int /*colorid*/, int /*offset*/, float UNUSED(col[4]))
{
BLI_assert_unreachable();
}
-void UI_GetThemeColorShadeAlpha4fv(int UNUSED(colorid),
- int UNUSED(coloffset),
- int UNUSED(alphaoffset),
+void UI_GetThemeColorShadeAlpha4fv(int /*colorid*/,
+ int /*coloffset*/,
+ int /*alphaoffset*/,
float UNUSED(col[4]))
{
BLI_assert_unreachable();
}
-void UI_GetThemeColorBlendShade4fv(int UNUSED(colorid1),
- int UNUSED(colorid2),
- float UNUSED(fac),
- int UNUSED(offset),
- float UNUSED(col[4]))
+void UI_GetThemeColorBlendShade4fv(
+ int /*colorid1*/, int /*colorid2*/, float /*fac*/, int /*offset*/, float UNUSED(col[4]))
{
BLI_assert_unreachable();
}
-void UI_GetThemeColorBlend3ubv(int UNUSED(colorid1),
- int UNUSED(colorid2),
- float UNUSED(fac),
+void UI_GetThemeColorBlend3ubv(int /*colorid1*/,
+ int /*colorid2*/,
+ float /*fac*/,
uchar UNUSED(col[3]))
{
BLI_assert_unreachable();
}
-void UI_GetThemeColorShadeAlpha4ubv(int UNUSED(colorid),
- int UNUSED(coloffset),
- int UNUSED(alphaoffset),
+void UI_GetThemeColorShadeAlpha4ubv(int /*colorid*/,
+ int /*coloffset*/,
+ int /*alphaoffset*/,
uchar UNUSED(col[4]))
{
BLI_assert_unreachable();
@@ -105,28 +102,28 @@ void UI_GetThemeColorShadeAlpha4ubv(int UNUSED(colorid),
/** \name Stubs of BKE_attribute.h
* \{ */
-void BKE_id_attribute_copy_domains_temp(short UNUSED(id_type),
- const struct CustomData *UNUSED(vdata),
- const struct CustomData *UNUSED(edata),
- const struct CustomData *UNUSED(ldata),
- const struct CustomData *UNUSED(pdata),
- const struct CustomData *UNUSED(cdata),
- struct ID *UNUSED(r_id))
+void BKE_id_attribute_copy_domains_temp(short /*id_type*/,
+ const struct CustomData * /*vdata*/,
+ const struct CustomData * /*edata*/,
+ const struct CustomData * /*ldata*/,
+ const struct CustomData * /*pdata*/,
+ const struct CustomData * /*cdata*/,
+ struct ID * /*r_id*/)
{
}
-struct CustomDataLayer *BKE_id_attributes_active_color_get(const struct ID *UNUSED(id))
+struct CustomDataLayer *BKE_id_attributes_active_color_get(const struct ID * /*id*/)
{
return nullptr;
}
-struct CustomDataLayer *BKE_id_attributes_render_color_get(const struct ID *UNUSED(id))
+struct CustomDataLayer *BKE_id_attributes_render_color_get(const struct ID * /*id*/)
{
return nullptr;
}
-eAttrDomain BKE_id_attribute_domain(const struct ID *UNUSED(id),
- const struct CustomDataLayer *UNUSED(layer))
+eAttrDomain BKE_id_attribute_domain(const struct ID * /*id*/,
+ const struct CustomDataLayer * /*layer*/)
{
return ATTR_DOMAIN_AUTO;
}
@@ -136,23 +133,23 @@ eAttrDomain BKE_id_attribute_domain(const struct ID *UNUSED(id),
/* -------------------------------------------------------------------- */
/** \name Stubs of BKE_paint.h
* \{ */
-bool paint_is_face_hidden(const struct MLoopTri *UNUSED(lt), const bool *UNUSED(hide_poly))
+bool paint_is_face_hidden(const struct MLoopTri * /*lt*/, const bool * /*hide_poly*/)
{
BLI_assert_unreachable();
return false;
}
-void BKE_paint_face_set_overlay_color_get(const int UNUSED(face_set),
- const int UNUSED(seed),
+void BKE_paint_face_set_overlay_color_get(const int /*face_set*/,
+ const int /*seed*/,
uchar UNUSED(r_color[4]))
{
BLI_assert_unreachable();
}
-bool paint_is_grid_face_hidden(const uint *UNUSED(grid_hidden),
- int UNUSED(gridsize),
- int UNUSED(x),
- int UNUSED(y))
+bool paint_is_grid_face_hidden(const uint * /*grid_hidden*/,
+ int /*gridsize*/,
+ int /*x*/,
+ int /*y*/)
{
BLI_assert_unreachable();
return false;
@@ -163,16 +160,16 @@ bool paint_is_grid_face_hidden(const uint *UNUSED(grid_hidden),
/* -------------------------------------------------------------------- */
/** \name Stubs of BKE_mesh.h
* \{ */
-void BKE_mesh_calc_poly_normal(const struct MPoly *UNUSED(mpoly),
- const struct MLoop *UNUSED(loopstart),
- const struct MVert *UNUSED(mvarray),
+void BKE_mesh_calc_poly_normal(const struct MPoly * /*mpoly*/,
+ const struct MLoop * /*loopstart*/,
+ const struct MVert * /*mvarray*/,
float UNUSED(r_no[3]))
{
BLI_assert_unreachable();
}
-void BKE_mesh_looptri_get_real_edges(const struct Mesh *UNUSED(mesh),
- const struct MLoopTri *UNUSED(looptri),
+void BKE_mesh_looptri_get_real_edges(const struct Mesh * /*mesh*/,
+ const struct MLoopTri * /*looptri*/,
int UNUSED(r_edges[3]))
{
BLI_assert_unreachable();
@@ -195,42 +192,42 @@ void BKE_material_defaults_free_gpu()
/** \name Stubs of BKE_customdata.h
* \{ */
-int CustomData_get_offset(const struct CustomData *UNUSED(data), int UNUSED(type))
+int CustomData_get_offset(const struct CustomData * /*data*/, int /*type*/)
{
BLI_assert_unreachable();
return 0;
}
-int CustomData_get_named_layer_index(const struct CustomData *UNUSED(data),
- int UNUSED(type),
- const char *UNUSED(name))
+int CustomData_get_named_layer_index(const struct CustomData * /*data*/,
+ int /*type*/,
+ const char * /*name*/)
{
return -1;
}
-int CustomData_get_active_layer_index(const struct CustomData *UNUSED(data), int UNUSED(type))
+int CustomData_get_active_layer_index(const struct CustomData * /*data*/, int /*type*/)
{
return -1;
}
-int CustomData_get_render_layer_index(const struct CustomData *UNUSED(data), int UNUSED(type))
+int CustomData_get_render_layer_index(const struct CustomData * /*data*/, int /*type*/)
{
return -1;
}
-bool CustomData_has_layer(const struct CustomData *UNUSED(data), int UNUSED(type))
+bool CustomData_has_layer(const struct CustomData * /*data*/, int /*type*/)
{
return false;
}
-void *CustomData_get_layer_named(const struct CustomData *UNUSED(data),
- int UNUSED(type),
- const char *UNUSED(name))
+void *CustomData_get_layer_named(const struct CustomData * /*data*/,
+ int /*type*/,
+ const char * /*name*/)
{
return nullptr;
}
-void *CustomData_get_layer(const struct CustomData *UNUSED(data), int UNUSED(type))
+void *CustomData_get_layer(const struct CustomData * /*data*/, int /*type*/)
{
return nullptr;
}
@@ -241,10 +238,10 @@ void *CustomData_get_layer(const struct CustomData *UNUSED(data), int UNUSED(typ
/** \name Stubs of BKE_pbvh.h
* \{ */
-int BKE_pbvh_count_grid_quads(BLI_bitmap **UNUSED(grid_hidden),
- const int *UNUSED(grid_indices),
- int UNUSED(totgrid),
- int UNUSED(gridsize))
+int BKE_pbvh_count_grid_quads(BLI_bitmap ** /*grid_hidden*/,
+ const int * /*grid_indices*/,
+ int /*totgrid*/,
+ int /*gridsize*/)
{
BLI_assert_unreachable();
return 0;
@@ -255,8 +252,7 @@ int BKE_pbvh_count_grid_quads(BLI_bitmap **UNUSED(grid_hidden),
/* -------------------------------------------------------------------- */
/** \name Stubs of BKE_subdiv_ccg.h
* \{ */
-int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG *UNUSED(subdiv_ccg),
- const int UNUSED(grid_index))
+int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG * /*subdiv_ccg*/, const int /*grid_index*/)
{
BLI_assert_unreachable();
return 0;
@@ -267,18 +263,18 @@ int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG *UNUSED(subdiv_ccg),
/* -------------------------------------------------------------------- */
/** \name Stubs of BKE_node.h
* \{ */
-void ntreeGPUMaterialNodes(struct bNodeTree *UNUSED(localtree), struct GPUMaterial *UNUSED(mat))
+void ntreeGPUMaterialNodes(struct bNodeTree * /*localtree*/, struct GPUMaterial * /*mat*/)
{
BLI_assert_unreachable();
}
-struct bNodeTree *ntreeLocalize(struct bNodeTree *UNUSED(ntree))
+struct bNodeTree *ntreeLocalize(struct bNodeTree * /*ntree*/)
{
BLI_assert_unreachable();
return nullptr;
}
-void ntreeFreeLocalTree(struct bNodeTree *UNUSED(ntree))
+void ntreeFreeLocalTree(struct bNodeTree * /*ntree*/)
{
BLI_assert_unreachable();
}
@@ -288,7 +284,7 @@ void ntreeFreeLocalTree(struct bNodeTree *UNUSED(ntree))
/* -------------------------------------------------------------------- */
/** \name Stubs of bmesh.h
* \{ */
-void BM_face_as_array_vert_tri(BMFace *UNUSED(f), BMVert *UNUSED(r_verts[3]))
+void BM_face_as_array_vert_tri(BMFace * /*f*/, BMVert *UNUSED(r_verts[3]))
{
BLI_assert_unreachable();
}
@@ -297,17 +293,17 @@ void BM_face_as_array_vert_tri(BMFace *UNUSED(f), BMVert *UNUSED(r_verts[3]))
/* -------------------------------------------------------------------- */
/** \name Stubs of DRW_engine.h
* \{ */
-void DRW_deferred_shader_remove(struct GPUMaterial *UNUSED(mat))
+void DRW_deferred_shader_remove(struct GPUMaterial * /*mat*/)
{
BLI_assert_unreachable();
}
-void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat *UNUSED(format),
- const char *UNUSED(base_name),
- const struct CustomData *UNUSED(data),
- const struct CustomDataLayer *UNUSED(cl),
- bool UNUSED(is_active_render),
- bool UNUSED(is_active_layer))
+void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat * /*format*/,
+ const char * /*base_name*/,
+ const struct CustomData * /*data*/,
+ const struct CustomDataLayer * /*cl*/,
+ bool /*is_active_render*/,
+ bool /*is_active_layer*/)
{
}
diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc
index a0ee518e747..cd1f8bf582c 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -482,7 +482,7 @@ void GPU_unpack_row_length_set(uint len)
void GPU_texture_bind_ex(GPUTexture *tex_,
eGPUSamplerState state,
int unit,
- const bool UNUSED(set_number))
+ const bool /*set_number*/)
{
Texture *tex = reinterpret_cast<Texture *>(tex_);
state = (state >= GPU_SAMPLER_MAX) ? tex->sampler_state : state;
diff --git a/source/blender/gpu/intern/gpu_vertex_format.cc b/source/blender/gpu/intern/gpu_vertex_format.cc
index 897e80293bf..b30e3c358c8 100644
--- a/source/blender/gpu/intern/gpu_vertex_format.cc
+++ b/source/blender/gpu/intern/gpu_vertex_format.cc
@@ -251,7 +251,7 @@ static void safe_bytes(char out[11], const char data[8])
}
}
-void GPU_vertformat_safe_attr_name(const char *attr_name, char *r_safe_name, uint UNUSED(max_len))
+void GPU_vertformat_safe_attr_name(const char *attr_name, char *r_safe_name, uint /*max_len*/)
{
char data[8] = {0};
uint len = strlen(attr_name);