diff --git a/source/blender/blenkernel/intern/workspace.cc b/source/blender/blenkernel/intern/workspace.cc index 813919bfd30..b0524f9b5d4 100644 --- a/source/blender/blenkernel/intern/workspace.cc +++ b/source/blender/blenkernel/intern/workspace.cc @@ -526,7 +526,7 @@ void BKE_workspace_tool_id_replace_table(struct WorkSpace *workspace, int replace_table_num) { const size_t idname_prefix_len = idname_prefix_skip ? strlen(idname_prefix_skip) : 0; - const size_t idname_suffix_len = sizeof(((bToolRef *)nullptr)->idname) - idname_prefix_len; + const size_t idname_suffix_len = sizeof(bToolRef::idname) - idname_prefix_len; LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) { if (!(tref->space_type == space_type && tref->mode == mode)) { diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 2c7ca3f13bc..9022d5d80c1 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -1169,7 +1169,7 @@ void SCENE_OT_view_layer_add_lightgroup(wmOperatorType *ot) ot->prop = RNA_def_string(ot->srna, "name", nullptr, - sizeof(((ViewLayerLightgroup *)nullptr)->name), + sizeof(ViewLayerLightgroup::name), "Name", "Name of newly created lightgroup"); } diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 37001b067c2..f1e2e376fbe 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -2076,13 +2076,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 *)nullptr)->name); + len = sizeof(EditBone::name); } else if (tselem->type == TSE_MODIFIER) { - len = sizeof(((ModifierData *)nullptr)->name); + len = sizeof(ModifierData::name); } else if (tselem->id && GS(tselem->id->name) == ID_LI) { - len = sizeof(((Library *)nullptr)->filepath); + len = sizeof(Library::filepath); } else { len = MAX_ID_NAME - 2; diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc index 06a2fa8aa25..c98fdfdfe92 100644 --- a/source/blender/editors/space_outliner/outliner_tree.cc +++ b/source/blender/editors/space_outliner/outliner_tree.cc @@ -1634,7 +1634,7 @@ static void outliner_filter_tree(SpaceOutliner *space_outliner, const Scene *scene, ViewLayer *view_layer) { - char search_buff[sizeof(((struct SpaceOutliner *)nullptr)->search_string) + 2]; + char search_buff[sizeof(SpaceOutliner::search_string) + 2]; char *search_string; const int exclude_filter = outliner_exclude_filter_get(space_outliner); diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 7e8eaca0e9d..82982f9d38c 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -824,7 +824,7 @@ static void imb_exr_insert_view_name(char *name_full, const char *passname, cons BLI_assert(!ELEM(name_full, passname, viewname)); if (viewname == nullptr || viewname[0] == '\0') { - BLI_strncpy(name_full, passname, sizeof(((ExrChannel *)nullptr)->name)); + BLI_strncpy(name_full, passname, sizeof(ExrChannel::name)); return; } diff --git a/source/blender/io/collada/ArmatureImporter.cpp b/source/blender/io/collada/ArmatureImporter.cpp index 5402d08d075..2bfd67c4095 100644 --- a/source/blender/io/collada/ArmatureImporter.cpp +++ b/source/blender/io/collada/ArmatureImporter.cpp @@ -1012,7 +1012,7 @@ void ArmatureImporter::get_rna_path_for_joint(COLLADAFW::Node *node, char *joint_path, size_t count) { - char bone_name_esc[sizeof(((Bone *)nullptr)->name) * 2]; + char bone_name_esc[sizeof(Bone::name) * 2]; BLI_str_escape(bone_name_esc, bc_get_joint_name(node), sizeof(bone_name_esc)); BLI_snprintf(joint_path, count, "pose.bones[\"%s\"]", bone_name_esc); } diff --git a/source/blender/io/collada/collada_utils.cpp b/source/blender/io/collada/collada_utils.cpp index 6a65b27a93d..1e83c8be72a 100644 --- a/source/blender/io/collada/collada_utils.cpp +++ b/source/blender/io/collada/collada_utils.cpp @@ -769,7 +769,7 @@ void bc_enable_fcurves(bAction *act, char *bone_name) char prefix[200]; if (bone_name) { - char bone_name_esc[sizeof(((Bone *)nullptr)->name) * 2]; + char bone_name_esc[sizeof(Bone::name) * 2]; BLI_str_escape(bone_name_esc, bone_name, sizeof(bone_name_esc)); BLI_snprintf(prefix, sizeof(prefix), "pose.bones[\"%s\"]", bone_name_esc); }