diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-08-13 07:48:01 -0400 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-08-13 07:48:01 -0400 |
commit | 297c63fa65327491a2b50e521b661c5835a19fe4 (patch) | |
tree | cf30d58014e240eb5e4417727d8f137cdbe75828 /Utilities | |
parent | ef8aa19c33e83ff019595fd7f8fdc29c35c336a3 (diff) | |
download | cmake-297c63fa65327491a2b50e521b661c5835a19fe4.tar.gz cmake-297c63fa65327491a2b50e521b661c5835a19fe4.tar.bz2 cmake-297c63fa65327491a2b50e521b661c5835a19fe4.zip |
Imported Upstream version 2.8.11.2upstream/2.8.11.2sandbox/pcoval/previous/upstream
Diffstat (limited to 'Utilities')
-rwxr-xr-x | Utilities/Git/pre-commit | 14 | ||||
-rw-r--r-- | Utilities/KWIML/ABI.h.in | 16 | ||||
-rw-r--r-- | Utilities/cmcurl/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Utilities/cmcurl/Platforms/WindowsCache.cmake | 1 | ||||
-rw-r--r-- | Utilities/cmcurl/Platforms/config-aix.h | 3 | ||||
-rw-r--r-- | Utilities/cmcurl/config.h.in | 3 | ||||
-rw-r--r-- | Utilities/cmcurl/socks.c | 11 | ||||
-rw-r--r-- | Utilities/cmcurl/strequal.c | 42 | ||||
-rw-r--r-- | Utilities/cmcurl/strequal.h | 5 | ||||
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_endian.h | 36 |
10 files changed, 62 insertions, 71 deletions
diff --git a/Utilities/Git/pre-commit b/Utilities/Git/pre-commit index d308a81b5..a35d11102 100755 --- a/Utilities/Git/pre-commit +++ b/Utilities/Git/pre-commit @@ -47,18 +47,16 @@ if test -z "$HOOKS_ALLOW_KWSYS"; then '"$(echo "$files" | sed 's/^/ /')"' -cannot be committed through Git. KWSys is kept in a CVS repository -shared by several projects. A robot replays changes committed there -into the Source/kwsys directory in CMake. Please send changes to -this directory separately. Run +should not be made directly in CMake. KWSys is kept in its own Git +repository and shared by several projects. Please visit - git reset HEAD -- Source/kwsys + http://public.kitware.com/Wiki/KWSys/Git -to unstage these changes and then +to contribute changes directly to KWSys. Run - git diff -- Source/kwsys > kwsys.patch + git reset HEAD -- Source/kwsys -to construct the patch. Alternatively, set environment variable +to unstage these changes. Alternatively, set environment variable HOOKS_ALLOW_KWSYS=1 diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in index 060a520db..b71cdfb9f 100644 --- a/Utilities/KWIML/ABI.h.in +++ b/Utilities/KWIML/ABI.h.in @@ -253,7 +253,9 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined. # else # define @KWIML@_ABI_SIZEOF_LONG_LONG 0 # endif -# elif defined(__hpux) && !defined(__GNUC__) /* Old HP: no __HP_cc/__HP_aCC above */ +# elif defined(__GNUC__) /* GNU */ +# define @KWIML@_ABI_SIZEOF_LONG_LONG 8 +# elif defined(__hpux) /* Old HP: no __HP_cc/__HP_aCC/__GNUC__ above */ # define @KWIML@_ABI_SIZEOF_LONG_LONG 8 # endif #endif @@ -414,6 +416,18 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined. #elif defined(__SYSC_ZARCH__) # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG +/* VAX */ +#elif defined(__vax__) +# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG + +/* Aarch64 */ +#elif defined(__aarch64__) +# if !defined(__AARCH64EB__) +# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE +# else +# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG +# endif + /* Unknown CPU */ #elif !defined(@KWIML@_ABI_NO_ERROR_ENDIAN) # error "Byte order of target CPU unknown." diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index ef000a16a..320612cf6 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -376,7 +376,6 @@ MARK_AS_ADVANCED(RANDOM_FILE) #sigaction \ #signal \ #getpass_r \ -#strlcat \ #getpwuid \ #geteuid \ #dlopen \ @@ -428,7 +427,6 @@ CHECK_SYMBOL_EXISTS(closesocket "${CURL_INCLUDES}" HAVE_CLOSESOCKET) CHECK_SYMBOL_EXISTS(setvbuf "${CURL_INCLUDES}" HAVE_SETVBUF) CHECK_SYMBOL_EXISTS(sigsetjmp "${CURL_INCLUDES}" HAVE_SIGSETJMP) CHECK_SYMBOL_EXISTS(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R) -CHECK_SYMBOL_EXISTS(strlcat "${CURL_INCLUDES}" HAVE_STRLCAT) CHECK_SYMBOL_EXISTS(getpwuid "${CURL_INCLUDES}" HAVE_GETPWUID) CHECK_SYMBOL_EXISTS(geteuid "${CURL_INCLUDES}" HAVE_GETEUID) CHECK_SYMBOL_EXISTS(utime "${CURL_INCLUDES}" HAVE_UTIME) diff --git a/Utilities/cmcurl/Platforms/WindowsCache.cmake b/Utilities/cmcurl/Platforms/WindowsCache.cmake index b4515ce04..57ab30be3 100644 --- a/Utilities/cmcurl/Platforms/WindowsCache.cmake +++ b/Utilities/cmcurl/Platforms/WindowsCache.cmake @@ -76,7 +76,6 @@ IF(NOT UNIX) SET(HAVE_SETVBUF 0) SET(HAVE_SIGSETJMP 0) SET(HAVE_GETPASS_R 0) - SET(HAVE_STRLCAT 0) SET(HAVE_GETPWUID 0) SET(HAVE_GETEUID 0) SET(HAVE_UTIME 1) diff --git a/Utilities/cmcurl/Platforms/config-aix.h b/Utilities/cmcurl/Platforms/config-aix.h index 86d10938f..c98b10fdd 100644 --- a/Utilities/cmcurl/Platforms/config-aix.h +++ b/Utilities/cmcurl/Platforms/config-aix.h @@ -343,9 +343,6 @@ /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 -/* Define to 1 if you have the `strlcat' function. */ -/* #undef HAVE_STRLCAT */ - /* Define to 1 if you have the `strlcpy' function. */ /* #undef HAVE_STRLCPY */ diff --git a/Utilities/cmcurl/config.h.in b/Utilities/cmcurl/config.h.in index e18af8ffe..148722b2f 100644 --- a/Utilities/cmcurl/config.h.in +++ b/Utilities/cmcurl/config.h.in @@ -441,9 +441,6 @@ /* Define to 1 if you have the <string.h> header file. */ #cmakedefine HAVE_STRING_H ${HAVE_STRING_H} -/* Define to 1 if you have the `strlcat' function. */ -#cmakedefine HAVE_STRLCAT ${HAVE_STRLCAT} - /* Define to 1 if you have the `strlcpy' function. */ #cmakedefine HAVE_STRLCPY ${HAVE_STRLCPY} diff --git a/Utilities/cmcurl/socks.c b/Utilities/cmcurl/socks.c index 3319e697e..e0e947b80 100644 --- a/Utilities/cmcurl/socks.c +++ b/Utilities/cmcurl/socks.c @@ -199,8 +199,15 @@ CURLcode Curl_SOCKS4(const char *proxy_name, * This is currently not supporting "Identification Protocol (RFC1413)". */ socksreq[8] = 0; /* ensure empty userid is NUL-terminated */ - if (proxy_name) - strlcat((char*)socksreq + 8, proxy_name, sizeof(socksreq) - 8); + if(proxy_name) { + size_t plen = strlen(proxy_name); + if(plen >= sizeof(socksreq) - 8) { + failf(data, "Too long SOCKS proxy name, can't use!\n"); + return CURLE_COULDNT_CONNECT; + } + /* copy the proxy name WITH trailing zero */ + memcpy(socksreq + 8, proxy_name, plen+1); + } /* * Make connection diff --git a/Utilities/cmcurl/strequal.c b/Utilities/cmcurl/strequal.c index 76ad5241f..83796f667 100644 --- a/Utilities/cmcurl/strequal.c +++ b/Utilities/cmcurl/strequal.c @@ -99,45 +99,3 @@ char *Curl_strcasestr(const char *haystack, const char *needle) } return NULL; } - -#ifndef HAVE_STRLCAT -/* - * The strlcat() function appends the NUL-terminated string src to the end - * of dst. It will append at most size - strlen(dst) - 1 bytes, NUL-termi- - * nating the result. - * - * The strlcpy() and strlcat() functions return the total length of the - * string they tried to create. For strlcpy() that means the length of src. - * For strlcat() that means the initial length of dst plus the length of - * src. While this may seem somewhat confusing it was done to make trunca- - * tion detection simple. - * - * - */ -size_t Curl_strlcat(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} -#endif diff --git a/Utilities/cmcurl/strequal.h b/Utilities/cmcurl/strequal.h index b3caa7345..6718c3c0e 100644 --- a/Utilities/cmcurl/strequal.h +++ b/Utilities/cmcurl/strequal.h @@ -35,9 +35,4 @@ /* case insensitive strstr() */ char *Curl_strcasestr(const char *haystack, const char *needle); -#ifndef HAVE_STRLCAT -#define strlcat(x,y,z) Curl_strlcat(x,y,z) -#endif -size_t strlcat(char *dst, const char *src, size_t siz); - #endif diff --git a/Utilities/cmlibarchive/libarchive/archive_endian.h b/Utilities/cmlibarchive/libarchive/archive_endian.h index bbf58fd10..3c039f702 100644 --- a/Utilities/cmlibarchive/libarchive/archive_endian.h +++ b/Utilities/cmlibarchive/libarchive/archive_endian.h @@ -64,7 +64,13 @@ archive_be16dec(const void *pp) { unsigned char const *p = (unsigned char const *)pp; - return ((p[0] << 8) | p[1]); + /* Store into unsigned temporaries before left shifting, to avoid + promotion to signed int and then left shifting into the sign bit, + which is undefined behaviour. */ + unsigned int p1 = p[1]; + unsigned int p0 = p[0]; + + return ((p0 << 8) | p1); } static inline uint32_t @@ -72,7 +78,15 @@ archive_be32dec(const void *pp) { unsigned char const *p = (unsigned char const *)pp; - return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); + /* Store into unsigned temporaries before left shifting, to avoid + promotion to signed int and then left shifting into the sign bit, + which is undefined behaviour. */ + unsigned int p3 = p[3]; + unsigned int p2 = p[2]; + unsigned int p1 = p[1]; + unsigned int p0 = p[0]; + + return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3); } static inline uint64_t @@ -88,7 +102,13 @@ archive_le16dec(const void *pp) { unsigned char const *p = (unsigned char const *)pp; - return ((p[1] << 8) | p[0]); + /* Store into unsigned temporaries before left shifting, to avoid + promotion to signed int and then left shifting into the sign bit, + which is undefined behaviour. */ + unsigned int p1 = p[1]; + unsigned int p0 = p[0]; + + return ((p1 << 8) | p0); } static inline uint32_t @@ -96,7 +116,15 @@ archive_le32dec(const void *pp) { unsigned char const *p = (unsigned char const *)pp; - return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]); + /* Store into unsigned temporaries before left shifting, to avoid + promotion to signed int and then left shifting into the sign bit, + which is undefined behaviour. */ + unsigned int p3 = p[3]; + unsigned int p2 = p[2]; + unsigned int p1 = p[1]; + unsigned int p0 = p[0]; + + return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0); } static inline uint64_t |