summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRouven Weßling <rouven@contentful.com>2016-01-29 11:02:46 +0100
committerNikita Popov <nikic@php.net>2016-02-04 11:57:41 +0100
commite93c28053d7d31853f59dc5adf0bfaff52819fb2 (patch)
treebac16becb31d6c8527f46a26be73def3519398a4
parenta61029b15554d1a5da81a6e6d498f02629bf4242 (diff)
downloadphp-git-e93c28053d7d31853f59dc5adf0bfaff52819fb2.tar.gz
Replace usage of php_uint16 with uint16_t
-rw-r--r--ext/phar/phar.c8
-rw-r--r--ext/phar/phar_internal.h7
-rw-r--r--ext/phar/zip.c12
3 files changed, 10 insertions, 17 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index cee438ad77..54aa02bee6 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -516,11 +516,11 @@ void phar_entry_remove(phar_entry_data *idata, char **error) /* {{{ */
memcpy(&var, buffer, sizeof(var)); \
buffer += 4
# define PHAR_GET_16(buffer, var) \
- var = *(php_uint16*)(buffer); \
+ var = *(uint16_t*)(buffer); \
buffer += 2
#endif
-#define PHAR_ZIP_16(var) ((php_uint16)((((php_uint16)var[0]) & 0xff) | \
- (((php_uint16)var[1]) & 0xff) << 8))
+#define PHAR_ZIP_16(var) ((uint16_t)((((uint16_t)var[0]) & 0xff) | \
+ (((uint16_t)var[1]) & 0xff) << 8))
#define PHAR_ZIP_32(var) ((uint32_t)((((uint32_t)var[0]) & 0xff) | \
(((uint32_t)var[1]) & 0xff) << 8 | \
(((uint32_t)var[2]) & 0xff) << 16 | \
@@ -655,7 +655,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
phar_archive_data *mydata = NULL;
phar_entry_info entry;
uint32_t manifest_len, manifest_count, manifest_flags, manifest_index, tmp_len, sig_flags;
- php_uint16 manifest_ver;
+ uint16_t manifest_ver;
uint32_t len;
zend_long offset;
int sig_len, register_alias = 0, temp_alias = 0;
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index 3f944c77db..610482b290 100644
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -199,13 +199,6 @@ ZEND_EXTERN_MODULE_GLOBALS(phar)
ZEND_TSRMLS_CACHE_EXTERN();
#endif
-#ifndef php_uint16
-# if SIZEOF_SHORT == 2
-# define php_uint16 unsigned short
-# else
-# define php_uint16 uint16_t
-# endif
-#endif
#include "pharzip.h"
typedef union _phar_archive_object phar_archive_object;
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 688ca88a45..4994dd0e04 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -18,8 +18,8 @@
#include "phar_internal.h"
-#define PHAR_GET_16(var) ((php_uint16)((((php_uint16)var[0]) & 0xff) | \
- (((php_uint16)var[1]) & 0xff) << 8))
+#define PHAR_GET_16(var) ((uint16_t)((((uint16_t)var[0]) & 0xff) | \
+ (((uint16_t)var[1]) & 0xff) << 8))
#define PHAR_GET_32(var) ((uint32_t)((((uint32_t)var[0]) & 0xff) | \
(((uint32_t)var[1]) & 0xff) << 8 | \
(((uint32_t)var[2]) & 0xff) << 16 | \
@@ -37,9 +37,9 @@ static inline void phar_write_16(char buffer[2], uint32_t value)
buffer[0] = (unsigned char) (value & 0xff);
}
# define PHAR_SET_32(var, value) phar_write_32(var, (uint32_t) (value));
-# define PHAR_SET_16(var, value) phar_write_16(var, (php_uint16) (value));
+# define PHAR_SET_16(var, value) phar_write_16(var, (uint16_t) (value));
-static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, php_uint16 len) /* {{{ */
+static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, uint16_t len) /* {{{ */
{
union {
phar_zip_extra_field_header header;
@@ -143,7 +143,7 @@ static time_t phar_zip_d2u_time(char *cdtime, char *cddate) /* {{{ */
static void phar_zip_u2d_time(time_t time, char *dtime, char *ddate) /* {{{ */
{
- php_uint16 ctime, cdate;
+ uint16_t ctime, cdate;
struct tm *tm, tmbuf;
tm = php_localtime_r(&time, &tmbuf);
@@ -168,7 +168,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
phar_zip_dir_end locator;
char buf[sizeof(locator) + 65536];
zend_long size;
- php_uint16 i;
+ uint16_t i;
phar_archive_data *mydata = NULL;
phar_entry_info entry = {0};
char *p = buf, *ext, *actual_alias = NULL;