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-01-14 02:11:38 +0300
committerHans Goudey <h.goudey@me.com>2022-01-14 02:11:38 +0300
commit1bd0a87384011b739d1f4f06e0933d7d094732ac (patch)
tree1324bc0b06004977e92d334e7aea8a139afb39ff /source/blender/editors/space_outliner
parent8b3d798374a2c6b5026791e8ef5ce4fe6494f801 (diff)
Cleanup: Clang tidy
- modernize-deprecated-headers - modernize-use-using - modernize-use-nullptr - modernize-use-bool-literals
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.cc2
-rw-r--r--source/blender/editors/space_outliner/outliner_dragdrop.cc16
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.cc16
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.cc12
-rw-r--r--source/blender/editors/space_outliner/outliner_select.cc4
-rw-r--r--source/blender/editors/space_outliner/outliner_sync.cc14
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.cc40
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.cc12
-rw-r--r--source/blender/editors/space_outliner/outliner_utils.cc2
-rw-r--r--source/blender/editors/space_outliner/space_outliner.cc4
10 files changed, 61 insertions, 61 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc
index e4c4d41a04b..8d60a6088d3 100644
--- a/source/blender/editors/space_outliner/outliner_collections.cc
+++ b/source/blender/editors/space_outliner/outliner_collections.cc
@@ -18,7 +18,7 @@
* \ingroup spoutliner
*/
-#include <string.h>
+#include <cstring>
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.cc b/source/blender/editors/space_outliner/outliner_dragdrop.cc
index 30f1ef911e4..3745894d630 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.cc
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.cc
@@ -21,7 +21,7 @@
* \ingroup spoutliner
*/
-#include <string.h>
+#include <cstring>
#include "MEM_guardedalloc.h"
@@ -187,7 +187,7 @@ static TreeElement *outliner_drop_insert_find(bContext *C,
return nullptr;
}
-typedef bool (*CheckTypeFn)(TreeElement *te);
+using CheckTypeFn = bool (*)(TreeElement *te);
static TreeElement *outliner_data_from_tree_element_and_parents(CheckTypeFn check_type,
TreeElement *te)
@@ -662,13 +662,13 @@ void OUTLINER_OT_material_drop(wmOperatorType *ot)
* - Copying a single modifier/constraint/effect to another object.
* - Copying (linking) an object's modifiers/constraints/effects to another. */
-typedef enum eDataStackDropAction {
+enum eDataStackDropAction {
DATA_STACK_DROP_REORDER,
DATA_STACK_DROP_COPY,
DATA_STACK_DROP_LINK,
-} eDataStackDropAction;
+};
-typedef struct StackDropData {
+struct StackDropData {
Object *ob_parent;
bPoseChannel *pchan_parent;
TreeStoreElem *drag_tselem;
@@ -678,7 +678,7 @@ typedef struct StackDropData {
eDataStackDropAction drop_action;
TreeElement *drop_te;
TreeElementInsertType insert_type;
-} StackDropData;
+};
static void datastack_drop_data_init(wmDrag *drag,
Object *ob,
@@ -1082,13 +1082,13 @@ void OUTLINER_OT_datastack_drop(wmOperatorType *ot)
/* ******************** Collection Drop Operator *********************** */
-typedef struct CollectionDrop {
+struct CollectionDrop {
Collection *from;
Collection *to;
TreeElement *te;
TreeElementInsertType insert_type;
-} CollectionDrop;
+};
static Collection *collection_parent_from_ID(ID *id)
{
diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc
index 3d29f1762ec..e7f35b856c0 100644
--- a/source/blender/editors/space_outliner/outliner_draw.cc
+++ b/source/blender/editors/space_outliner/outliner_draw.cc
@@ -869,7 +869,7 @@ static void namebutton_fn(bContext *C, void *tsep, char *oldname)
}
}
-typedef struct RestrictProperties {
+struct RestrictProperties {
bool initialized;
PropertyRNA *object_hide_viewport, *object_hide_select, *object_hide_render;
@@ -880,11 +880,11 @@ typedef struct RestrictProperties {
PropertyRNA *modifier_show_viewport, *modifier_show_render;
PropertyRNA *constraint_enable;
PropertyRNA *bone_hide_viewport;
-} RestrictProperties;
+};
/* We don't care about the value of the property
* but whether the property should be active or grayed out. */
-typedef struct RestrictPropertiesActive {
+struct RestrictPropertiesActive {
bool object_hide_viewport;
bool object_hide_select;
bool object_hide_render;
@@ -900,7 +900,7 @@ typedef struct RestrictPropertiesActive {
bool modifier_show_render;
bool constraint_enable;
bool bone_hide_viewport;
-} RestrictPropertiesActive;
+};
static void outliner_restrict_properties_enable_collection_set(
PointerRNA *collection_ptr, RestrictProperties *props, RestrictPropertiesActive *props_active)
@@ -1995,13 +1995,13 @@ static void outliner_buttons(const bContext *C,
/* If we add support to rename Sequence, need change this. */
if (tselem->type == TSE_EBONE) {
- len = sizeof(((EditBone *)0)->name);
+ len = sizeof(((EditBone *)nullptr)->name);
}
else if (tselem->type == TSE_MODIFIER) {
- len = sizeof(((ModifierData *)0)->name);
+ len = sizeof(((ModifierData *)nullptr)->name);
}
else if (tselem->id && GS(tselem->id->name) == ID_LI) {
- len = sizeof(((Library *)0)->filepath);
+ len = sizeof(((Library *)nullptr)->filepath);
}
else {
len = MAX_ID_NAME - 2;
@@ -2234,7 +2234,7 @@ static void outliner_draw_warning_column(const bContext *C,
TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
{
- TreeElementIcon data = {0};
+ TreeElementIcon data = {nullptr};
if (tselem->type != TSE_SOME_ID) {
switch (tselem->type) {
diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc
index c80431584a2..9a4ef1c5d2e 100644
--- a/source/blender/editors/space_outliner/outliner_edit.cc
+++ b/source/blender/editors/space_outliner/outliner_edit.cc
@@ -21,7 +21,7 @@
* \ingroup spoutliner
*/
-#include <string.h>
+#include <cstring>
#include "MEM_guardedalloc.h"
@@ -183,11 +183,11 @@ void outliner_item_openclose(SpaceOutliner *space_outliner,
}
}
-typedef struct OpenCloseData {
+struct OpenCloseData {
TreeStoreElem *prev_tselem;
bool open;
int x_location;
-} OpenCloseData;
+};
static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
@@ -1389,7 +1389,7 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot)
ot->poll = ED_operator_outliner_active;
/* properties */
- prop = RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page");
+ prop = RNA_def_boolean(ot->srna, "up", false, "Up", "Scroll up one page");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
@@ -1586,7 +1586,7 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot)
/* no undo or registry, UI option */
/* properties */
- prop = RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep");
+ prop = RNA_def_boolean(ot->srna, "open", true, "Open", "Expand all entries one level deep");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
@@ -1698,7 +1698,7 @@ static bool ed_operator_outliner_datablocks_active(bContext *C)
SpaceOutliner *space_outliner = CTX_wm_space_outliner(C);
return (space_outliner->outlinevis == SO_DATA_API);
}
- return 0;
+ return false;
}
/* Helper func to extract an RNA path from selected tree element
diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc
index 636c6a389d5..887890090db 100644
--- a/source/blender/editors/space_outliner/outliner_select.cc
+++ b/source/blender/editors/space_outliner/outliner_select.cc
@@ -21,7 +21,7 @@
* \ingroup spoutliner
*/
-#include <stdlib.h>
+#include <cstdlib>
#include "MEM_guardedalloc.h"
@@ -1165,7 +1165,7 @@ static void outliner_sync_to_properties_editors(const bContext *C,
static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreElem *tselem)
{
- PointerRNA ptr = {0};
+ PointerRNA ptr = {nullptr};
int context = 0;
/* ID Types */
diff --git a/source/blender/editors/space_outliner/outliner_sync.cc b/source/blender/editors/space_outliner/outliner_sync.cc
index b312a262253..20806ff0a10 100644
--- a/source/blender/editors/space_outliner/outliner_sync.cc
+++ b/source/blender/editors/space_outliner/outliner_sync.cc
@@ -21,7 +21,7 @@
* \ingroup spoutliner
*/
-#include <stdio.h>
+#include <cstdio>
#include "DNA_armature_types.h"
#include "DNA_layer_types.h"
@@ -115,12 +115,12 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C)
* outliner display mode also needs to be considered. This stores the types of data
* to sync to increase code clarity.
*/
-typedef struct SyncSelectTypes {
+struct SyncSelectTypes {
bool object;
bool edit_bone;
bool pose_bone;
bool sequence;
-} SyncSelectTypes;
+};
/**
* Set which types of data to sync when syncing selection from the outliner based on object
@@ -174,11 +174,11 @@ static bool outliner_sync_select_to_outliner_set_types(const bContext *C,
* Stores items selected from a sync from the outliner. Prevents syncing the selection
* state of the last instance of an object linked in multiple collections.
*/
-typedef struct SelectedItems {
+struct SelectedItems {
GSet *objects;
GSet *edit_bones;
GSet *pose_bones;
-} SelectedItems;
+};
static void selected_items_init(SelectedItems *selected_items)
{
@@ -487,12 +487,12 @@ static void outliner_select_sync_from_sequence(Sequence *sequence_active, TreeSt
* Contains active object, bones, and sequence for syncing to prevent getting active data
* repeatedly throughout syncing to the outliner.
*/
-typedef struct SyncSelectActiveData {
+struct SyncSelectActiveData {
Object *object;
EditBone *edit_bone;
bPoseChannel *pose_channel;
Sequence *sequence;
-} SyncSelectActiveData;
+};
/** Sync select and active flags from active view layer, bones, and sequences to the outliner. */
static void outliner_sync_selection_to_outliner(ViewLayer *view_layer,
diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc
index 89d35f54e8c..1c1a4f6f4c2 100644
--- a/source/blender/editors/space_outliner/outliner_tools.cc
+++ b/source/blender/editors/space_outliner/outliner_tools.cc
@@ -437,9 +437,9 @@ static void outliner_do_libdata_operation(bContext *C,
/** \name Scene Menu Operator
* \{ */
-typedef enum eOutliner_PropSceneOps {
+enum eOutliner_PropSceneOps {
OL_SCENE_OP_DELETE = 1,
-} eOutliner_PropSceneOps;
+};
static const EnumPropertyItem prop_scene_op_types[] = {
{OL_SCENE_OP_DELETE, "DELETE", ICON_X, "Delete", ""},
@@ -534,10 +534,10 @@ void OUTLINER_OT_scene_operation(wmOperatorType *ot)
* the merged select popup menu. The sub-tree of the parent is searched and
* the child is needed to only show elements of the same type in the popup.
*/
-typedef struct MergedSearchData {
+struct MergedSearchData {
TreeElement *parent_element;
TreeElement *select_element;
-} MergedSearchData;
+};
static void merged_element_search_fn_recursive(
const ListBase *tree, short tselem_type, short type, const char *str, uiSearchItems *items)
@@ -792,14 +792,14 @@ static void object_proxy_to_override_convert_fn(bContext *C,
WM_event_add_notifier(C, NC_WINDOW, nullptr);
}
-typedef struct OutlinerLibOverrideData {
+struct OutlinerLibOverrideData {
bool do_hierarchy;
/**
* For resync operation, force keeping newly created override IDs (or original linked IDs)
* instead of re-applying relevant existing ID pointer property override operations. Helps
* solving broken overrides while not losing *all* of your overrides. */
bool do_resync_hierarchy_enforce;
-} OutlinerLibOverrideData;
+};
static void id_override_library_create_fn(bContext *C,
ReportList *reports,
@@ -1206,25 +1206,25 @@ static void refreshdrivers_animdata_fn(int UNUSED(event),
/** \name Object Operation Utilities
* \{ */
-typedef enum eOutliner_PropDataOps {
+enum eOutliner_PropDataOps {
OL_DOP_SELECT = 1,
OL_DOP_DESELECT,
OL_DOP_HIDE,
OL_DOP_UNHIDE,
OL_DOP_SELECT_LINKED,
-} eOutliner_PropDataOps;
+};
-typedef enum eOutliner_PropConstraintOps {
+enum eOutliner_PropConstraintOps {
OL_CONSTRAINTOP_ENABLE = 1,
OL_CONSTRAINTOP_DISABLE,
OL_CONSTRAINTOP_DELETE,
-} eOutliner_PropConstraintOps;
+};
-typedef enum eOutliner_PropModifierOps {
+enum eOutliner_PropModifierOps {
OL_MODIFIER_OP_TOGVIS = 1,
OL_MODIFIER_OP_TOGREN,
OL_MODIFIER_OP_DELETE,
-} eOutliner_PropModifierOps;
+};
static void pchan_fn(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *UNUSED(arg))
{
@@ -1651,13 +1651,13 @@ void OUTLINER_OT_object_operation(wmOperatorType *ot)
/** \name Delete Object/Collection Operator
* \{ */
-typedef void (*OutlinerDeleteFunc)(bContext *C, ReportList *reports, Scene *scene, Object *ob);
+using OutlinerDeleteFn = void (*)(bContext *C, ReportList *reports, Scene *scene, Object *ob);
static void outliner_do_object_delete(bContext *C,
ReportList *reports,
Scene *scene,
GSet *objects_to_delete,
- OutlinerDeleteFunc delete_fn)
+ OutlinerDeleteFn delete_fn)
{
GSetIterator objects_to_delete_iter;
GSET_ITER (objects_to_delete_iter, objects_to_delete) {
@@ -1775,7 +1775,7 @@ void OUTLINER_OT_delete(wmOperatorType *ot)
/** \name ID-Data Menu Operator
* \{ */
-typedef enum eOutlinerIdOpTypes {
+enum eOutlinerIdOpTypes {
OUTLINER_IDOP_INVALID = 0,
OUTLINER_IDOP_UNLINK,
@@ -1800,7 +1800,7 @@ typedef enum eOutlinerIdOpTypes {
OUTLINER_IDOP_RENAME,
OUTLINER_IDOP_SELECT_LINKED,
-} eOutlinerIdOpTypes;
+};
/* TODO: implement support for changing the ID-block used. */
static const EnumPropertyItem prop_id_op_types[] = {
@@ -2315,14 +2315,14 @@ void OUTLINER_OT_id_operation(wmOperatorType *ot)
/** \name Library Menu Operator
* \{ */
-typedef enum eOutlinerLibOpTypes {
+enum eOutlinerLibOpTypes {
OL_LIB_INVALID = 0,
OL_LIB_RENAME,
OL_LIB_DELETE,
OL_LIB_RELOCATE,
OL_LIB_RELOAD,
-} eOutlinerLibOpTypes;
+};
static const EnumPropertyItem outliner_lib_op_type_items[] = {
{OL_LIB_RENAME, "RENAME", 0, "Rename", ""},
@@ -2543,7 +2543,7 @@ void OUTLINER_OT_action_set(wmOperatorType *ot)
/** \name Animation Menu Operator
* \{ */
-typedef enum eOutliner_AnimDataOps {
+enum eOutliner_AnimDataOps {
OUTLINER_ANIMOP_INVALID = 0,
OUTLINER_ANIMOP_CLEAR_ADT,
@@ -2553,7 +2553,7 @@ typedef enum eOutliner_AnimDataOps {
OUTLINER_ANIMOP_REFRESH_DRV,
OUTLINER_ANIMOP_CLEAR_DRV
-} eOutliner_AnimDataOps;
+};
static const EnumPropertyItem prop_animdata_op_types[] = {
{OUTLINER_ANIMOP_CLEAR_ADT,
diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc
index 92da192c2d3..18ed849dd26 100644
--- a/source/blender/editors/space_outliner/outliner_tree.cc
+++ b/source/blender/editors/space_outliner/outliner_tree.cc
@@ -21,8 +21,8 @@
* \ingroup spoutliner
*/
-#include <math.h>
-#include <string.h>
+#include <cmath>
+#include <cstring>
#include "MEM_guardedalloc.h"
@@ -1226,12 +1226,12 @@ void outliner_make_object_parent_hierarchy(ListBase *lb)
/* Sorting ------------------------------------------------------ */
-typedef struct tTreeSort {
+struct tTreeSort {
TreeElement *te;
ID *id;
const char *name;
short idcode;
-} tTreeSort;
+};
/* alphabetical comparator, trying to put objects first */
static int treesort_alpha_ob(const void *v1, const void *v2)
@@ -1458,10 +1458,10 @@ static void outliner_collections_children_sort(ListBase *lb)
/* Filtering ----------------------------------------------- */
-typedef struct OutlinerTreeElementFocus {
+struct OutlinerTreeElementFocus {
TreeStoreElem *tselem;
int ys;
-} OutlinerTreeElementFocus;
+};
/**
* Bring the outliner scrolling back to where it was in relation to the original focus element
diff --git a/source/blender/editors/space_outliner/outliner_utils.cc b/source/blender/editors/space_outliner/outliner_utils.cc
index b7773b520e4..a097e86e2fa 100644
--- a/source/blender/editors/space_outliner/outliner_utils.cc
+++ b/source/blender/editors/space_outliner/outliner_utils.cc
@@ -21,7 +21,7 @@
* \ingroup spoutliner
*/
-#include <string.h>
+#include <cstring>
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc
index d3a78425242..44f16194c8f 100644
--- a/source/blender/editors/space_outliner/space_outliner.cc
+++ b/source/blender/editors/space_outliner/space_outliner.cc
@@ -21,8 +21,8 @@
* \ingroup spoutliner
*/
-#include <stdio.h>
-#include <string.h>
+#include <cstdio>
+#include <cstring>
#include "MEM_guardedalloc.h"