Skip to content

Commit af66ad2

Browse files
committed
Remove use of register keyword in headers
Headers must be C++ compatible -- this throws warnings. The register keyword is not used for optimization, at least not in optimized builds.
1 parent fbe50b1 commit af66ad2

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Zend/zend_hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ END_EXTERN_C()
248248

249249
static zend_always_inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx)
250250
{
251-
register const char *tmp = key;
251+
const char *tmp = key;
252252

253253
if (*tmp > '9') {
254254
return 0;

Zend/zend_operators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const
185185

186186
static zend_always_inline const void *zend_memrchr(const void *s, int c, size_t n)
187187
{
188-
register const unsigned char *e;
188+
const unsigned char *e;
189189
if (n <= 0) {
190190
return NULL;
191191
}

Zend/zend_string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static zend_always_inline zend_bool zend_string_equals(zend_string *s1, zend_str
323323

324324
static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size_t len)
325325
{
326-
register zend_ulong hash = Z_UL(5381);
326+
zend_ulong hash = Z_UL(5381);
327327

328328
/* variant with the hash unrolled eight times */
329329
for (; len >= 8; len -= 8) {

ext/standard/php_smart_string.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
smart_string_append_unsigned_ex((dest), (val), 0)
9494

9595
#define smart_string_appendc_ex(dest, ch, what) do { \
96-
register size_t __nl; \
96+
size_t __nl; \
9797
smart_string_alloc4((dest), 1, (what), __nl); \
9898
(dest)->len = __nl; \
9999
((unsigned char *) (dest)->c)[(dest)->len - 1] = (ch); \
@@ -109,7 +109,7 @@
109109
} while (0)
110110

111111
#define smart_string_appendl_ex(dest, src, nlen, what) do { \
112-
register size_t __nl; \
112+
size_t __nl; \
113113
smart_string *__dest = (smart_string *) (dest); \
114114
\
115115
smart_string_alloc4(__dest, (nlen), (what), __nl); \

main/php.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ END_EXTERN_C()
330330
BEGIN_EXTERN_C()
331331
PHPAPI extern int (*php_register_internal_extensions_func)(void);
332332
PHPAPI int php_register_internal_extensions(void);
333-
PHPAPI int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void *));
333+
PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const void *, const void *));
334334
PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata);
335335
PHPAPI void php_com_initialize(void);
336336
PHPAPI char *php_get_current_user(void);

main/snprintf.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap);
8686
PHPAPI int ap_php_asprintf(char **buf, const char *format, ...);
8787
PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
8888
PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf);
89-
PHPAPI char * php_conv_fp(register char format, register double num,
89+
PHPAPI char * php_conv_fp(char format, double num,
9090
boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, size_t *len);
9191

9292
END_EXTERN_C()
@@ -153,11 +153,11 @@ typedef enum {
153153
typedef WIDE_INT wide_int;
154154
typedef unsigned WIDE_INT u_wide_int;
155155

156-
PHPAPI char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned,
157-
register bool_int * is_negative, char *buf_end, register size_t *len);
156+
PHPAPI char * ap_php_conv_10(wide_int num, bool_int is_unsigned,
157+
bool_int * is_negative, char *buf_end, size_t *len);
158158

159-
PHPAPI char * ap_php_conv_p2(register u_wide_int num, register int nbits,
160-
char format, char *buf_end, register size_t *len);
159+
PHPAPI char * ap_php_conv_p2(u_wide_int num, int nbits,
160+
char format, char *buf_end, size_t *len);
161161

162162
/* The maximum precision that's allowed for float conversion. Does not include
163163
* decimal separator, exponent, sign, terminator. Currently does not affect

0 commit comments

Comments
 (0)