summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/Base64.c24
-rw-r--r--Source/kwsys/Base64.h.in18
-rw-r--r--Source/kwsys/EncodingC.c4
-rw-r--r--Source/kwsys/ProcessUNIX.c4
-rw-r--r--Source/kwsys/SystemTools.cxx11
-rw-r--r--Source/kwsys/Terminal.c1
-rw-r--r--Source/kwsys/kwsysPlatformTestsCXX.cxx4
7 files changed, 40 insertions, 26 deletions
diff --git a/Source/kwsys/Base64.c b/Source/kwsys/Base64.c
index d07bdd0..4b8ede2 100644
--- a/Source/kwsys/Base64.c
+++ b/Source/kwsys/Base64.c
@@ -115,10 +115,10 @@ void kwsysBase64_Encode1(const unsigned char *src, unsigned char *dest)
actually knowing how much data to expect (if the input is not a multiple of
3 bytes then the extra padding needed to complete the encode 4 bytes will
stop the decoding anyway). */
-unsigned long kwsysBase64_Encode(const unsigned char *input,
- unsigned long length,
- unsigned char *output,
- int mark_end)
+size_t kwsysBase64_Encode(const unsigned char *input,
+ size_t length,
+ unsigned char *output,
+ int mark_end)
{
const unsigned char *ptr = input;
const unsigned char *end = input + length;
@@ -157,7 +157,7 @@ unsigned long kwsysBase64_Encode(const unsigned char *input,
optr += 4;
}
- return (unsigned long)(optr - output);
+ return (size_t)(optr - output);
}
/*--------------------------------------------------------------------------*/
@@ -207,10 +207,10 @@ int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest)
'length' parameter is ignored. This enables the caller to decode a stream
without actually knowing how much decoded data to expect (of course, the
buffer must be large enough). */
-unsigned long kwsysBase64_Decode(const unsigned char *input,
- unsigned long length,
- unsigned char *output,
- unsigned long max_input_length)
+size_t kwsysBase64_Decode(const unsigned char *input,
+ size_t length,
+ unsigned char *output,
+ size_t max_input_length)
{
const unsigned char *ptr = input;
unsigned char *optr = output;
@@ -226,7 +226,7 @@ unsigned long kwsysBase64_Decode(const unsigned char *input,
optr += len;
if(len < 3)
{
- return (unsigned long)(optr - output);
+ return (size_t)(optr - output);
}
ptr += 4;
}
@@ -240,7 +240,7 @@ unsigned long kwsysBase64_Decode(const unsigned char *input,
optr += len;
if(len < 3)
{
- return (unsigned long)(optr - output);
+ return (size_t)(optr - output);
}
ptr += 4;
}
@@ -275,5 +275,5 @@ unsigned long kwsysBase64_Decode(const unsigned char *input,
}
}
- return (unsigned long)(optr - output);
+ return (size_t)(optr - output);
}
diff --git a/Source/kwsys/Base64.h.in b/Source/kwsys/Base64.h.in
index 3468007..36ed3cc 100644
--- a/Source/kwsys/Base64.h.in
+++ b/Source/kwsys/Base64.h.in
@@ -14,6 +14,8 @@
#include <@KWSYS_NAMESPACE@/Configure.h>
+#include <stddef.h> /* size_t */
+
/* Redefine all public interface symbol names to be in the proper
namespace. These macros are used internally to kwsys only, and are
not visible to user code. Use kwsysHeaderDump.pl to reproduce
@@ -68,10 +70,10 @@ kwsysEXPORT void kwsysBase64_Encode1(const unsigned char *src,
* the extra padding needed to complete the encode 4 bytes will stop
* the decoding anyway).
*/
-kwsysEXPORT unsigned long kwsysBase64_Encode(const unsigned char *input,
- unsigned long length,
- unsigned char *output,
- int mark_end);
+kwsysEXPORT size_t kwsysBase64_Encode(const unsigned char *input,
+ size_t length,
+ unsigned char *output,
+ int mark_end);
/**
* Decode 4 bytes into a 3 byte string. Returns the number of bytes
@@ -92,10 +94,10 @@ kwsysEXPORT int kwsysBase64_Decode3(const unsigned char *src,
* much decoded data to expect (of course, the buffer must be large
* enough).
*/
-kwsysEXPORT unsigned long kwsysBase64_Decode(const unsigned char *input,
- unsigned long length,
- unsigned char *output,
- unsigned long max_input_length);
+kwsysEXPORT size_t kwsysBase64_Decode(const unsigned char *input,
+ size_t length,
+ unsigned char *output,
+ size_t max_input_length);
#if defined(__cplusplus)
} /* extern "C" */
diff --git a/Source/kwsys/EncodingC.c b/Source/kwsys/EncodingC.c
index cda78e2..ba2cec2 100644
--- a/Source/kwsys/EncodingC.c
+++ b/Source/kwsys/EncodingC.c
@@ -44,7 +44,7 @@ wchar_t* kwsysEncoding_DupToWide(const char* str)
size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1;
if(length > 0)
{
- ret = malloc((length)*sizeof(wchar_t));
+ ret = (wchar_t*)malloc((length)*sizeof(wchar_t));
ret[0] = 0;
kwsysEncoding_mbstowcs(ret, str, length);
}
@@ -71,7 +71,7 @@ char* kwsysEncoding_DupToNarrow(const wchar_t* str)
size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1;
if(length > 0)
{
- ret = malloc(length);
+ ret = (char*)malloc(length);
ret[0] = 0;
kwsysEncoding_wcstombs(ret, str, length);
}
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index ca9d424..1be6d02 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -547,7 +547,7 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file)
}
if(file)
{
- *pfile = malloc(strlen(file)+1);
+ *pfile = (char*)malloc(strlen(file)+1);
if(!*pfile)
{
return 0;
@@ -1468,7 +1468,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp)
cp->RealWorkingDirectoryLength = 4096;
#endif
cp->RealWorkingDirectory =
- malloc((size_t)(cp->RealWorkingDirectoryLength));
+ (char*)malloc((size_t)(cp->RealWorkingDirectoryLength));
if(!cp->RealWorkingDirectory)
{
return 0;
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index e4c82d8..c2b6097 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -16,6 +16,14 @@
# define _XOPEN_SOURCE_EXTENDED
#endif
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
+# define KWSYS_WINDOWS_DIRS
+#else
+# if defined(__SUNPRO_CC)
+# include <fcntl.h>
+# endif
+#endif
+
#include "kwsysPrivate.h"
#include KWSYS_HEADER(RegularExpression.hxx)
#include KWSYS_HEADER(SystemTools.hxx)
@@ -205,8 +213,7 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft)
}
#endif
-#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
-
+#ifdef KWSYS_WINDOWS_DIRS
#include <wctype.h>
inline int Mkdir(const kwsys_stl::string& dir)
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c
index e13003f..d13f79a 100644
--- a/Source/kwsys/Terminal.c
+++ b/Source/kwsys/Terminal.c
@@ -175,6 +175,7 @@ static const char* kwsysTerminalVT100Names[] =
"xterm-88color",
"xterm-color",
"xterm-debian",
+ "xterm-termite",
0
};
diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx
index 3f947f3..82620da 100644
--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx
+++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx
@@ -548,6 +548,10 @@ int main()
#if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
# define _GNU_SOURCE
#endif
+#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \
+ && __linux && __SUNPRO_CC_COMPAT == 'G'
+# include <iostream>
+#endif
#include <cxxabi.h>
int main()
{