From 50c796236ba3976c22783b8b8f09aa7fc0b84161 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 13 Jan 2016 19:47:35 +0100 Subject: [PATCH] Fixed: getLastSeparator should return std::string::size_type instead of an integer --- code/nel/include/nel/misc/path.h | 2 +- code/nel/src/misc/path.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/nel/include/nel/misc/path.h b/code/nel/include/nel/misc/path.h index fed90efd5..ffae98f92 100644 --- a/code/nel/include/nel/misc/path.h +++ b/code/nel/include/nel/misc/path.h @@ -618,7 +618,7 @@ struct CFile * Return the position between [begin,end[ of the last separator between path and filename ('/' or '\'). * If there's no separator, it returns string::npos. */ - static int getLastSeparator (const std::string &filename); + static std::string::size_type getLastSeparator (const std::string &filename); static std::string getFilenameWithoutExtension (const std::string &filename); static std::string getExtension (const std::string &filename); diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index 19403c964..7ec61fdd7 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -1854,7 +1854,7 @@ std::string CFileContainer::getTemporaryDirectory() ////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////// -int CFile::getLastSeparator (const string &filename) +std::string::size_type CFile::getLastSeparator (const string &filename) { string::size_type pos = filename.find_last_of ('/'); if (pos == string::npos) @@ -1865,7 +1865,7 @@ int CFile::getLastSeparator (const string &filename) pos = filename.find_last_of ('@'); } } - return (int)pos; + return pos; } string CFile::getFilename (const string &filename)