[Bf-blender-cvs] [c93f8266613] master: Cleanup: various clang tidy fixes
Jacques Lucke
noreply at git.blender.org
Wed Dec 9 16:29:45 CET 2020
Commit: c93f826661334926fc15504243f61c85242bec42
Author: Jacques Lucke
Date: Wed Dec 9 16:29:11 2020 +0100
Branches: master
https://developer.blender.org/rBc93f826661334926fc15504243f61c85242bec42
Cleanup: various clang tidy fixes
===================================================================
M source/blender/blenkernel/intern/mesh_validate.cc
M source/blender/blenlib/intern/task_pool.cc
M source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
M source/blender/compositor/intern/COM_OpenCLDevice.cpp
M source/blender/compositor/operations/COM_DilateErodeOperation.cpp
M source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
M source/blender/compositor/operations/COM_VectorBlurOperation.cpp
M source/blender/depsgraph/intern/depsgraph_query_foreach.cc
M source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M source/blender/editors/space_outliner/tree/tree_display_data.cc
M source/blender/editors/space_outliner/tree/tree_display_orphaned.cc
M source/blender/editors/space_outliner/tree/tree_display_scenes.cc
M source/blender/editors/space_outliner/tree/tree_display_sequencer.cc
M source/blender/editors/space_outliner/tree/tree_element.h
M source/blender/freestyle/intern/application/Controller.cpp
M source/blender/freestyle/intern/geometry/FitCurve.cpp
M source/blender/freestyle/intern/geometry/GeomCleaner.cpp
M source/blender/gpu/opengl/gl_debug_layer.cc
M source/blender/ikplugin/intern/itasc_plugin.cpp
M source/blender/imbuf/intern/dds/FlipDXT.cpp
M source/blender/imbuf/intern/oiio/openimageio_api.cpp
M source/blender/imbuf/intern/openexr/openexr_api.cpp
M source/blender/io/collada/collada_internal.cpp
M source/blender/simulation/intern/hair_volume.cpp
===================================================================
diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc
index 16733729be0..0aaca33124a 100644
--- a/source/blender/blenkernel/intern/mesh_validate.cc
+++ b/source/blender/blenkernel/intern/mesh_validate.cc
@@ -76,10 +76,10 @@ struct OrderedEdge {
};
/* The map first contains an edge pointer and later an index. */
-typedef union OrigEdgeOrIndex {
+union OrigEdgeOrIndex {
const MEdge *original_edge;
int index;
-} OrigEdgeOrIndex;
+};
using EdgeMap = Map<OrderedEdge, OrigEdgeOrIndex>;
static void reserve_hash_maps(const Mesh *mesh,
diff --git a/source/blender/blenlib/intern/task_pool.cc b/source/blender/blenlib/intern/task_pool.cc
index 142496dce20..dfed24da2d9 100644
--- a/source/blender/blenlib/intern/task_pool.cc
+++ b/source/blender/blenlib/intern/task_pool.cc
@@ -149,13 +149,13 @@ class TBBTaskGroup : public tbb::task_group {
/* Task Pool */
-typedef enum TaskPoolType {
+enum TaskPoolType {
TASK_POOL_TBB,
TASK_POOL_TBB_SUSPENDED,
TASK_POOL_NO_THREADS,
TASK_POOL_BACKGROUND,
TASK_POOL_BACKGROUND_SERIAL,
-} TaskPoolType;
+};
struct TaskPool {
TaskPoolType type;
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
index 43928f6f915..35a3314db3b 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
@@ -304,7 +304,7 @@ void NodeOperationBuilder::add_operation_input_constants()
/* Note: unconnected inputs cached first to avoid modifying
* m_operations while iterating over it
*/
- typedef std::vector<NodeOperationInput *> Inputs;
+ using Inputs = std::vector<NodeOperationInput *>;
Inputs pending_inputs;
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
NodeOperation *op = *it;
diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cpp b/source/blender/compositor/intern/COM_OpenCLDevice.cpp
index 51ae9d6652e..acfe800e433 100644
--- a/source/blender/compositor/intern/COM_OpenCLDevice.cpp
+++ b/source/blender/compositor/intern/COM_OpenCLDevice.cpp
@@ -19,7 +19,7 @@
#include "COM_OpenCLDevice.h"
#include "COM_WorkScheduler.h"
-typedef enum COM_VendorID { NVIDIA = 0x10DE, AMD = 0x1002 } COM_VendorID;
+enum COM_VendorID { NVIDIA = 0x10DE, AMD = 0x1002 };
const cl_image_format IMAGE_FORMAT_COLOR = {
CL_RGBA,
CL_FLOAT,
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
index 74f5fceacfb..b2dfb558028 100644
--- a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
+++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
@@ -330,11 +330,11 @@ void DilateStepOperation::initExecution()
}
// small helper to pass data from initializeTileData to executePixel
-typedef struct tile_info {
+struct tile_info {
rcti rect;
int width;
float *buffer;
-} tile_info;
+};
static tile_info *create_cache(int xmin, int xmax, int ymin, int ymax)
{
diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
index acc1dddacdd..362905761bb 100644
--- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
+++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
@@ -23,7 +23,7 @@
* 2D Fast Hartley Transform, used for convolution
*/
-typedef float fREAL;
+using fREAL = float;
// returns next highest power of 2 of x, as well its log2 in L2
static unsigned int nextPow2(unsigned int x, unsigned int *L2)
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
index 6254f93472e..f7b908deaf4 100644
--- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
@@ -141,7 +141,7 @@ void VectorBlurOperation::generateVectorBlur(float *data,
/* ****************** Spans ******************************* */
/* span fill in method, is also used to localize data for zbuffering */
-typedef struct ZSpan {
+struct ZSpan {
/* range for clipping */
int rectx, recty;
@@ -157,8 +157,7 @@ typedef struct ZSpan {
int *rectz;
DrawBufPixel *rectdraw;
float clipcrop;
-
-} ZSpan;
+};
/* each zbuffer has coordinates transformed to local rect coordinates, so we can simply clip */
void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty, float clipcrop)
diff --git a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc
index 1c050edc386..6ce7cc0837b 100644
--- a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc
@@ -47,7 +47,7 @@ namespace deg = blender::deg;
namespace blender::deg {
namespace {
-typedef deque<OperationNode *> TraversalQueue;
+using TraversalQueue = deque<OperationNode *>;
using DEGForeachOperation = void (*)(OperationNode *, void *);
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index fa7cfb305ee..1b24e2b7ad2 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -82,7 +82,7 @@ enum {
COMPONENT_STATE_DONE = 2,
};
-typedef deque<OperationNode *> FlushQueue;
+using FlushQueue = deque<OperationNode *>;
namespace {
diff --git a/source/blender/editors/space_outliner/tree/tree_display_data.cc b/source/blender/editors/space_outliner/tree/tree_display_data.cc
index 41ca4f72903..8a5c2e7d9f3 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_data.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_data.cc
@@ -41,7 +41,7 @@ ListBase TreeDisplayDataAPI::buildTree(const TreeSourceData &source_data)
RNA_main_pointer_create(source_data.bmain, &mainptr);
TreeElement *te = outliner_add_element(
- &space_outliner_, &tree, (void *)&mainptr, NULL, TSE_RNA_STRUCT, -1);
+ &space_outliner_, &tree, (void *)&mainptr, nullptr, TSE_RNA_STRUCT, -1);
/* On first view open parent data elements */
const int show_opened = !space_outliner_.treestore ||
diff --git a/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc b/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc
index 71c1d344057..0b17ea98831 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_orphaned.cc
@@ -68,7 +68,7 @@ ListBase TreeDisplayIDOrphans::buildTree(const TreeSourceData &source_data)
TreeElement *te = nullptr;
if (!filter_id_type) {
ID *id = (ID *)lbarray[a]->first;
- te = outliner_add_element(&space_outliner_, &tree, lbarray[a], NULL, TSE_ID_BASE, 0);
+ te = outliner_add_element(&space_outliner_, &tree, lbarray[a], nullptr, TSE_ID_BASE, 0);
te->directdata = lbarray[a];
te->name = outliner_idcode_to_plural(GS(id->name));
}
diff --git a/source/blender/editors/space_outliner/tree/tree_display_scenes.cc b/source/blender/editors/space_outliner/tree/tree_display_scenes.cc
index c4a5688504d..f377512d81e 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_scenes.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_scenes.cc
@@ -46,7 +46,7 @@ ListBase TreeDisplayScenes::buildTree(const TreeSourceData &source_data)
for (ID *id : List<ID>(source_data.bmain->scenes)) {
Scene *scene = reinterpret_cast<Scene *>(id);
- TreeElement *te = outliner_add_element(&space_outliner_, &tree, scene, NULL, 0, 0);
+ TreeElement *te = outliner_add_element(&space_outliner_, &tree, scene, nullptr, 0, 0);
TreeStoreElem *tselem = TREESTORE(te);
/* New scene elements open by default */
@@ -60,4 +60,4 @@ ListBase TreeDisplayScenes::buildTree(const TreeSourceData &source_data)
return tree;
}
-} // namespace blender::ed::outliner
\ No newline at end of file
+} // namespace blender::ed::outliner
diff --git a/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc b/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc
index 486f735be9f..48f0322ccb9 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_sequencer.cc
@@ -18,7 +18,7 @@
* \ingroup spoutliner
*/
-#include <string.h>
+#include <cstring>
#include "BLI_listbase.h"
#include "BLI_listbase_wrapper.hh"
@@ -51,11 +51,11 @@ ListBase TreeDisplaySequencer::buildTree(const TreeSourceData &source_data)
for (Sequence *seq : List<Sequence>(ed->seqbasep)) {
SequenceAddOp op = need_add_seq_dup(seq);
if (op == SEQUENCE_DUPLICATE_NONE) {
- outliner_add_element(&space_outliner_, &tree, seq, NULL, TSE_SEQUENCE, 0);
+ outliner_add_element(&space_outliner_, &tree, seq, nullptr, TSE_SEQUENCE, 0);
}
else if (op == SEQUENCE_DUPLICATE_ADD) {
TreeElement *te = outliner_add_element(
- &space_outliner_, &tree, seq, NULL, TSE_SEQUENCE_DUP, 0);
+ &space_outliner_, &tree, seq, nullptr, TSE_SEQUENCE_DUP, 0);
add_seq_dup(seq, te, 0);
}
}
diff --git a/source/blender/editors/space_outliner/tree/tree_element.h b/source/blender/editors/space_outliner/tree/tree_element.h
index 9012321a323..d88c37180b3 100644
--- a/source/blender/editors/space_outliner/tree/tree_element.h
+++ b/source/blender/editors/space_outliner/tree/tree_element.h
@@ -36,7 +36,7 @@ extern "C" {
typedef struct TreeElementType TreeElementType;
TreeElementType *outliner_tree_element_type_create(int type, TreeElement *legacy_te, void *idv);
-void outliner_tree_element_type_free(TreeElementType **element);
+void outliner_tree_element_type_free(TreeElementType **type);
void outliner_tree_element_type_expand(TreeElementType *type, SpaceOutliner *space_outliner);
diff --git a/source/blender/freestyle
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list