diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-29 03:37:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-29 03:37:00 +0300 |
commit | 60a2038fbaaf78b3019e6375e28904f2a124e78d (patch) | |
tree | ef6502dfa2c1f685671d65c26b26084f1facd7ee /source | |
parent | 515d9f9a355b98c6c4af7d8d0b5ada169e4bdd0f (diff) |
Cleanup: clang-tidy
Diffstat (limited to 'source')
7 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index f3d43aaa44f..595e470876d 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -646,8 +646,8 @@ static void lib_override_linked_group_tag(LibOverrideGroupTagData *data) instantiating_collection->id.lib->temp_index < id_root->lib->temp_index)) { break; } - else if (ID_IS_LINKED(instantiating_collection) && - (!is_resync || instantiating_collection->id.lib == id_root->lib)) { + if (ID_IS_LINKED(instantiating_collection) && + (!is_resync || instantiating_collection->id.lib == id_root->lib)) { instantiating_collection_override_candidate = instantiating_collection; } } diff --git a/source/blender/blenlib/tests/BLI_string_utf8_test.cc b/source/blender/blenlib/tests/BLI_string_utf8_test.cc index 2796cbbfbda..9ddc372e6d1 100644 --- a/source/blender/blenlib/tests/BLI_string_utf8_test.cc +++ b/source/blender/blenlib/tests/BLI_string_utf8_test.cc @@ -92,12 +92,12 @@ static const char *utf8_invalid_tests[][3] = { "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f" "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf" "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\" |", - "3.1.9 \"\" |", "\x40"}, + "3.1.9 \"\" |", "\x40"}, /* NOLINT: modernize-raw-string-literal. */ /* 3.2 Lonely start characters * 3.2.1 All 32 first bytes of 2-byte sequences (0xc0-0xdf), each followed by a space character: */ {"3.2.1 \"\xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf " "\xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \" |", - "3.2.1 \" \" |", "\x20"}, + "3.2.1 \" \" |", "\x20"}, /* NOLINT: modernize-raw-string-literal. */ /* 3.2.2 All 16 first bytes of 3-byte sequences (0xe0-0xef), each followed by a space character: */ {"3.2.2 \"\xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \" |", "3.2.2 \" \" |", "\x10"}, diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.cc b/source/blender/blenloader/tests/blendfile_loading_base_test.cc index e93348b2158..8afa631ffc5 100644 --- a/source/blender/blenloader/tests/blendfile_loading_base_test.cc +++ b/source/blender/blenloader/tests/blendfile_loading_base_test.cc @@ -123,7 +123,7 @@ bool BlendfileLoadingBaseTest::blendfile_load(const char *filepath) char abspath[FILENAME_MAX]; BLI_path_join(abspath, sizeof(abspath), test_assets_dir.c_str(), filepath, NULL); - BlendFileReadReport bf_reports = {NULL}; + BlendFileReadReport bf_reports = {nullptr}; bfile = BLO_read_from_file(abspath, BLO_READ_SKIP_NONE, &bf_reports); if (bfile == nullptr) { ADD_FAILURE() << "Unable to load file '" << filepath << "' from test assets dir '" diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 9e5e1a33564..d2204c17e62 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2108,7 +2108,8 @@ int ui_but_is_pushed_ex(uiBut *but, double *value) if (but->pushed_state_func) { return but->pushed_state_func(but, but->pushed_state_arg); } - else if (but->bit) { + + if (but->bit) { const bool state = !ELEM( but->type, UI_BTYPE_TOGGLE_N, UI_BTYPE_ICON_TOGGLE_N, UI_BTYPE_CHECKBOX_N); int lvalue; diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc index f8654500044..07517f9e60f 100644 --- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc +++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc @@ -606,7 +606,7 @@ static void spreadsheet_dataset_region_draw(const bContext *C, ARegion *region) UI_view2d_view_restore(C); /* scrollers */ - UI_view2d_scrollers_draw(v2d, NULL); + UI_view2d_scrollers_draw(v2d, nullptr); } static void spreadsheet_sidebar_init(wmWindowManager *wm, ARegion *region) diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc b/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc index 4f870092caa..2b31ce7d03c 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.cc @@ -119,7 +119,7 @@ void DatasetRegionDrawer::draw_hierarchy(const DatasetLayoutHierarchy &layout) /* Iterate attribute domains, skip unset ones (storage has to be in a enum-based, fixed size * array so uses optionals to support skipping enum values that shouldn't be displayed for a * component). */ - for (auto &optional_domain : component.attr_domains) { + for (const auto &optional_domain : component.attr_domains) { if (!optional_domain) { continue; } @@ -212,7 +212,7 @@ void DatasetRegionDrawer::draw_dataset_row(const int indentation, rect.ymin, BLI_rctf_size_x(&rect), BLI_rctf_size_y(&rect), - NULL); + nullptr); UI_but_datasetrow_indentation_set(bt, indentation); diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc index ceb4cd84cde..11ed88b7dc9 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc @@ -114,7 +114,7 @@ static int select_component_domain_invoke(bContext *C, sspreadsheet->attribute_domain = attribute_domain; /* Refresh header and main region. */ - WM_main_add_notifier(NC_SPACE | ND_SPACE_SPREADSHEET, NULL); + WM_main_add_notifier(NC_SPACE | ND_SPACE_SPREADSHEET, nullptr); return OPERATOR_FINISHED; } |