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:
authorAnkit Meel <ankitjmeel@gmail.com>2020-10-09 12:09:26 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2020-10-09 20:16:39 +0300
commit32d4623f4467df230c08d24916759ac4996dfb52 (patch)
treeb3ef4eb73f3470f49a4256d1656bc40cea76601d /source/blender/blenlib/intern/storage.c
parent62f5232f37b9755bfa07a174a47017cd1609fb5a (diff)
Cleanup: alias: use const, remove unused variable.
`targetIsDirectory` slipped through the code review of {D6679}/{rBafb1a64ccb81}. `BLI_is_dir` exists to check for directory status of a file. Remove some `else-after-return`s. Use `r_` prefix for return value arguments, and move it to the end in the list of arguments.
Diffstat (limited to 'source/blender/blenlib/intern/storage.c')
-rw-r--r--source/blender/blenlib/intern/storage.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index a841068bfdb..628bdc1a31f 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -288,11 +288,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(
- /* This parameter can only be const on non-windows platforms.
- * NOLINTNEXTLINE: readability-non-const-parameter. */
- char target[FILE_MAXDIR],
- const char *filepath)
+bool BLI_file_alias_target(const char *filepath,
+ /* This parameter can only be `const` on Linux since
+ * redirections are not supported there.
+ * NOLINTNEXTLINE: readability-non-const-parameter. */
+ char r_targetpath[FILE_MAXDIR])
{
# ifdef WIN32
if (!BLI_path_extension_check(filepath, ".lnk")) {
@@ -318,7 +318,7 @@ bool BLI_file_alias_target(
wchar_t target_utf16[FILE_MAXDIR] = {0};
hr = Shortcut->lpVtbl->GetPath(Shortcut, target_utf16, FILE_MAXDIR, NULL, 0);
if (SUCCEEDED(hr)) {
- success = (conv_utf_16_to_8(target_utf16, target, FILE_MAXDIR) == 0);
+ success = (conv_utf_16_to_8(target_utf16, r_targetpath, FILE_MAXDIR) == 0);
}
}
PersistFile->lpVtbl->Release(PersistFile);
@@ -328,9 +328,9 @@ bool BLI_file_alias_target(
Shortcut->lpVtbl->Release(Shortcut);
}
- return (success && target[0]);
+ return (success && r_targetpath[0]);
# else
- UNUSED_VARS(target, filepath);
+ UNUSED_VARS(r_targetpath, filepath);
/* File-based redirection not supported. */
return false;
# endif