[Bf-blender-cvs] [91e67c7bdae] master: Cleanup: remove some incorrectly placed consts

Jacques Lucke noreply at git.blender.org
Mon Jul 13 16:55:48 CEST 2020


Commit: 91e67c7bdae43d1145d5aa544d98e9bc98925018
Author: Jacques Lucke
Date:   Mon Jul 13 16:55:39 2020 +0200
Branches: master
https://developer.blender.org/rB91e67c7bdae43d1145d5aa544d98e9bc98925018

Cleanup: remove some incorrectly placed consts

Clang-tidy reported that those parameters could be const,
but that is not true on windows.

===================================================================

M	source/blender/blenkernel/BKE_appdir.h
M	source/blender/blenkernel/intern/appdir.c
M	source/blender/blenlib/BLI_fileops.h
M	source/blender/blenlib/intern/storage.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h
index 7e2aaf291c5..e49fc260810 100644
--- a/source/blender/blenkernel/BKE_appdir.h
+++ b/source/blender/blenkernel/BKE_appdir.h
@@ -51,7 +51,7 @@ const char *BKE_appdir_program_path(void);
 const char *BKE_appdir_program_dir(void);
 
 /* Return OS fonts directory. */
-bool BKE_appdir_font_folder_default(const char *dir);
+bool BKE_appdir_font_folder_default(char *dir);
 
 /* find python executable */
 bool BKE_appdir_program_python_search(char *fullpath,
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index b6f219d7351..0d01176ec2a 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -1019,7 +1019,11 @@ void BKE_tempdir_session_purge(void)
 }
 
 /* Gets a good default directory for fonts */
-bool BKE_appdir_font_folder_default(const char *dir)
+
+bool BKE_appdir_font_folder_default(
+    /* This parameter can only be const on non-windows plaforms.
+     * NOLINTNEXTLINE: readability-non-const-parameter. */
+    char *dir)
 {
   bool success = false;
 #ifdef WIN32
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
index 35bb34f7837..fe4600b9121 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -147,7 +147,7 @@ int BLI_access(const char *filename, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONN
 
 bool BLI_file_is_writable(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 bool BLI_file_touch(const char *file) ATTR_NONNULL();
-bool BLI_file_alias_target(const char *target, const char *filepath);
+bool BLI_file_alias_target(char *target, const char *filepath);
 
 #if 0 /* UNUSED */
 int BLI_file_gzip(const char *from, const char *to) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 5b617c840b5..cd5cc5d64f1 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -290,7 +290,11 @@ eFileAttributes BLI_file_attributes(const char *path)
 
 /* Return alias/shortcut file target. Apple version is defined in storage_apple.mm */
 #ifndef __APPLE__
-bool BLI_file_alias_target(const char target[FILE_MAXDIR], const char *filepath)
+bool BLI_file_alias_target(
+    /* This parameter can only be const on non-windows plaforms.
+     * NOLINTNEXTLINE: readability-non-const-parameter. */
+    char target[FILE_MAXDIR],
+    const char *filepath)
 {
 #  ifdef WIN32
   if (!BLI_path_extension_check(filepath, ".lnk")) {



More information about the Bf-blender-cvs mailing list