com php-src: Drop zend_long64 in favor of int6 4_t: Zend/zend_multiply.h Zend/zend_types.h
| From: | Nikita Popov | Date: | Thu, 16 Oct 2014 10:42:22 +0000 |
| Subject: | com php-src: Drop zend_long64 in favor of int6 4_t: Zend/zend_multiply.h Zend/zend_types.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82371@lists.php.net to get a copy of this message | ||
Commit: 2a9daf2e15fd145eb89c6b7cd9efa87afa5aa8cc
Author: Nikita Popov <nikic@php.net> Thu, 16 Oct 2014 12:10:24 +0200
Parents: 95278779304d6f513cb1cb5f60b9db75f5dc1981
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2a9daf2e15fd145eb89c6b7cd9efa87afa5aa8cc
Log:
Drop zend_long64 in favor of int64_t
Also drop ZEND_HAVE_LONG64, because we already require the
presence of a int64_t type.
Changed paths:
M Zend/zend_multiply.h
M Zend/zend_types.h
Diff:
diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
index 158be22..ad874ba 100644
--- a/Zend/zend_multiply.h
+++ b/Zend/zend_multiply.h
@@ -84,10 +84,10 @@
} \
} while (0)
-#elif SIZEOF_ZEND_LONG == 4 && defined(HAVE_ZEND_LONG64)
+#elif SIZEOF_ZEND_LONG == 4
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
- zend_long64 __result = (zend_long64) (a) * (zend_long64) (b); \
+ int64_t __result = (int64_t) (a) * (int64_t) (b); \
if (__result > ZEND_LONG_MAX || __result < ZEND_LONG_MIN) { \
(dval) = (double) __result; \
(usedval) = 1; \
@@ -206,13 +206,13 @@ static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size,
si
return res;
}
-#elif SIZEOF_SIZE_T == 4 && defined(HAVE_ZEND_LONG64)
+#elif SIZEOF_SIZE_T == 4
static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, size_t offset, int
*overflow)
{
- zend_ulong64 res = (zend_ulong64)nmemb * (zend_ulong64)size + (zend_ulong64)offset;
+ uint64_t res = (uint64_t) nmemb * (uint64_t) size + (uint64_t) offset;
- if (UNEXPECTED(res > (zend_ulong64)0xFFFFFFFFL)) {
+ if (UNEXPECTED(res > UINT64_C(0xFFFFFFFF))) {
*overflow = 1;
return 0;
}
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index e3818dd..eb7154f 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -64,20 +64,6 @@ typedef enum {
# endif
#endif
-#define HAVE_ZEND_LONG64
-#ifdef ZEND_WIN32
-typedef __int64 zend_long64;
-typedef unsigned __int64 zend_ulong64;
-#elif SIZEOF_LONG_LONG_INT == 8
-typedef long long int zend_long64;
-typedef unsigned long long int zend_ulong64;
-#elif SIZEOF_LONG_LONG == 8
-typedef long long zend_long64;
-typedef unsigned long long zend_ulong64;
-#else
-# undef HAVE_ZEND_LONG64
-#endif
-
/* XXX this won't work on X32 platform */
#ifdef ZEND_ENABLE_ZVAL_LONG64
typedef int64_t zend_intptr_t;