diff options
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 34 | ||||
-rw-r--r-- | Source/kwsys/CommandLineArguments.hxx.in | 3 | ||||
-rw-r--r-- | Source/kwsys/Configure.h.in | 37 | ||||
-rw-r--r-- | Source/kwsys/Directory.cxx | 4 | ||||
-rw-r--r-- | Source/kwsys/Glob.cxx | 2 | ||||
-rw-r--r-- | Source/kwsys/Glob.hxx.in | 14 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 2 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.hxx.in | 3 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 29 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.hxx.in | 3 | ||||
-rw-r--r-- | Source/kwsys/hashtable.hxx.in | 2 | ||||
-rw-r--r-- | Source/kwsys/kwsysPlatformTestsCXX.cxx | 42 |
12 files changed, 33 insertions, 142 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index e7da994..8577506 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -179,13 +179,6 @@ IF(KWSYS_USE_ConsoleBuf) SET(KWSYS_USE_Encoding 1) ENDIF() -# Setup the large file support default. -IF(KWSYS_LFS_DISABLE) - SET(KWSYS_LFS_REQUESTED 0) -ELSE() - SET(KWSYS_LFS_REQUESTED 1) -ENDIF() - # Specify default 8 bit encoding for Windows IF(NOT KWSYS_ENCODING_DEFAULT_CODEPAGE) SET(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_ACP) @@ -353,30 +346,6 @@ IF(KWSYS_STANDALONE) ENDIF() #----------------------------------------------------------------------------- -# Configure Large File Support. -KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_CSTDIO - "Checking whether header cstdio is available" DIRECT) -SET(KWSYS_LFS_AVAILABLE 0) -IF(KWSYS_LFS_REQUESTED) - # Large File Support is requested. - SET(KWSYS_LFS_REQUESTED 1) - - # Check for large file support. - SET(KWSYS_PLATFORM_CXX_TEST_DEFINES - -DKWSYS_CXX_HAS_CSTDIO=${KWSYS_CXX_HAS_CSTDIO}) - KWSYS_PLATFORM_CXX_TEST_RUN(KWSYS_LFS_WORKS - "Checking for Large File Support" DIRECT) - SET(KWSYS_PLATFORM_CXX_TEST_DEFINES) - - IF(KWSYS_LFS_WORKS) - SET(KWSYS_LFS_AVAILABLE 1) - ENDIF() -ELSE() - # Large File Support is not requested. - SET(KWSYS_LFS_REQUESTED 0) -ENDIF() - -#----------------------------------------------------------------------------- # Configure the standard library header wrappers based on compiler's # capabilities and parent project's request. Enforce 0/1 as only # possible values for configuration into Configure.hxx. @@ -575,9 +544,6 @@ IF(KWSYS_USE_SystemInformation) COMPILE_DEFINITIONS KWSYS_SYS_HAS_MACHINE_CPU_H=1) ENDIF() ENDIF() - IF(KWSYS_LFS_AVAILABLE AND NOT KWSYS_LFS_DISABLE) - SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_HAS_LFS=1) - ENDIF() KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_RLIMIT64 "Checking whether CXX compiler has rlimit64" DIRECT) SET(KWSYS_PLATFORM_CXX_TEST_DEFINES) diff --git a/Source/kwsys/CommandLineArguments.hxx.in b/Source/kwsys/CommandLineArguments.hxx.in index 31115e5..7db9015 100644 --- a/Source/kwsys/CommandLineArguments.hxx.in +++ b/Source/kwsys/CommandLineArguments.hxx.in @@ -62,6 +62,9 @@ public: CommandLineArguments(); ~CommandLineArguments(); + CommandLineArguments(const CommandLineArguments&) = delete; + CommandLineArguments& operator=(const CommandLineArguments&) = delete; + /** * Various argument types. */ diff --git a/Source/kwsys/Configure.h.in b/Source/kwsys/Configure.h.in index bec1abc..5323c57 100644 --- a/Source/kwsys/Configure.h.in +++ b/Source/kwsys/Configure.h.in @@ -28,43 +28,6 @@ /* Whether kwsys namespace is "kwsys". */ #define @KWSYS_NAMESPACE@_NAME_IS_KWSYS @KWSYS_NAME_IS_KWSYS@ -/* Whether Large File Support is requested. */ -#define @KWSYS_NAMESPACE@_LFS_REQUESTED @KWSYS_LFS_REQUESTED@ - -/* Whether Large File Support is available. */ -#if @KWSYS_NAMESPACE@_LFS_REQUESTED -# define @KWSYS_NAMESPACE@_LFS_AVAILABLE @KWSYS_LFS_AVAILABLE@ -#endif - -/* Setup Large File Support if requested. */ -#if @KWSYS_NAMESPACE@_LFS_REQUESTED -/* Since LFS is requested this header must be included before system - headers whether or not LFS is available. */ -# if 0 && (defined(_SYS_TYPES_H) || defined(_SYS_TYPES_INCLUDED)) -# error "@KWSYS_NAMESPACE@/Configure.h must be included before sys/types.h" -# endif -/* Enable the large file API if it is available. */ -# if @KWSYS_NAMESPACE@_LFS_AVAILABLE && \ - !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINES) -# if !defined(_LARGEFILE_SOURCE) && \ - !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE_SOURCE) -# define _LARGEFILE_SOURCE -# endif -# if !defined(_LARGEFILE64_SOURCE) && \ - !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE64_SOURCE) -# define _LARGEFILE64_SOURCE -# endif -# if !defined(_LARGE_FILES) && \ - !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGE_FILES) -# define _LARGE_FILES -# endif -# if !defined(_FILE_OFFSET_BITS) && \ - !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_FILE_OFFSET_BITS) -# define _FILE_OFFSET_BITS 64 -# endif -# endif -#endif - /* Setup the export macro. */ #if @KWSYS_BUILD_SHARED@ # if defined(_WIN32) || defined(__CYGWIN__) diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx index 31b1c15..59530a4 100644 --- a/Source/kwsys/Directory.cxx +++ b/Source/kwsys/Directory.cxx @@ -102,7 +102,7 @@ bool Directory::Load(const std::string& name) # endif char* buf; size_t n = name.size(); - if (*name.rbegin() == '/' || *name.rbegin() == '\\') { + if (name.back() == '/' || name.back() == '\\') { buf = new char[n + 1 + 1]; sprintf(buf, "%s*", name.c_str()); } else { @@ -144,7 +144,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name) # endif char* buf; size_t n = name.size(); - if (*name.rbegin() == '/') { + if (name.back() == '/') { buf = new char[n + 1 + 1]; sprintf(buf, "%s*", name.c_str()); } else { diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index 6952d24..829c138 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -263,7 +263,7 @@ bool Glob::RecurseDirectory(std::string::size_type start, } } else { if (!this->Internals->Expressions.empty() && - this->Internals->Expressions.rbegin()->find(fname)) { + this->Internals->Expressions.back().find(fname)) { this->AddFile(this->Internals->Files, realname); } } diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in index bd4a176..4c3bde1 100644 --- a/Source/kwsys/Glob.hxx.in +++ b/Source/kwsys/Glob.hxx.in @@ -41,17 +41,9 @@ public: , content(c) { } - Message(const Message& msg) - : type(msg.type) - , content(msg.content) - { - } - Message& operator=(Message const& msg) - { - this->type = msg.type; - this->content = msg.content; - return *this; - } + ~Message() = default; + Message(const Message& msg) = default; + Message& operator=(Message const& msg) = default; }; typedef std::vector<Message> GlobMessages; diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index f323efc..4354753 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -4620,7 +4620,7 @@ std::string SystemInformationImplementation::RunProcess( // Run the application kwsysProcess* gp = kwsysProcess_New(); - kwsysProcess_SetCommand(gp, &*args.begin()); + kwsysProcess_SetCommand(gp, args.data()); kwsysProcess_SetOption(gp, kwsysProcess_Option_HideWindow, 1); kwsysProcess_Execute(gp); diff --git a/Source/kwsys/SystemInformation.hxx.in b/Source/kwsys/SystemInformation.hxx.in index 9e1ce6c..5e93878 100644 --- a/Source/kwsys/SystemInformation.hxx.in +++ b/Source/kwsys/SystemInformation.hxx.in @@ -56,6 +56,9 @@ public: SystemInformation(); ~SystemInformation(); + SystemInformation(const SystemInformation&) = delete; + SystemInformation& operator=(const SystemInformation&) = delete; + const char* GetVendorString(); const char* GetVendorID(); std::string GetTypeID(); diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index cbdfe11..33a92e4 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -416,6 +416,9 @@ public: { } ~Free() { free(const_cast<envchar*>(this->Env)); } + + Free(const Free&) = delete; + Free& operator=(const Free&) = delete; }; const envchar* Release(const envchar* env) @@ -473,7 +476,7 @@ void SystemTools::GetPath(std::vector<std::string>& path, const char* env) } // A hack to make the below algorithm work. - if (!pathEnv.empty() && *pathEnv.rbegin() != pathSep) { + if (!pathEnv.empty() && pathEnv.back() != pathSep) { pathEnv += pathSep; } std::string::size_type start = 0; @@ -1943,7 +1946,7 @@ void SystemTools::ConvertToUnixSlashes(std::string& path) // a single / pathCString = path.c_str(); size_t size = path.size(); - if (size > 1 && *path.rbegin() == '/') { + if (size > 1 && path.back() == '/') { // if it is c:/ then do not remove the trailing slash if (!((size == 3 && pathCString[1] == ':'))) { path.resize(size - 1); @@ -2692,7 +2695,7 @@ std::string SystemTools::FindName(const std::string& name, for (std::vector<std::string>::iterator i = path.begin(); i != path.end(); ++i) { std::string& p = *i; - if (p.empty() || *p.rbegin() != '/') { + if (p.empty() || p.back() != '/') { p += "/"; } } @@ -2810,7 +2813,7 @@ std::string SystemTools::FindProgram(const std::string& name, for (std::vector<std::string>::iterator i = path.begin(); i != path.end(); ++i) { std::string& p = *i; - if (p.empty() || *p.rbegin() != '/') { + if (p.empty() || p.back() != '/') { p += "/"; } } @@ -2888,7 +2891,7 @@ std::string SystemTools::FindLibrary(const std::string& name, for (std::vector<std::string>::iterator i = path.begin(); i != path.end(); ++i) { std::string& p = *i; - if (p.empty() || *p.rbegin() != '/') { + if (p.empty() || p.back() != '/') { p += "/"; } } @@ -3234,10 +3237,10 @@ void SystemTools::AddTranslationPath(const std::string& a, if (SystemTools::FileIsFullPath(path_b) && path_b.find("..") == std::string::npos) { // Before inserting make sure path ends with '/' - if (!path_a.empty() && *path_a.rbegin() != '/') { + if (!path_a.empty() && path_a.back() != '/') { path_a += '/'; } - if (!path_b.empty() && *path_b.rbegin() != '/') { + if (!path_b.empty() && path_b.back() != '/') { path_b += '/'; } if (!(path_a == path_b)) { @@ -3446,7 +3449,7 @@ std::string SystemTools::RelativePath(const std::string& local, // between each entry that does not already have one for (std::vector<std::string>::iterator vit1 = finalPath.begin(); vit1 != finalPath.end(); ++vit1) { - if (!relativePath.empty() && *relativePath.rbegin() != '/') { + if (!relativePath.empty() && relativePath.back() != '/') { relativePath += "/"; } relativePath += *vit1; @@ -3648,7 +3651,7 @@ void SystemTools::SplitPath(const std::string& p, } #endif if (!homedir.empty() && - (*homedir.rbegin() == '/' || *homedir.rbegin() == '\\')) { + (homedir.back() == '/' || homedir.back() == '\\')) { homedir.resize(homedir.size() - 1); } SystemTools::SplitPath(homedir, components); @@ -4016,7 +4019,7 @@ bool SystemTools::LocateFileInDir(const char* filename, const char* dir, filename_dir = SystemTools::GetFilenamePath(filename_dir); filename_dir_base = SystemTools::GetFilenameName(filename_dir); #if defined(_WIN32) - if (filename_dir_base.empty() || *filename_dir_base.rbegin() == ':') + if (filename_dir_base.empty() || filename_dir_base.back() == ':') #else if (filename_dir_base.empty()) #endif @@ -4092,7 +4095,7 @@ bool SystemTools::GetShortPath(const std::string& path, std::string& shortPath) std::string tempPath = path; // create a buffer // if the path passed in has quotes around it, first remove the quotes - if (!path.empty() && path[0] == '"' && *path.rbegin() == '"') { + if (!path.empty() && path[0] == '"' && path.back() == '"') { tempPath = path.substr(1, path.length() - 2); } @@ -4169,7 +4172,7 @@ bool SystemTools::GetLineFromStream(std::istream& is, std::string& line, bool haveData = !line.empty() || !is.eof(); if (!line.empty()) { // Avoid storing a carriage return character. - if (*line.rbegin() == '\r') { + if (line.back() == '\r') { line.resize(line.size() - 1); } @@ -4307,7 +4310,7 @@ bool SystemTools::IsSubDirectory(const std::string& cSubdir, if (subdir.size() <= dir.size() || dir.empty()) { return false; } - bool isRootPath = *dir.rbegin() == '/'; // like "/" or "C:/" + bool isRootPath = dir.back() == '/'; // like "/" or "C:/" size_t expectedSlashPosition = isRootPath ? dir.size() - 1u : dir.size(); if (subdir[expectedSlashPosition] != '/') { return false; diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 1967860..33b579f 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -54,6 +54,9 @@ class @KWSYS_NAMESPACE@_EXPORT SystemToolsManager public: SystemToolsManager(); ~SystemToolsManager(); + + SystemToolsManager(const SystemToolsManager&) = delete; + SystemToolsManager& operator=(const SystemToolsManager&) = delete; }; // This instance will show up in any translation unit that uses diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in index fc0d60e..0981c66 100644 --- a/Source/kwsys/hashtable.hxx.in +++ b/Source/kwsys/hashtable.hxx.in @@ -73,7 +73,7 @@ struct _Hashtable_node void public_method_to_quiet_warning_about_all_methods_private(); private: - void operator=(_Hashtable_node<_Val> const&); // poison node assignment + void operator=(_Hashtable_node<_Val> const&) = delete; }; template <class _Val, class _Key, class _HashFcn, class _ExtractKey, diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx index b77d729..cfd5666 100644 --- a/Source/kwsys/kwsysPlatformTestsCXX.cxx +++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx @@ -136,42 +136,6 @@ int main() } #endif -#ifdef TEST_KWSYS_LFS_WORKS -/* Return 0 when LFS is available and 1 otherwise. */ -# define _LARGEFILE_SOURCE -# define _LARGEFILE64_SOURCE -# define _LARGE_FILES -# define _FILE_OFFSET_BITS 64 -# include <sys/types.h> - -# include <assert.h> -# include <sys/stat.h> -# if KWSYS_CXX_HAS_CSTDIO -# include <cstdio> -# endif -# include <stdio.h> - -int main(int, char** argv) -{ -/* check that off_t can hold 2^63 - 1 and perform basic operations... */ -# define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62)) - if (OFF_T_64 % 2147483647 != 1) - return 1; - - // stat breaks on SCO OpenServer - struct stat buf; - stat(argv[0], &buf); - if (!S_ISREG(buf.st_mode)) - return 2; - - FILE* file = fopen(argv[0], "r"); - off_t offset = ftello(file); - fseek(file, offset, SEEK_CUR); - fclose(file); - return 0; -} -#endif - #ifdef TEST_KWSYS_CXX_HAS_SETENV # include <stdlib.h> int main() @@ -212,12 +176,6 @@ int main() #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 -# if defined(KWSYS_HAS_LFS) -# define _LARGEFILE_SOURCE -# define _LARGEFILE64_SOURCE -# define _LARGE_FILES -# define _FILE_OFFSET_BITS 64 -# endif # include <sys/resource.h> int main() { |