]> granicus.if.org Git - php/commitdiff
Replace usage of php_uint16 with uint16_t
authorRouven Weßling <rouven@contentful.com>
Fri, 29 Jan 2016 10:02:46 +0000 (11:02 +0100)
committerNikita Popov <nikic@php.net>
Thu, 4 Feb 2016 10:57:41 +0000 (11:57 +0100)
ext/phar/phar.c
ext/phar/phar_internal.h
ext/phar/zip.c

index cee438ad77926741d665b0875c2b76f18fafd655..54aa02bee6c0aa5000029cad5c49b9199ce52ab8 100644 (file)
@@ -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;
index 3f944c77db7b39b2379e9abf2eff4359e8d4cf45..610482b29069b98387fb0a4a81465d880b5a184f 100644 (file)
@@ -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;
index 688ca88a4572d7d0a02d26dbeca9b56d0b339161..4994dd0e040e559698e729f6718a60c9bf018578 100644 (file)
@@ -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;