diff --git a/source/blender/blenkernel/intern/blendfile.cc b/source/blender/blenkernel/intern/blendfile.cc index 6da9fa6c821..8d6bfface1e 100644 --- a/source/blender/blenkernel/intern/blendfile.cc +++ b/source/blender/blenkernel/intern/blendfile.cc @@ -355,7 +355,7 @@ static bool reuse_bmain_move_id(ReuseOldBMainData *reuse_data, static Library *reuse_bmain_data_dependencies_new_library_get(ReuseOldBMainData *reuse_data, Library *old_lib) { - id::IDRemapper &remapper = reuse_bmain_data_remapper_ensure(reuse_data); + const id::IDRemapper &remapper = reuse_bmain_data_remapper_ensure(reuse_data); Library *new_lib = old_lib; IDRemapperApplyResult result = remapper.apply(reinterpret_cast(&new_lib), ID_REMAP_APPLY_DEFAULT); diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc index 2f5eb21bb7f..2e8cf815abd 100644 --- a/source/blender/blenloader/intern/readfile.cc +++ b/source/blender/blenloader/intern/readfile.cc @@ -982,7 +982,7 @@ static bool read_file_dna(FileData *fd, const char **r_error_message) } /* We can't use read_global because this needs 'DNA1' to be decoded, * however the first 4 chars are _always_ the subversion. */ - FileGlobal *fg = reinterpret_cast(&bhead[1]); + const FileGlobal *fg = reinterpret_cast(&bhead[1]); BLI_STATIC_ASSERT(offsetof(FileGlobal, subvstr) == 0, "Must be first: subvstr") char num[5]; memcpy(num, fg->subvstr, 4); diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc index 29116e9efd7..c4bd7567758 100644 --- a/source/blender/blenloader/intern/writefile.cc +++ b/source/blender/blenloader/intern/writefile.cc @@ -619,10 +619,10 @@ static void mywrite_id_begin(WriteData *wd, ID *id) /* If current next memchunk does not match the ID we are about to write, or is not the _first_ * one for said ID, try to find the correct memchunk in the mapping using ID's session_uid. */ - MemFileChunk *curr_memchunk = wd->mem.reference_current_chunk; - MemFileChunk *prev_memchunk = curr_memchunk != nullptr ? - static_cast(curr_memchunk->prev) : - nullptr; + const MemFileChunk *curr_memchunk = wd->mem.reference_current_chunk; + const MemFileChunk *prev_memchunk = curr_memchunk != nullptr ? + static_cast(curr_memchunk->prev) : + nullptr; if (curr_memchunk == nullptr || curr_memchunk->id_session_uid != id->session_uid || (prev_memchunk != nullptr && (prev_memchunk->id_session_uid == curr_memchunk->id_session_uid))) diff --git a/source/blender/draw/intern/draw_color_management.cc b/source/blender/draw/intern/draw_color_management.cc index de064d9b7a3..08003d6b1a4 100644 --- a/source/blender/draw/intern/draw_color_management.cc +++ b/source/blender/draw/intern/draw_color_management.cc @@ -65,7 +65,7 @@ static eDRWColorManagementType drw_color_management_type_for_v3d(const Scene &sc static eDRWColorManagementType drw_color_management_type_for_space_image(const SpaceImage &sima) { - Image *image = sima.image; + const Image *image = sima.image; /* Use inverse logic as there isn't a setting for `Color & Alpha`. */ const eSpaceImage_Flag display_channels_mode = static_cast(sima.flag); @@ -83,7 +83,7 @@ static eDRWColorManagementType drw_color_management_type_for_space_node(Main &bm const SpaceNode &snode) { if ((snode.flag & SNODE_BACKDRAW) && ED_node_is_compositor(&snode)) { - Image *image = BKE_image_ensure_viewer(&bmain, IMA_TYPE_COMPOSITE, "Viewer Node"); + const Image *image = BKE_image_ensure_viewer(&bmain, IMA_TYPE_COMPOSITE, "Viewer Node"); if ((image->flag & IMA_VIEW_AS_RENDER) == 0) { return eDRWColorManagementType::ViewTransform; } diff --git a/source/blender/editors/space_userpref/userpref_ops.cc b/source/blender/editors/space_userpref/userpref_ops.cc index 1c81614436a..a43cc09e6b4 100644 --- a/source/blender/editors/space_userpref/userpref_ops.cc +++ b/source/blender/editors/space_userpref/userpref_ops.cc @@ -489,7 +489,7 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot) { /* Name. */ const char *prop_id = "name"; - PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); + const PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); PropertyRNA *prop = RNA_def_string(ot->srna, prop_id, nullptr, @@ -501,7 +501,7 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot) { /* Remote Path. */ const char *prop_id = "remote_url"; - PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); + const PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); PropertyRNA *prop = RNA_def_string(ot->srna, prop_id, nullptr, @@ -513,7 +513,7 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot) { /* Use Access Token. */ const char *prop_id = "use_access_token"; - PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); + const PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); PropertyRNA *prop = RNA_def_boolean(ot->srna, prop_id, false, @@ -524,7 +524,7 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot) { /* Access Token (dynamic length). */ const char *prop_id = "access_token"; - PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); + const PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); PropertyRNA *prop = RNA_def_string(ot->srna, prop_id, nullptr, @@ -537,7 +537,7 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot) { /* Check for Updated on Startup. */ const char *prop_id = "use_sync_on_startup"; - PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); + const PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); PropertyRNA *prop = RNA_def_boolean(ot->srna, prop_id, false, @@ -548,7 +548,7 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot) { /* Use Custom Directory. */ const char *prop_id = "use_custom_directory"; - PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); + const PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); PropertyRNA *prop = RNA_def_boolean(ot->srna, prop_id, false, @@ -559,7 +559,7 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot) { /* Custom Directory. */ const char *prop_id = "custom_directory"; - PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); + const PropertyRNA *prop_ref = RNA_struct_type_find_property(type_ref, prop_id); PropertyRNA *prop = RNA_def_string_dir_path(ot->srna, prop_id, nullptr, @@ -620,7 +620,7 @@ static int preferences_extension_repo_remove_invoke(bContext *C, const int index = RNA_int_get(op->ptr, "index"); bUserExtensionRepoRemoveType repo_type = bUserExtensionRepoRemoveType( RNA_enum_get(op->ptr, "type")); - bUserExtensionRepo *repo = static_cast( + const bUserExtensionRepo *repo = static_cast( BLI_findlink(&U.extension_repos, index)); if (!repo) { diff --git a/source/blender/render/intern/render_result.cc b/source/blender/render/intern/render_result.cc index 2bd7ba049c7..68fcba324f2 100644 --- a/source/blender/render/intern/render_result.cc +++ b/source/blender/render/intern/render_result.cc @@ -405,8 +405,8 @@ void render_result_clone_passes(Render *re, RenderResult *rr, const char *viewna continue; } - /* Compare fullname to make sure that the view also is equal. */ - RenderPass *rp = static_cast( + /* Compare `fullname` to make sure that the view also is equal. */ + const RenderPass *rp = static_cast( BLI_findstring(&rl->passes, main_rp->fullname, offsetof(RenderPass, fullname))); if (!rp) { render_layer_add_pass( @@ -652,8 +652,8 @@ static void *ml_addview_cb(void *base, const char *str) static int order_render_passes(const void *a, const void *b) { /* 1 if `a` is after `b`. */ - RenderPass *rpa = (RenderPass *)a; - RenderPass *rpb = (RenderPass *)b; + const RenderPass *rpa = (const RenderPass *)a; + const RenderPass *rpb = (const RenderPass *)b; uint passtype_a = passtype_from_name(rpa->name); uint passtype_b = passtype_from_name(rpb->name);