Skip to content

Commit 69cab0f

Browse files
const other approach
1 parent bf09960 commit 69cab0f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libs/openFrameworks/utils/ofFileUtils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,8 @@ void ofSetDataPathRoot(const of::filesystem::path& newRoot){
19741974
}
19751975

19761976
//--------------------------------------------------
1977-
of::filesystem::path ofToDataPathFS(of::filesystem::path & path, bool makeAbsolute){
1977+
of::filesystem::path ofToDataPathFS(const of::filesystem::path & in_path, bool makeAbsolute){
1978+
of::filesystem::path path {in_path} ; // don't propagate constness
19781979
if (makeAbsolute && path.is_absolute()) {
19791980
return path;
19801981
}
@@ -2066,7 +2067,7 @@ of::filesystem::path ofToDataPathFS(of::filesystem::path & path, bool makeAbsolu
20662067
}
20672068

20682069
//--------------------------------------------------
2069-
of::filesystem::path ofToDataPath(of::filesystem::path & path, bool makeAbsolute){
2070+
of::filesystem::path ofToDataPath(const of::filesystem::path & path, bool makeAbsolute){
20702071
return ofToDataPathFS(path, makeAbsolute);
20712072
}
20722073

libs/openFrameworks/utils/ofFileUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,9 +1244,9 @@ void ofDisableDataPath();
12441244
/// \param absolute Set to true to return an absolute path.
12451245
/// \returns the new path, unless paths were disabled with ofDisableDataPath().
12461246

1247-
of::filesystem::path ofToDataPathFS(of::filesystem::path & path, bool absolute = false);
1247+
of::filesystem::path ofToDataPathFS(const of::filesystem::path & path, bool absolute = false);
12481248

1249-
of::filesystem::path ofToDataPath(of::filesystem::path & path, bool absolute = false);
1249+
of::filesystem::path ofToDataPath(const of::filesystem::path & path, bool absolute = false);
12501250

12511251

12521252
/// \brief Reset the working directory to the platform default.

0 commit comments

Comments
 (0)