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:
authorSybren A. Stüvel <sybren@blender.org>2021-10-14 16:34:22 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-14 16:34:29 +0300
commit55cf9bb5e653ef824cf32aae899437525d1f16e0 (patch)
treebb317e50606fa05d817b5918fbadebdd9af8d3a5 /source/blender/editors/space_file
parent25a255c32a73b9d964d9f8a4733c4a42dfdc2f4f (diff)
Cleanup: fix const discard warning
No functional changes.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/filesel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index fc9fc6799e1..2b4f14451e7 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -530,7 +530,7 @@ void ED_fileselect_activate_by_id(SpaceFile *sfile, ID *asset_id, const bool def
static void on_reload_select_by_relpath(SpaceFile *sfile, onReloadFnData custom_data)
{
- char *relative_path = (char *)custom_data;
+ const char *relative_path = custom_data;
ED_fileselect_activate_by_relpath(sfile, relative_path);
}
@@ -541,7 +541,9 @@ void ED_fileselect_activate_by_relpath(SpaceFile *sfile, const char *relative_pa
* after these operations have completed. Defer activation until then. */
struct FileList *files = sfile->files;
if (files == NULL || filelist_pending(files) || filelist_needs_force_reset(files)) {
- file_on_reload_callback_register(sfile, on_reload_select_by_relpath, relative_path);
+ /* Casting away the constness of `relative_path` is safe here, because eventually it just ends
+ * up in another call to this function, and then it's a const char* again. */
+ file_on_reload_callback_register(sfile, on_reload_select_by_relpath, (char *)relative_path);
return;
}