summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2006-03-17 17:06:41 (GMT)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2006-03-17 17:06:41 (GMT)
commite9fcafafe52d01cc3b89190b3787bebd807198f0 (patch)
treefc258cf2774def39138c6fbde9780cef1cad4cb4
parentd5631f370b2355b69e5895734d8fe7e4c090e8cf (diff)
downloadCMake-e9fcafafe52d01cc3b89190b3787bebd807198f0.zip
CMake-e9fcafafe52d01cc3b89190b3787bebd807198f0.tar.gz
CMake-e9fcafafe52d01cc3b89190b3787bebd807198f0.tar.bz2
ENH: Use const char where it should have been. At same time fix Bug#2958
-rw-r--r--Source/kwsys/Directory.cxx3
-rw-r--r--Source/kwsys/Directory.hxx.in19
-rw-r--r--Source/kwsys/SystemTools.cxx6
-rw-r--r--Source/kwsys/SystemTools.hxx.in2
4 files changed, 14 insertions, 16 deletions
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx
index 79e8111..3f7e6ad 100644
--- a/Source/kwsys/Directory.cxx
+++ b/Source/kwsys/Directory.cxx
@@ -80,8 +80,7 @@ const char* Directory::GetPath() const
//----------------------------------------------------------------------------
void Directory::Clear()
{
- //this->Internal->Path.clear();
- this->Internal->Path = "";
+ this->Internal->Path.resize(0);
this->Internal->Files.clear();
}
diff --git a/Source/kwsys/Directory.hxx.in b/Source/kwsys/Directory.hxx.in
index 64d4184..22aafcc 100644
--- a/Source/kwsys/Directory.hxx.in
+++ b/Source/kwsys/Directory.hxx.in
@@ -23,30 +23,30 @@ class DirectoryInternals;
/** \class Directory
* \brief Portable directory/filename traversal.
- *
+ *
* Directory provides a portable way of finding the names of the files
* in a system directory.
*
* Directory currently works with Windows and Unix operating systems.
*/
-class @KWSYS_NAMESPACE@_EXPORT Directory
+class @KWSYS_NAMESPACE@_EXPORT Directory
{
public:
Directory();
~Directory();
-
+
/**
* Load the specified directory and load the names of the files
- * in that directory. 0 is returned if the directory can not be
- * opened, 1 if it is opened.
+ * in that directory. 0 is returned if the directory can not be
+ * opened, 1 if it is opened.
*/
bool Load(const char*);
-
+
/**
* Return the number of files in the current directory.
*/
unsigned long GetNumberOfFiles() const;
-
+
/**
* Return the file at the given index, the indexing is 0 based
*/
@@ -57,10 +57,9 @@ public:
*/
const char* GetPath() const;
-protected:
/**
- * Clear the internal structure. Used internally at beginning of Load(...) to clear
- * the cache.
+ * Clear the internal structure. Used internally at beginning of Load(...)
+ * to clear the cache.
*/
void Clear();
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 0096298..f54318c 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -359,10 +359,10 @@ bool SystemTools::MakeDirectory(const char* path)
// return EACCES when it should return EEXISTS
// if it is some other error besides directory exists
// then return false
- if( (errno != EEXIST)
+ if( (errno != EEXIST)
#ifdef __BORLANDC__
- && (errno != EACCES)
-#endif
+ && (errno != EACCES)
+#endif
)
{
return false;
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index a833b59..f0afa36 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -32,7 +32,7 @@
// after stdarg.h does not solve things because we do not have control over
// what the user does. This hack solves this problem by moving va_list to our
// own namespace that is local for kwsys.
-namespace std {} // Required for platforms that do not have std::
+namespace std {} // Required for platforms that do not have std::
namespace @KWSYS_NAMESPACE@_VA_LIST
{
using namespace std;