Skip to content

Commit

Permalink
Remove use of register keyword in headers
Browse files Browse the repository at this point in the history
Headers must be C++ compatible -- this throws warnings.

The register keyword is not used for optimization, at least not
in optimized builds.
  • Loading branch information
nikic committed Feb 4, 2016
1 parent fbe50b1 commit af66ad2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Zend/zend_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ END_EXTERN_C()

static zend_always_inline int _zend_handle_numeric_str(const char *key, size_t length, zend_ulong *idx)
{
register const char *tmp = key;
const char *tmp = key;

if (*tmp > '9') {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const

static zend_always_inline const void *zend_memrchr(const void *s, int c, size_t n)
{
register const unsigned char *e;
const unsigned char *e;
if (n <= 0) {
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static zend_always_inline zend_bool zend_string_equals(zend_string *s1, zend_str

static zend_always_inline zend_ulong zend_inline_hash_func(const char *str, size_t len)
{
register zend_ulong hash = Z_UL(5381);
zend_ulong hash = Z_UL(5381);

/* variant with the hash unrolled eight times */
for (; len >= 8; len -= 8) {
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/php_smart_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
smart_string_append_unsigned_ex((dest), (val), 0)

#define smart_string_appendc_ex(dest, ch, what) do { \
register size_t __nl; \
size_t __nl; \
smart_string_alloc4((dest), 1, (what), __nl); \
(dest)->len = __nl; \
((unsigned char *) (dest)->c)[(dest)->len - 1] = (ch); \
Expand All @@ -109,7 +109,7 @@
} while (0)

#define smart_string_appendl_ex(dest, src, nlen, what) do { \
register size_t __nl; \
size_t __nl; \
smart_string *__dest = (smart_string *) (dest); \
\
smart_string_alloc4(__dest, (nlen), (what), __nl); \
Expand Down
2 changes: 1 addition & 1 deletion main/php.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
PHPAPI extern int (*php_register_internal_extensions_func)(void);
PHPAPI int php_register_internal_extensions(void);
PHPAPI int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void *));
PHPAPI int php_mergesort(void *base, size_t nmemb, size_t size, int (*cmp)(const void *, const void *));
PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata);
PHPAPI void php_com_initialize(void);
PHPAPI char *php_get_current_user(void);
Expand Down
10 changes: 5 additions & 5 deletions main/snprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap);
PHPAPI int ap_php_asprintf(char **buf, const char *format, ...);
PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf);
PHPAPI char * php_conv_fp(register char format, register double num,
PHPAPI char * php_conv_fp(char format, double num,
boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, size_t *len);

END_EXTERN_C()
Expand Down Expand Up @@ -153,11 +153,11 @@ typedef enum {
typedef WIDE_INT wide_int;
typedef unsigned WIDE_INT u_wide_int;

PHPAPI char * ap_php_conv_10(register wide_int num, register bool_int is_unsigned,
register bool_int * is_negative, char *buf_end, register size_t *len);
PHPAPI char * ap_php_conv_10(wide_int num, bool_int is_unsigned,
bool_int * is_negative, char *buf_end, size_t *len);

PHPAPI char * ap_php_conv_p2(register u_wide_int num, register int nbits,
char format, char *buf_end, register size_t *len);
PHPAPI char * ap_php_conv_p2(u_wide_int num, int nbits,
char format, char *buf_end, size_t *len);

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

0 comments on commit af66ad2

Please sign in to comment.