diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-24 20:32:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-24 22:11:15 +0200 |
commit | e0adee8341e89d478511d7b3e784941f2fd9b504 (patch) | |
tree | 5be8c2d39197a61142a1265c94e07e4d73cd334f /sal/osl | |
parent | 715e7370a160bd3a51bf5aefdd92319da239bc4e (diff) |
loplugin:returnconstval in sal..sc
Change-Id: I300d14d580d450ec338129918955651b9d40d5d2
Reviewed-on: https://gerrit.libreoffice.org/78059
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/file_path_helper.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx index 584279cff841..a89e00bf76ed 100644 --- a/sal/osl/unx/file_path_helper.cxx +++ b/sal/osl/unx/file_path_helper.cxx @@ -28,14 +28,11 @@ const sal_Unicode FPH_CHAR_PATH_SEPARATOR = '/'; const sal_Unicode FPH_CHAR_DOT = '.'; const sal_Unicode FPH_CHAR_COLON = ':'; -static const OUString FPH_PATH_SEPARATOR() -{ return OUString(FPH_CHAR_PATH_SEPARATOR); } +static const OUStringLiteral FPH_PATH_SEPARATOR("/"); -static const OUString FPH_LOCAL_DIR_ENTRY() -{ return OUString(FPH_CHAR_DOT); } +static const OUStringLiteral FPH_LOCAL_DIR_ENTRY("."); -static const OUString FPH_PARENT_DIR_ENTRY() -{ return ".."; } +static const OUStringLiteral FPH_PARENT_DIR_ENTRY(".."); void osl_systemPathRemoveSeparator(rtl_uString* pustrPath) { @@ -68,11 +65,11 @@ void osl_systemPathEnsureSeparator(rtl_uString** ppustrPath) if ((lp > 1 && i != (lp - 1)) || ((lp < 2) && i < 0)) { - path += FPH_PATH_SEPARATOR(); + path += FPH_PATH_SEPARATOR; rtl_uString_assign(ppustrPath, path.pData); } - SAL_WARN_IF( !path.endsWith(FPH_PATH_SEPARATOR()), + SAL_WARN_IF( !path.endsWith(FPH_PATH_SEPARATOR), "sal.osl", "osl_systemPathEnsureSeparator: Post condition failed"); } @@ -147,8 +144,8 @@ bool osl_systemPathIsLocalOrParentDirectoryEntry( osl_systemPathGetFileNameOrLastDirectoryPart(pustrPath, &dirent.pData); - return (dirent == FPH_LOCAL_DIR_ENTRY() || - dirent == FPH_PARENT_DIR_ENTRY()); + return (dirent == FPH_LOCAL_DIR_ENTRY || + dirent == FPH_PARENT_DIR_ENTRY); } /** Simple iterator for a path list separated by the specified character |