From e0bc6794cf9f9cafbc599ed3388f808525fb26e2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 11 Jan 2024 14:54:41 +0100 Subject: [PATCH] Cleanup: make format --- build_files/utils/make_update.py | 1 + intern/cycles/device/metal/device_impl.mm | 4 +-- intern/cycles/device/metal/util.mm | 4 +-- intern/cycles/kernel/svm/musgrave.h | 3 +-- intern/ffmpeg/ffmpeg_compat.h | 2 +- release/scripts/addons | 2 +- release/scripts/addons_contrib | 2 +- .../keyconfig/keymap_data/blender_default.py | 2 +- .../scripts/startup/bl_ui/space_userpref.py | 2 +- source/blender/blenkernel/intern/blendfile.c | 6 ++--- .../blender/blenkernel/intern/customdata.cc | 27 +++++-------------- source/blender/blenloader/intern/readfile.h | 1 - source/blender/editors/gpencil/gpencil_edit.c | 3 ++- .../blender/editors/gpencil/gpencil_select.c | 7 ++--- .../editors/interface/interface_intern.h | 8 +++--- .../editors/mesh/editmesh_mask_extract.c | 2 +- source/blender/editors/object/object_modes.c | 2 +- .../blender/editors/space_node/space_node.cc | 4 +-- .../editors/space_outliner/outliner_tools.cc | 3 +-- .../editors/transform/transform_constraints.c | 2 +- .../intern/lineart/lineart_cpu.c | 6 +++-- source/blender/python/intern/bpy_driver.c | 10 +++---- 22 files changed, 45 insertions(+), 58 deletions(-) diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index 787ff5ce1df..5d64a5533dd 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -54,6 +54,7 @@ def get_blender_git_root(): # Setup for precompiled libraries and tests from svn. + def get_effective_architecture(args): if args.architecture: return args.architecture diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index 92aa783ed92..11bfcbd2246 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -338,13 +338,13 @@ bool MetalDevice::compile_and_load(MetalPipelineType pso_type) MTLCompileOptions *options = [[MTLCompileOptions alloc] init]; -#if defined(MAC_OS_VERSION_13_0) +# if defined(MAC_OS_VERSION_13_0) if (@available(macos 13.0, *)) { if (device_vendor == METAL_GPU_INTEL) { [options setOptimizationLevel:MTLLibraryOptimizationLevelSize]; } } -#endif +# endif options.fastMathEnabled = YES; if (@available(macOS 12.0, *)) { diff --git a/intern/cycles/device/metal/util.mm b/intern/cycles/device/metal/util.mm index 63f84a9df33..f47638fac15 100644 --- a/intern/cycles/device/metal/util.mm +++ b/intern/cycles/device/metal/util.mm @@ -110,11 +110,11 @@ vector> const &MetalInfo::get_usable_devices() usable |= (vendor == METAL_GPU_AMD); } -#if defined(MAC_OS_VERSION_13_0) +# if defined(MAC_OS_VERSION_13_0) if (@available(macos 13.0, *)) { usable |= (vendor == METAL_GPU_INTEL); } -#endif +# endif if (usable) { metal_printf("- %s\n", device_name.c_str()); diff --git a/intern/cycles/kernel/svm/musgrave.h b/intern/cycles/kernel/svm/musgrave.h index e88da8a17f7..8bf172f0981 100644 --- a/intern/cycles/kernel/svm/musgrave.h +++ b/intern/cycles/kernel/svm/musgrave.h @@ -472,7 +472,6 @@ ccl_device_noinline_cpu float noise_musgrave_hybrid_multi_fractal_3d( float value = 0.0f; float weight = 1.0f; - for (int i = 0; (weight > 0.001f) && (i < float_to_int(octaves)); i++) { if (weight > 1.0f) { weight = 1.0f; @@ -486,7 +485,7 @@ ccl_device_noinline_cpu float noise_musgrave_hybrid_multi_fractal_3d( } float rmd = octaves - floorf(octaves); - if ((rmd != 0.0f) && (weight > 0.001f)){ + if ((rmd != 0.0f) && (weight > 0.001f)) { if (weight > 1.0f) { weight = 1.0f; } diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index 045a3a72cba..a8254a99032 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -52,7 +52,7 @@ * github.com/FFmpeg/FFmpeg/commit/10c9a0874cb361336237557391d306d26d43f137 * for ffmpeg 6.0. */ -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,132,100) +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 132, 100) # define AV_CODEC_CAP_OTHER_THREADS AV_CODEC_CAP_AUTO_THREADS #endif diff --git a/release/scripts/addons b/release/scripts/addons index 8f1ff60fd3c..16ff2985ba3 160000 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 8f1ff60fd3c56b9647bbddb3b2cc45d712003379 +Subproject commit 16ff2985ba3fadb9ea31262dabd25c812b918b6e diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 74f3cd845c1..95107484d07 160000 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 74f3cd845c14dd0fdb2bd755ec6693628b340901 +Subproject commit 95107484d076bc965239942e857c83433bfa86d7 diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 196b1c6bcbd..f0f0cf6f060 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -3474,7 +3474,7 @@ def km_animation_channels(params): # Selection. *_template_items_select_actions(params, "anim.channels_select_all"), ("anim.channels_select_box", {"type": 'B', "value": 'PRESS'}, None), - ("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'}, + ("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'}, {"properties": [("extend", False)]}), ("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True}, {"properties": [("extend", True)]}), diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 4056ff16c76..1f5a72111b0 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1541,7 +1541,7 @@ class USERPREF_PT_input_touchpad(InputPanel, CenterAlignMixIn, Panel): @classmethod def poll(cls, context): import sys - return sys.platform[:3] == "win" or sys.platform == "darwin" + return sys.platform[:3] == "win" or sys.platform == "darwin" def draw_centered(self, context, layout): prefs = context.preferences diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 569eb1c599b..913cdfb5ffb 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -468,9 +468,9 @@ static void setup_app_blend_file_data(bContext *C, static void handle_subversion_warning(Main *main, BlendFileReadReport *reports) { - if (main->versionfile > BLENDER_FILE_VERSION || (main->versionfile == BLENDER_FILE_VERSION && - main->subversionfile > BLENDER_FILE_SUBVERSION)) - { + if (main->versionfile > BLENDER_FILE_VERSION || + (main->versionfile == BLENDER_FILE_VERSION && + main->subversionfile > BLENDER_FILE_SUBVERSION)) { BKE_reportf(reports->reports, RPT_WARNING, "File written by newer Blender binary (%d.%d), expect loss of data!", diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index 1c7b78fd902..05c2f6b943c 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -1633,26 +1633,13 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { nullptr, layerMaxNum_tface}, /* 6: CD_MCOL */ /* 4 MCol structs per face */ - {sizeof(MCol[4]), - "MCol", - 4, - N_("Col"), - nullptr, - nullptr, - layerInterp_mcol, - layerSwap_mcol, - layerDefault_mcol, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr}, + {sizeof(MCol[4]), "MCol", 4, + N_("Col"), nullptr, nullptr, + layerInterp_mcol, layerSwap_mcol, layerDefault_mcol, + nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, + nullptr, nullptr}, /* 7: CD_ORIGINDEX */ {sizeof(int), "", 0, nullptr, nullptr, nullptr, nullptr, nullptr, layerDefault_origindex}, /* 8: CD_NORMAL */ diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index 3e7e01aae71..778800a4328 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -228,4 +228,3 @@ void *blo_read_get_new_globaldata_address(struct FileData *fd, const void *adr); /* Mark the Main data as invalid (.blend file reading should be aborted ASAP, and the already read * data should be discarded). Also add an error report to `fd` including given `message`. */ void blo_readfile_invalidate(struct FileData *fd, struct Main *bmain, const char *message); - diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 9b04a85673c..159a68c8ab5 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -4491,7 +4491,8 @@ void GPENCIL_OT_stroke_sample(wmOperatorType *ot) /* properties */ prop = RNA_def_float(ot->srna, "length", 0.1f, 0.0f, 100.0f, "Length", "", 0.0f, 100.0f); - prop = RNA_def_float(ot->srna, "sharp_threshold", 0.1f, 0.0f, M_PI, "Sharp Threshold", "", 0.0f, M_PI); + prop = RNA_def_float( + ot->srna, "sharp_threshold", 0.1f, 0.0f, M_PI, "Sharp Threshold", "", 0.0f, M_PI); /* avoid re-using last var */ RNA_def_property_flag(prop, PROP_SKIP_SAVE); } diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index 300cac996b9..61f6fe1c24a 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -2072,7 +2072,8 @@ static bool gpencil_generic_stroke_select(bContext *C, bGPDspoint *pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt; /* Convert point coords to screen-space. */ - const bool is_inside = is_inside_fn(gsc.region, gpstroke_iter.diff_mat, &pt_active->x, user_data); + const bool is_inside = is_inside_fn( + gsc.region, gpstroke_iter.diff_mat, &pt_active->x, user_data); if (strokemode == false) { const bool is_select = (pt_active->flag & GP_SPOINT_SELECT) != 0; const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside); @@ -2441,11 +2442,11 @@ static int gpencil_select_exec(bContext *C, wmOperator *op) /* if select mode is stroke, use whole stroke */ if ((ob) && (ob->mode == OB_MODE_SCULPT_GPENCIL)) { whole |= (bool)(gpencil_select_mode_from_sculpt(ts->gpencil_selectmode_sculpt) == - GP_SELECTMODE_STROKE); + GP_SELECTMODE_STROKE); } else if ((ob) && (ob->mode == OB_MODE_VERTEX_GPENCIL)) { whole |= (bool)(gpencil_select_mode_from_vertex(ts->gpencil_selectmode_sculpt) == - GP_SELECTMODE_STROKE); + GP_SELECTMODE_STROKE); } else { whole |= (bool)(ts->gpencil_selectmode_edit == GP_SELECTMODE_STROKE); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index e7d30fd42ef..93250cc7262 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -1544,10 +1544,10 @@ uiButViewItem *ui_block_view_find_matching_view_item_but_in_old_block( struct uiListType *UI_UL_cache_file_layers(void); struct ID *ui_template_id_liboverride_hierarchy_make(struct bContext *C, - struct Main *bmain, - struct ID *owner_id, - struct ID *id, - const char **r_undo_push_label); + struct Main *bmain, + struct ID *owner_id, + struct ID *id, + const char **r_undo_push_label); #ifdef __cplusplus } diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c b/source/blender/editors/mesh/editmesh_mask_extract.c index 7ee92d4a5f7..e46ec36a950 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.c +++ b/source/blender/editors/mesh/editmesh_mask_extract.c @@ -292,7 +292,7 @@ static int paint_mask_extract_exec(bContext *C, wmOperator *op) * Note: A second push happens after the operator due to * the OPTYPE_UNDO flag; having an initial undo step here * is just needed to preserve the active object pointer. - * + * * Fixes T103261. */ ED_undo_push_op(C, op); diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index 47c8401cf12..694baf80577 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -42,11 +42,11 @@ #include "ED_armature.h" #include "ED_gpencil.h" +#include "ED_outliner.h" #include "ED_screen.h" #include "ED_transform_snap_object_context.h" #include "ED_undo.h" #include "ED_view3d.h" -#include "ED_outliner.h" #include "WM_toolsystem.h" diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc index 98b57999327..ce881f672db 100644 --- a/source/blender/editors/space_node/space_node.cc +++ b/source/blender/editors/space_node/space_node.cc @@ -647,9 +647,7 @@ static bool node_object_drop_poll(bContext *C, wmDrag *drag, const wmEvent *UNUS return WM_drag_is_ID_type(drag, ID_OB) && !UI_but_active_drop_name(C); } -static bool node_collection_drop_poll(bContext *C, - wmDrag *drag, - const wmEvent *UNUSED(event)) +static bool node_collection_drop_poll(bContext *C, wmDrag *drag, const wmEvent *UNUSED(event)) { return WM_drag_is_ID_type(drag, ID_GR) && !UI_but_active_drop_name(C); } diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 1dcffdde38c..789a42e8590 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -1315,8 +1315,7 @@ static void id_override_library_create_hierarchy_process(bContext *C, } if (id_iter->override_library->hierarchy_root != nullptr && !data.id_hierarchy_roots_uid.contains( - id_iter->override_library->hierarchy_root->session_uuid)) - { + id_iter->override_library->hierarchy_root->session_uuid)) { continue; } if (data.selected_id_uid.contains(id_iter->override_library->reference->session_uuid) || diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index cf600576e21..a82fc870fe2 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -837,7 +837,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) const float fac_scale = xscale / yscale; GPU_matrix_scale_2f(1.0f, fac_scale); - GPU_matrix_translate_2f(0.0f, (t->center_global[1] / fac_scale) - t->center_global[1]); + GPU_matrix_translate_2f(0.0f, (t->center_global[1] / fac_scale) - t->center_global[1]); } eGPUDepthTest depth_test_enabled = GPU_depth_test_get(); diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index be981a6b2d1..e85b5c4610a 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -3574,7 +3574,8 @@ static LineartData *lineart_create_render_buffer(Scene *scene, copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->obmat[3]); } copy_m4_m4(ld->conf.cam_obmat, camera->obmat); - /* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */ + /* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and + * lights. */ normalize_v3(ld->conf.cam_obmat[0]); normalize_v3(ld->conf.cam_obmat[1]); normalize_v3(ld->conf.cam_obmat[2]); @@ -3606,7 +3607,8 @@ static LineartData *lineart_create_render_buffer(Scene *scene, Object *light_obj = lmd->light_contour_object; copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->obmat[3]); copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->obmat); - /* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */ + /* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and + * lights. */ normalize_v3(ld->conf.cam_obmat_secondary[0]); normalize_v3(ld->conf.cam_obmat_secondary[1]); normalize_v3(ld->conf.cam_obmat_secondary[2]); diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index e11821090ab..3d9754b3f25 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -364,7 +364,7 @@ static const bool secure_opcodes[255] = { OK_OP(KW_NAMES), /* Ok, because it's used for calling functions with keyword arguments. */ OK_OP(PRECALL), /* Ok, because it's used for calling. */ -# else /* Python 3.10 and older. */ +# else /* Python 3.10 and older. */ OK_OP(POP_TOP), OK_OP(ROT_TWO), @@ -389,9 +389,9 @@ static const bool secure_opcodes[255] = { OK_OP(BINARY_TRUE_DIVIDE), OK_OP(INPLACE_FLOOR_DIVIDE), OK_OP(INPLACE_TRUE_DIVIDE), -#if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */ +# if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */ OK_OP(GET_LEN), -#endif +# endif OK_OP(INPLACE_ADD), OK_OP(INPLACE_SUBTRACT), OK_OP(INPLACE_MULTIPLY), @@ -409,9 +409,9 @@ static const bool secure_opcodes[255] = { OK_OP(INPLACE_OR), OK_OP(LIST_TO_TUPLE), OK_OP(RETURN_VALUE), -#if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */ +# if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */ OK_OP(ROT_N), -#endif +# endif OK_OP(BUILD_TUPLE), OK_OP(BUILD_LIST), OK_OP(BUILD_SET),