diff options
-rw-r--r-- | Zend/zend.c | 6 | ||||
-rw-r--r-- | Zend/zend.h | 10 | ||||
-rw-r--r-- | Zend/zend_API.c | 34 | ||||
-rw-r--r-- | Zend/zend_API.h | 60 | ||||
-rw-r--r-- | Zend/zend_alloc.c | 6 | ||||
-rw-r--r-- | Zend/zend_alloc.h | 22 | ||||
-rw-r--r-- | Zend/zend_builtin_functions.c | 14 | ||||
-rw-r--r-- | Zend/zend_compile.c | 4 | ||||
-rw-r--r-- | Zend/zend_constants.c | 12 | ||||
-rw-r--r-- | Zend/zend_constants.h | 16 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 4 | ||||
-rw-r--r-- | Zend/zend_hash.c | 8 | ||||
-rw-r--r-- | Zend/zend_hash.h | 38 | ||||
-rw-r--r-- | Zend/zend_ini.h | 12 | ||||
-rw-r--r-- | Zend/zend_ini_scanner.l | 10 | ||||
-rw-r--r-- | Zend/zend_language_parser.y | 12 | ||||
-rw-r--r-- | Zend/zend_language_scanner.l | 28 | ||||
-rw-r--r-- | Zend/zend_list.c | 12 | ||||
-rw-r--r-- | Zend/zend_list.h | 2 | ||||
-rw-r--r-- | Zend/zend_llist.c | 6 |
20 files changed, 158 insertions, 158 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index e0ce1dc046..bec445abca 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -103,7 +103,7 @@ static void print_hash(HashTable *ht, int indent) ZEND_PUTS(string_key); break; case HASH_KEY_IS_LONG: - zend_printf("%ld",num_key); + zend_printf("%ld", num_key); break; } ZEND_PUTS("] => "); @@ -183,7 +183,7 @@ ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int in } return 0; } - write_func(expr->value.str.val,expr->value.str.len); + write_func(expr->value.str.val, expr->value.str.len); if (use_copy) { zval_dtor(expr); } @@ -207,7 +207,7 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int expr->value.ht->nApplyCount=0; return; } - print_hash(expr->value.ht,indent); + print_hash(expr->value.ht, indent); expr->value.ht->nApplyCount--; break; case IS_OBJECT: diff --git a/Zend/zend.h b/Zend/zend.h index b93ff3ee72..c55e3a3b83 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -292,8 +292,8 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length); #undef MIN #undef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a, b) (((a)>(b))?(a):(b)) +#define MIN(a, b) (((a)<(b))?(a):(b)) #define ZEND_STRL(str) (str), (sizeof(str)-1) #define ZEND_STRS(str) (str), (sizeof(str)) #define ZEND_NORMALIZE_BOOL(n) \ @@ -490,15 +490,15 @@ ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval } \ INIT_PZVAL(&(zv)); -#define REPLACE_ZVAL_VALUE(ppzv_dest,pzv_src,copy) { \ - int is_ref,refcount; \ +#define REPLACE_ZVAL_VALUE(ppzv_dest, pzv_src, copy) { \ + int is_ref, refcount; \ \ SEPARATE_ZVAL_IF_NOT_REF(ppzv_dest); \ is_ref = (*ppzv_dest)->is_ref; \ refcount = (*ppzv_dest)->refcount; \ zval_dtor(*ppzv_dest); \ **ppzv_dest = *pzv_src; \ - if (copy) { \ + if (copy) { \ zval_copy_ctor(*ppzv_dest); \ } \ (*ppzv_dest)->is_ref = is_ref; \ diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 1cf03a147c..04bb78d8bb 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -593,7 +593,7 @@ ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC) } -ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)) +ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)) { zend_error(E_WARNING, "add_assoc_function() is no longer supported"); return FAILURE; @@ -686,7 +686,7 @@ ZEND_API int add_index_long(zval *arg, uint index, long n) MAKE_STD_ZVAL(tmp); ZVAL_LONG(tmp, n); - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL); + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -707,7 +707,7 @@ ZEND_API int add_index_bool(zval *arg, uint index, int b) MAKE_STD_ZVAL(tmp); ZVAL_BOOL(tmp, b); - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL); + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -718,7 +718,7 @@ ZEND_API int add_index_resource(zval *arg, uint index, int r) MAKE_STD_ZVAL(tmp); ZVAL_RESOURCE(tmp, r); - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL); + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -729,7 +729,7 @@ ZEND_API int add_index_double(zval *arg, uint index, double d) MAKE_STD_ZVAL(tmp); ZVAL_DOUBLE(tmp, d); - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL); + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); } @@ -823,7 +823,7 @@ ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate) MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, str, duplicate); - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *),NULL); + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); } @@ -834,7 +834,7 @@ ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int dupli MAKE_STD_ZVAL(tmp); ZVAL_STRINGL(tmp, str, length, duplicate); - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *),NULL); + return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); } @@ -895,7 +895,7 @@ ZEND_API int add_get_index_string(zval *arg, uint index, char *str, void **dest, MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, str, duplicate); - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),dest); + return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); } @@ -995,7 +995,7 @@ ZEND_API int zend_startup_module(zend_module_entry *module) TSRMLS_FETCH(); if (module->module_startup_func(MODULE_PERSISTENT, module->module_number TSRMLS_CC)==FAILURE) { - zend_error(E_CORE_ERROR,"Unable to start %s module",module->name); + zend_error(E_CORE_ERROR,"Unable to start %s module", module->name); return FAILURE; } } @@ -1012,7 +1012,7 @@ int zend_register_functions(zend_function_entry *functions, HashTable *function_ zend_function_entry *ptr = functions; zend_function function; zend_internal_function *internal_function = (zend_internal_function *)&function; - int count=0,unload=0; + int count=0, unload=0; HashTable *target_function_table = function_table; int error_type; @@ -1046,7 +1046,7 @@ int zend_register_functions(zend_function_entry *functions, HashTable *function_ if (unload) { /* before unloading, display all remaining bad function in the module */ while (ptr->fname) { if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) { - zend_error(error_type, "Function registration failed - duplicate name - %s",ptr->fname); + zend_error(error_type, "Function registration failed - duplicate name - %s", ptr->fname); } ptr++; } @@ -1087,14 +1087,14 @@ ZEND_API int zend_register_module(zend_module_entry *module) TSRMLS_FETCH(); #if 0 - zend_printf("%s: Registering module %d\n",module->name, module->module_number); + zend_printf("%s: Registering module %d\n", module->name, module->module_number); #endif if (module->functions && zend_register_functions(module->functions, NULL, module->type TSRMLS_CC)==FAILURE) { - zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load",module->name); + zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); return FAILURE; } module->module_started=1; - return zend_hash_add(&module_registry, module->name,strlen(module->name)+1,(void *)module,sizeof(zend_module_entry),NULL); + return zend_hash_add(&module_registry, module->name, strlen(module->name)+1, (void *)module, sizeof(zend_module_entry), NULL); } @@ -1111,7 +1111,7 @@ void module_destructor(zend_module_entry *module) if (module->module_started && module->module_shutdown_func) { #if 0 - zend_printf("%s: Module shutdown\n",module->name); + zend_printf("%s: Module shutdown\n", module->name); #endif module->module_shutdown_func(module->type, module->module_number TSRMLS_CC); } @@ -1133,7 +1133,7 @@ int module_registry_request_startup(zend_module_entry *module TSRMLS_DC) { if (module->request_startup_func) { #if 0 - zend_printf("%s: Request startup\n",module->name); + zend_printf("%s: Request startup\n", module->name); #endif if (module->request_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) { zend_error(E_WARNING, "request_startup() for %s module failed", module->name); @@ -1153,7 +1153,7 @@ int module_registry_cleanup(zend_module_entry *module TSRMLS_DC) case MODULE_PERSISTENT: if (module->request_shutdown_func) { #if 0 - zend_printf("%s: Request shutdown\n",module->name); + zend_printf("%s: Request shutdown\n", module->name); #endif module->request_shutdown_func(module->type, module->module_number TSRMLS_CC); } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 2ba60c2553..2da610dc65 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -161,7 +161,7 @@ ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC); ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC); /* no longer supported */ -ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)); +ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)); ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n); ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len); @@ -240,7 +240,7 @@ ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, int is_ref, int num_symbol_tables, ...); -#define add_method(arg,key,method) add_assoc_function((arg),(key),(method)) +#define add_method(arg, key, method) add_assoc_function((arg), (key), (method)) #if ZEND_DEBUG #define CHECK_ZVAL_STRING(z) \ @@ -252,12 +252,12 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, #define CHECK_ZVAL_STRING_REL(z) #endif -#define ZVAL_RESOURCE(z,l) { \ +#define ZVAL_RESOURCE(z, l) { \ (z)->type = IS_RESOURCE; \ (z)->value.lval = l; \ } -#define ZVAL_BOOL(z,b) { \ +#define ZVAL_BOOL(z, b) { \ (z)->type = IS_BOOL; \ (z)->value.lval = b; \ } @@ -266,27 +266,27 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, (z)->type = IS_NULL; \ } -#define ZVAL_LONG(z,l) { \ +#define ZVAL_LONG(z, l) { \ (z)->type = IS_LONG; \ (z)->value.lval = l; \ } -#define ZVAL_DOUBLE(z,d) { \ +#define ZVAL_DOUBLE(z, d) { \ (z)->type = IS_DOUBLE; \ (z)->value.dval = d; \ } -#define ZVAL_STRING(z,s,duplicate) { \ +#define ZVAL_STRING(z, s, duplicate) { \ char *__s=(s); \ (z)->value.str.len = strlen(__s); \ - (z)->value.str.val = (duplicate?estrndup(__s,(z)->value.str.len):__s); \ + (z)->value.str.val = (duplicate?estrndup(__s, (z)->value.str.len):__s); \ (z)->type = IS_STRING; \ } -#define ZVAL_STRINGL(z,s,l,duplicate) { \ +#define ZVAL_STRINGL(z, s, l, duplicate) { \ char *__s=(s); int __l=l; \ (z)->value.str.len = __l; \ - (z)->value.str.val = (duplicate?estrndup(__s,__l):__s); \ + (z)->value.str.val = (duplicate?estrndup(__s, __l):__s); \ (z)->type = IS_STRING; \ } @@ -296,63 +296,63 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, (z)->type = IS_STRING; \ } -#define ZVAL_FALSE(z) ZVAL_BOOL(z,0) -#define ZVAL_TRUE(z) ZVAL_BOOL(z,1) +#define ZVAL_FALSE(z) ZVAL_BOOL(z, 0) +#define ZVAL_TRUE(z) ZVAL_BOOL(z, 1) -#define RETVAL_RESOURCE(l) ZVAL_RESOURCE(return_value,l) -#define RETVAL_BOOL(b) ZVAL_BOOL(return_value,b) +#define RETVAL_RESOURCE(l) ZVAL_RESOURCE(return_value, l) +#define RETVAL_BOOL(b) ZVAL_BOOL(return_value, b) #define RETVAL_NULL() ZVAL_NULL(return_value) -#define RETVAL_LONG(l) ZVAL_LONG(return_value,l) -#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value,d) -#define RETVAL_STRING(s,duplicate) ZVAL_STRING(return_value,s,duplicate) -#define RETVAL_STRINGL(s,l,duplicate) ZVAL_STRINGL(return_value,s,l,duplicate) +#define RETVAL_LONG(l) ZVAL_LONG(return_value, l) +#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value, d) +#define RETVAL_STRING(s, duplicate) ZVAL_STRING(return_value, s, duplicate) +#define RETVAL_STRINGL(s, l, duplicate) ZVAL_STRINGL(return_value, s, l, duplicate) #define RETVAL_EMPTY_STRING() ZVAL_EMPTY_STRING(return_value) -#define RETVAL_FALSE ZVAL_BOOL(return_value,0) -#define RETVAL_TRUE ZVAL_BOOL(return_value,1) +#define RETVAL_FALSE ZVAL_BOOL(return_value, 0) +#define RETVAL_TRUE ZVAL_BOOL(return_value, 1) #define RETURN_RESOURCE(l) { RETVAL_RESOURCE(l); return; } #define RETURN_BOOL(b) { RETVAL_BOOL(b); return; } #define RETURN_NULL() { RETVAL_NULL(); return;} #define RETURN_LONG(l) { RETVAL_LONG(l); return; } #define RETURN_DOUBLE(d) { RETVAL_DOUBLE(d); return; } -#define RETURN_STRING(s,duplicate) { RETVAL_STRING(s,duplicate); return; } -#define RETURN_STRINGL(s,l,duplicate) { RETVAL_STRINGL(s,l,duplicate); return; } +#define RETURN_STRING(s, duplicate) { RETVAL_STRING(s, duplicate); return; } +#define RETURN_STRINGL(s, l, duplicate) { RETVAL_STRINGL(s, l, duplicate); return; } #define RETURN_EMPTY_STRING() { RETVAL_EMPTY_STRING(); return; } #define RETURN_FALSE { RETVAL_FALSE; return; } #define RETURN_TRUE { RETVAL_TRUE; return; } -#define SET_VAR_STRING(n,v) { \ +#define SET_VAR_STRING(n, v) { \ { \ zval *var; \ ALLOC_ZVAL(var); \ - ZVAL_STRING(var,v,0); \ + ZVAL_STRING(var, v, 0); \ ZEND_SET_GLOBAL_VAR(n, var); \ } \ } -#define SET_VAR_STRINGL(n,v,l) { \ +#define SET_VAR_STRINGL(n, v, l) { \ { \ zval *var; \ ALLOC_ZVAL(var); \ - ZVAL_STRINGL(var,v,l,0); \ + ZVAL_STRINGL(var, v, l, 0); \ ZEND_SET_GLOBAL_VAR(n, var); \ } \ } -#define SET_VAR_LONG(n,v) { \ +#define SET_VAR_LONG(n, v) { \ { \ zval *var; \ ALLOC_ZVAL(var); \ - ZVAL_LONG(var,v); \ + ZVAL_LONG(var, v); \ ZEND_SET_GLOBAL_VAR(n, var); \ } \ } -#define SET_VAR_DOUBLE(n,v) { \ +#define SET_VAR_DOUBLE(n, v) { \ { \ zval *var; \ ALLOC_ZVAL(var); \ - ZVAL_DOUBLE(var,v); \ + ZVAL_DOUBLE(var, v); \ ZEND_SET_GLOBAL_VAR(n, var); \ } \ } diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 9b06d1b2cf..0a9891fea6 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -61,7 +61,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC; # if ZEND_DEBUG #define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, __zend_filename, __zend_lineno) # else -#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, NULL,0) +#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, NULL, 0) # endif #define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\ @@ -72,7 +72,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC; } \ if (!AG(memory_exhausted)) { \ if (!file) { \ - zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \ + zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit), s); \ } else { \ zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \ } \ @@ -295,7 +295,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN HANDLE_BLOCK_INTERRUPTIONS(); REMOVE_POINTER_FROM_LIST(p); - p = (zend_mem_header *) ZEND_DO_REALLOC(p,sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE); + p = (zend_mem_header *) ZEND_DO_REALLOC(p, sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE); if (!p) { if (!allow_failure) { fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size); diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 7afda73737..83962eda71 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -84,11 +84,11 @@ ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); /* Standard wrapper macros */ #define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) #define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define ecalloc(nmemb,size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define erealloc(ptr,size) _erealloc((ptr), (size),0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define erealloc_recoverable(ptr,size) _erealloc((ptr), (size),1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) #define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define estrndup(s,length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) +#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) #define persist_alloc(p) _persist_alloc((p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) /* Relay wrapper macros */ @@ -102,15 +102,15 @@ ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); #define persist_alloc_rel(p) _persist_alloc((p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) /* Selective persistent/non persistent allocation macros */ -#define pemalloc(size,persistent) ((persistent)?malloc(size):emalloc(size)) -#define pefree(ptr,persistent) ((persistent)?free(ptr):efree(ptr)) -#define pecalloc(nmemb,size,persistent) ((persistent)?calloc((nmemb),(size)):ecalloc((nmemb),(size))) -#define perealloc(ptr,size,persistent) ((persistent)?realloc((ptr),(size)):erealloc((ptr),(size))) -#define perealloc_recoverable(ptr,size,persistent) ((persistent)?realloc((ptr),(size)):erealloc_recoverable((ptr),(size))) -#define pestrdup(s,persistent) ((persistent)?strdup(s):estrdup(s)) +#define pemalloc(size, persistent) ((persistent)?malloc(size):emalloc(size)) +#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr)) +#define pecalloc(nmemb, size, persistent) ((persistent)?calloc((nmemb), (size)):ecalloc((nmemb), (size))) +#define perealloc(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc((ptr), (size))) +#define perealloc_recoverable(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable((ptr), (size))) +#define pestrdup(s, persistent) ((persistent)?strdup(s):estrdup(s)) #define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string)) -#define safe_estrndup(ptr,len) ((ptr)?(estrndup((ptr),(len))):(empty_string)) +#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string)) ZEND_API int zend_set_memory_limit(unsigned int memory_limit); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 344fd3d1c0..4f6e457cb5 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -251,7 +251,7 @@ ZEND_FUNCTION(strcmp) } convert_to_string_ex(s1); convert_to_string_ex(s2); - RETURN_LONG(zend_binary_zval_strcmp(*s1,*s2)); + RETURN_LONG(zend_binary_zval_strcmp(*s1, *s2)); } /* }}} */ @@ -267,7 +267,7 @@ ZEND_FUNCTION(strncmp) convert_to_string_ex(s1); convert_to_string_ex(s2); convert_to_long_ex(s3); - RETURN_LONG(zend_binary_zval_strncmp(*s1,*s2,*s3)); + RETURN_LONG(zend_binary_zval_strncmp(*s1, *s2, *s3)); } /* }}} */ @@ -298,13 +298,13 @@ ZEND_FUNCTION(strncasecmp) convert_to_string_ex(s1); convert_to_string_ex(s2); convert_to_long_ex(s3); - RETURN_LONG(zend_binary_zval_strncasecmp(*s1,*s2,*s3)); + RETURN_LONG(zend_binary_zval_strncasecmp(*s1, *s2, *s3)); } /* }}} */ ZEND_FUNCTION(each) { - zval **array,*entry,**entry_ptr, *tmp; + zval **array, *entry, **entry_ptr, *tmp; char *string_key; ulong num_key; zval **inserted_pointer; @@ -342,10 +342,10 @@ ZEND_FUNCTION(each) /* add the key elements */ switch (zend_hash_get_current_key(target_hash, &string_key, &num_key, 1)) { case HASH_KEY_IS_STRING: - add_get_index_string(return_value,0,string_key,(void **) &inserted_pointer,0); + add_get_index_string(return_value, 0, string_key, (void **) &inserted_pointer, 0); break; case HASH_KEY_IS_LONG: - add_get_index_long(return_value,0,num_key, (void **) &inserted_pointer); + add_get_index_long(return_value, 0, num_key, (void **) &inserted_pointer); break; } zend_hash_update(return_value->value.ht, "key", sizeof("key"), inserted_pointer, sizeof(zval *), NULL); @@ -363,7 +363,7 @@ ZEND_FUNCTION(error_reporting) case 0: break; case 1: - if (zend_get_parameters_ex(1,&arg) == FAILURE) { + if (zend_get_parameters_ex(1, &arg) == FAILURE) { RETURN_FALSE; } convert_to_long_ex(arg); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index e4ca86e726..d6ca4de280 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -810,7 +810,7 @@ int zend_do_begin_function_call(znode *function_name TSRMLS_DC) zend_function *function; zend_str_tolower(function_name->u.constant.value.str.val, function_name->u.constant.value.str.len); - if (zend_hash_find(CG(function_table), function_name->u.constant.value.str.val,function_name->u.constant.value.str.len+1, (void **) &function)==FAILURE) { + if (zend_hash_find(CG(function_table), function_name->u.constant.value.str.val, function_name->u.constant.value.str.len+1, (void **) &function)==FAILURE) { znode tmp = *function_name; zval_copy_ctor(&tmp.u.constant); @@ -1772,7 +1772,7 @@ void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC) opline->opcode = ZEND_DO_FCALL; opline->result.u.var = get_temporary_variable(CG(active_op_array)); opline->result.op_type = IS_VAR; - opline->op1.u.constant.value.str.val = estrndup("shell_exec",sizeof("shell_exec")-1); + opline->op1.u.constant.value.str.val = estrndup("shell_exec", sizeof("shell_exec")-1); opline->op1.u.constant.value.str.len = sizeof("shell_exec")-1; INIT_PZVAL(&opline->op1.u.constant); opline->op1.u.constant.type = IS_STRING; diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index d76619ccbf..556037aa7a 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -167,7 +167,7 @@ ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, c.value.type = IS_LONG; c.value.value.lval = lval; c.flags = flags; - c.name = zend_strndup(name,name_len); + c.name = zend_strndup(name, name_len); c.name_len = name_len; c.module_number = module_number; zend_register_constant(&c TSRMLS_CC); @@ -181,7 +181,7 @@ ZEND_API void zend_register_double_constant(char *name, uint name_len, double dv c.value.type = IS_DOUBLE; c.value.value.dval = dval; c.flags = flags; - c.name = zend_strndup(name,name_len); + c.name = zend_strndup(name, name_len); c.name_len = name_len; c.module_number = module_number; zend_register_constant(&c TSRMLS_CC); @@ -196,7 +196,7 @@ ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *st c.value.value.str.val = strval; c.value.value.str.len = strlen; c.flags = flags; - c.name = zend_strndup(name,name_len); + c.name = zend_strndup(name, name_len); c.name_len = name_len; c.module_number = module_number; zend_register_constant(&c TSRMLS_CC); @@ -212,7 +212,7 @@ ZEND_API void zend_register_string_constant(char *name, uint name_len, char *str ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC) { zend_constant *c; - char *lookup_name = estrndup(name,name_len); + char *lookup_name = estrndup(name, name_len); int retval; zend_str_tolower(lookup_name, name_len); @@ -240,14 +240,14 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) int ret = SUCCESS; #if 0 - printf("Registering constant for module %d\n",c->module_number); + printf("Registering constant for module %d\n", c->module_number); #endif zend_str_tolower(lowercase_name, c->name_len); if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { free(c->name); zval_dtor(&c->value); - zend_error(E_NOTICE,"Constant %s already defined",lowercase_name); + zend_error(E_NOTICE,"Constant %s already defined", lowercase_name); ret = FAILURE; } free(lowercase_name); diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h index 0540418506..d8491460c4 100644 --- a/Zend/zend_constants.h +++ b/Zend/zend_constants.h @@ -34,15 +34,15 @@ typedef struct _zend_constant { int module_number; } zend_constant; -#define REGISTER_LONG_CONSTANT(name,lval,flags) zend_register_long_constant((name),sizeof(name),(lval),(flags),module_number TSRMLS_CC) -#define REGISTER_DOUBLE_CONSTANT(name,dval,flags) zend_register_double_constant((name),sizeof(name),(dval),(flags),module_number TSRMLS_CC) -#define REGISTER_STRING_CONSTANT(name,str,flags) zend_register_string_constant((name),sizeof(name),(str),(flags),module_number TSRMLS_CC) -#define REGISTER_STRINGL_CONSTANT(name,str,len,flags) zend_register_stringl_constant((name),sizeof(name),(str),(len),(flags),module_number TSRMLS_CC) +#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC) +#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC) +#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC) +#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC) -#define REGISTER_MAIN_LONG_CONSTANT(name,lval,flags) zend_register_long_constant((name),sizeof(name),(lval),(flags),0 TSRMLS_CC) -#define REGISTER_MAIN_DOUBLE_CONSTANT(name,dval,flags) zend_register_double_constant((name),sizeof(name),(dval),(flags),0 TSRMLS_CC) -#define REGISTER_MAIN_STRING_CONSTANT(name,str,flags) zend_register_string_constant((name),sizeof(name),(str),(flags),0 TSRMLS_CC) -#define REGISTER_MAIN_STRINGL_CONSTANT(name,str,len,flags) zend_register_stringl_constant((name),sizeof(name),(str),(len),(flags),0 TSRMLS_CC) +#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC) +#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC) +#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC) +#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), 0 TSRMLS_CC) void clean_module_constants(int module_number TSRMLS_DC); void free_zend_constant(zend_constant *c); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 971d00fe0b..069d252295 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -692,7 +692,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa } break; default: - return DefWindowProc(hWnd,message,wParam,lParam); + return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } @@ -779,7 +779,7 @@ void zend_set_timeout(long seconds) signal(SIGPROF, zend_timeout); sigemptyset(&sigset); sigaddset(&sigset, SIGPROF); - sigprocmask(SIG_UNBLOCK,&sigset,NULL); + sigprocmask(SIG_UNBLOCK, &sigset, NULL); } # endif #endif diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 12fbfd35dc..3c24cf4f9f 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -97,7 +97,7 @@ static void _zend_is_inconsistent(HashTable *ht, char *file, int line) } zend_bailout(); } -#define IS_CONSISTENT(a) _zend_is_inconsistent(a,__FILE__,__LINE__); +#define IS_CONSISTENT(a) _zend_is_inconsistent(a, __FILE__, __LINE__); #define SET_INCONSISTENT(n) ht->inconsistent = n; #else #define IS_CONSISTENT(a) @@ -1232,7 +1232,7 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar) (const void *, const void *), int flag, void **pData) { - Bucket *p,*res; + Bucket *p, *res; IS_CONSISTENT(ht); @@ -1244,11 +1244,11 @@ ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar) (const void *, const res = p = ht->pListHead; while ((p = p->pListNext)) { if (flag) { - if (compar(&res,&p) < 0) { /* max */ + if (compar(&res, &p) < 0) { /* max */ res = p; } } else { - if (compar(&res,&p) > 0) { /* min */ + if (compar(&res, &p) > 0) { /* min */ res = p; } } diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 76010776ad..5bcd62d333 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -82,23 +82,23 @@ ZEND_API void zend_hash_destroy(HashTable *ht); ZEND_API void zend_hash_clean(HashTable *ht); /* additions/updates/changes */ -ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest,int flag); -#define zend_hash_update(ht,arKey,nKeyLength,pData,nDataSize,pDest) \ - zend_hash_add_or_update(ht,arKey,nKeyLength,pData,nDataSize,pDest,HASH_UPDATE) -#define zend_hash_add(ht,arKey,nKeyLength,pData,nDataSize,pDest) \ - zend_hash_add_or_update(ht,arKey,nKeyLength,pData,nDataSize,pDest,HASH_ADD) - -ZEND_API int zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest,int flag); -#define zend_hash_quick_update(ht,arKey,nKeyLength,h,pData,nDataSize,pDest) \ - zend_hash_quick_add_or_update(ht,arKey,nKeyLength,h,pData,nDataSize,pDest,HASH_UPDATE) -#define zend_hash_quick_add(ht,arKey,nKeyLength,h,pData,nDataSize,pDest) \ - zend_hash_quick_add_or_update(ht,arKey,nKeyLength,h,pData,nDataSize,pDest,HASH_ADD) +ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag); +#define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ + zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE) +#define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ + zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD) + +ZEND_API int zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag); +#define zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ + zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE) +#define zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ + zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD) ZEND_API int zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag); -#define zend_hash_index_update(ht,h,pData,nDataSize,pDest) \ - zend_hash_index_update_or_next_insert(ht,h,pData,nDataSize,pDest,HASH_UPDATE) -#define zend_hash_next_index_insert(ht,pData,nDataSize,pDest) \ - zend_hash_index_update_or_next_insert(ht,0,pData,nDataSize,pDest,HASH_NEXT_INSERT) +#define zend_hash_index_update(ht, h, pData, nDataSize, pDest) \ + zend_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE) +#define zend_hash_next_index_insert(ht, pData, nDataSize, pDest) \ + zend_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT) ZEND_API int zend_hash_add_empty_element(HashTable *ht, char *arKey, uint nKeyLength); @@ -134,10 +134,10 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR /* Deletes */ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag); -#define zend_hash_del(ht,arKey,nKeyLength) \ - zend_hash_del_key_or_index(ht,arKey,nKeyLength,0,HASH_DEL_KEY) -#define zend_hash_index_del(ht,h) \ - zend_hash_del_key_or_index(ht,NULL,0,h,HASH_DEL_INDEX) +#define zend_hash_del(ht, arKey, nKeyLength) \ + zend_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY) +#define zend_hash_index_del(ht, h) \ + zend_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX) ZEND_API ulong zend_get_hash_value(HashTable *ht, char *arKey, uint nKeyLength); diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index 47a13091d4..43fd272f7d 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -29,29 +29,29 @@ #ifndef XtOffsetOf # if defined(CRAY) || (defined(__arm) && !defined(LINUX)) # ifdef __STDC__ -# define XtOffset(p_type,field) _Offsetof(p_type,field) +# define XtOffset(p_type, field) _Offsetof(p_type, field) # else # ifdef CRAY2 -# define XtOffset(p_type,field) \ +# define XtOffset(p_type, field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) # else /* !CRAY2 */ -# define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) +# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) # endif /* !CRAY2 */ # endif /* __STDC__ */ # else /* ! (CRAY || __arm) */ -# define XtOffset(p_type,field) \ +# define XtOffset(p_type, field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) # endif /* !CRAY */ # ifdef offsetof -# define XtOffsetOf(s_type,field) offsetof(s_type,field) +# define XtOffsetOf(s_type, field) offsetof(s_type, field) # else -# define XtOffsetOf(s_type,field) XtOffset(s_type*,field) +# define XtOffsetOf(s_type, field) XtOffset(s_type*, field) # endif #endif diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index 1a19c17133..5c802aa72c 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -172,7 +172,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>[ ]*("true"|"on"|"yes")[ ]* { - ini_lval->value.str.val = zend_strndup("1",1); + ini_lval->value.str.val = zend_strndup("1", 1); ini_lval->value.str.len = 1; ini_lval->type = IS_STRING; return CFG_TRUE; @@ -180,7 +180,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>[ ]*("false"|"off"|"no"|"none")[ ]* { - ini_lval->value.str.val = zend_strndup("",0); + ini_lval->value.str.val = zend_strndup("", 0); ini_lval->value.str.len = 0; ini_lval->type = IS_STRING; return CFG_FALSE; @@ -199,7 +199,7 @@ NEWLINE ("\r"|"\n"|"\r\n") yytext++; yyleng--; - ini_lval->value.str.val = zend_strndup(yytext,yyleng); + ini_lval->value.str.val = zend_strndup(yytext, yyleng); ini_lval->value.str.len = yyleng; ini_lval->type = IS_STRING; return SECTION; @@ -249,7 +249,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } } if (yyleng!=0) { - ini_lval->value.str.val = zend_strndup(yytext,yyleng); + ini_lval->value.str.val = zend_strndup(yytext, yyleng); ini_lval->value.str.len = yyleng; ini_lval->type = IS_STRING; return TC_STRING; @@ -279,7 +279,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>. { #if DEBUG - php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n",yylineno,yytext,yytext[0]); + php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n", yylineno, yytext, yytext[0]); #endif } diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index a3679d4677..97d4181032 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -445,12 +445,12 @@ expr_without_variable: | expr '|' expr { zend_do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } | expr '&' expr { zend_do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } | expr '^' expr { zend_do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '.' expr { zend_do_binary_op(ZEND_CONCAT,&$$,&$1,&$3 TSRMLS_CC); } - | expr '+' expr { zend_do_binary_op(ZEND_ADD,&$$,&$1,&$3 TSRMLS_CC); } - | expr '-' expr { zend_do_binary_op(ZEND_SUB,&$$,&$1,&$3 TSRMLS_CC); } - | expr '*' expr { zend_do_binary_op(ZEND_MUL,&$$,&$1,&$3 TSRMLS_CC); } - | expr '/' expr { zend_do_binary_op(ZEND_DIV,&$$,&$1,&$3 TSRMLS_CC); } - | expr '%' expr { zend_do_binary_op(ZEND_MOD,&$$,&$1,&$3 TSRMLS_CC); } + | expr '.' expr { zend_do_binary_op(ZEND_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } + | expr '+' expr { zend_do_binary_op(ZEND_ADD, &$$, &$1, &$3 TSRMLS_CC); } + | expr '-' expr { zend_do_binary_op(ZEND_SUB, &$$, &$1, &$3 TSRMLS_CC); } + | expr '*' expr { zend_do_binary_op(ZEND_MUL, &$$, &$1, &$3 TSRMLS_CC); } + | expr '/' expr { zend_do_binary_op(ZEND_DIV, &$$, &$1, &$3 TSRMLS_CC); } + | expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); } | expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); } | expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 TSRMLS_CC); } | '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index f1bd0393b6..ec491a2ca0 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -98,9 +98,9 @@ ZEND_API zend_scanner_globals language_scanner_globals; #define YY_FATAL_ERROR zend_fatal_scanner_error -#define HANDLE_NEWLINES(s,l) \ +#define HANDLE_NEWLINES(s, l) \ do { \ - char *p = (s),*boundary = p+(l); \ + char *p = (s), *boundary = p+(l); \ \ while (p<boundary) { \ if (*p == '\n') { \ @@ -150,7 +150,7 @@ END_EXTERN_C() static inline void save_lexical_state(zend_lex_state *lex_state TSRMLS_DC) { #ifndef __cplusplus - memcpy(&lex_state->buffer_state,&YY_CURRENT_BUFFER,sizeof(YY_BUFFER_STATE)); + memcpy(&lex_state->buffer_state, &YY_CURRENT_BUFFER, sizeof(YY_BUFFER_STATE)); lex_state->in = yyin; lex_state->state = YYSTATE; #else @@ -1008,7 +1008,7 @@ NEWLINE ("\r"|"\n"|"\r\n") errno = 0; zendlval->value.lval = strtol(yytext, NULL, 0); if (errno == ERANGE) { /* overflow */ - zendlval->value.dval = strtod(yytext,NULL); + zendlval->value.dval = strtod(yytext, NULL); zendlval->type = IS_DOUBLE; return T_DNUMBER; } else { @@ -1023,7 +1023,7 @@ NEWLINE ("\r"|"\n"|"\r\n") if (errno == ERANGE) { /* overflow */ /* not trying strtod - it returns trash on 0x-es */ zendlval->value.lval = LONG_MAX; /* maximal long */ - zend_error(E_NOTICE,"Hex number is too big: %s",yytext); + zend_error(E_NOTICE,"Hex number is too big: %s", yytext); } else { if (zendlval->value.lval < 0) { /* maintain consistency with the old way */ @@ -1045,7 +1045,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } <ST_IN_SCRIPTING>{DNUM}|{EXPONENT_DNUM} { - zendlval->value.dval = strtod(yytext,NULL); + zendlval->value.dval = strtod(yytext, NULL); zendlval->type = IS_DOUBLE; return T_DNUMBER; } @@ -1078,7 +1078,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } <INITIAL>"<?"|"<script"{WHITESPACE}+"language"{WHITESPACE}*"="{WHITESPACE}*("php"|"\"php\""|"\'php\'"){WHITESPACE}*">" { - HANDLE_NEWLINES(yytext,yyleng); + HANDLE_NEWLINES(yytext, yyleng); if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not <? but <script> */ zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -1173,7 +1173,7 @@ NEWLINE ("\r"|"\n"|"\r\n") zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext,yyleng); + HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } @@ -1264,7 +1264,7 @@ NEWLINE ("\r"|"\n"|"\r\n") zendlval->value.str.val = estrndup(yytext+1, yyleng-2); zendlval->value.str.len = yyleng-2; zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext,yyleng); + HANDLE_NEWLINES(yytext, yyleng); /* convert escape sequences */ s = t = zendlval->value.str.val; @@ -1346,7 +1346,7 @@ NEWLINE ("\r"|"\n"|"\r\n") zendlval->value.str.val = estrndup(yytext+1, yyleng-2); zendlval->value.str.len = yyleng-2; zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext,yyleng); + HANDLE_NEWLINES(yytext, yyleng); /* convert escape sequences */ s = t = zendlval->value.str.val; @@ -1451,7 +1451,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>{ESCAPED_AND_WHITESPACE} { - HANDLE_NEWLINES(yytext,yyleng); + HANDLE_NEWLINES(yytext, yyleng); zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; @@ -1459,7 +1459,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } <ST_SINGLE_QUOTE>([^'\\]|\\[^'\\])+ { - HANDLE_NEWLINES(yytext,yyleng); + HANDLE_NEWLINES(yytext, yyleng); zendlval->value.str.val = (char *) estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; @@ -1556,7 +1556,7 @@ NEWLINE ("\r"|"\n"|"\r\n") zendlval->value.lval = (long) yytext[1]; break; default: - zendlval->value.str.val = estrndup(yytext,yyleng); + zendlval->value.str.val = estrndup(yytext, yyleng); zendlval->value.str.len = yyleng; zendlval->type = IS_STRING; return T_BAD_CHARACTER; @@ -1604,5 +1604,5 @@ NEWLINE ("\r"|"\n"|"\r\n") <ST_IN_SCRIPTING,INITIAL,ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_SINGLE_QUOTE,ST_HEREDOC>{ANY_CHAR} { - zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d",yytext[0],yytext[0],YYSTATE); + zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); } diff --git a/Zend/zend_list.c b/Zend/zend_list.c index dc61aa3272..de90c4a471 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -165,7 +165,7 @@ void list_entry_destructor(void *ptr) zend_rsrc_list_dtors_entry *ld; TSRMLS_FETCH(); - if (zend_hash_index_find(&list_destructors, le->type,(void **) &ld)==SUCCESS) { + if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) { switch (ld->type) { case ZEND_RESOURCE_LIST_TYPE_STD: if (ld->list_dtor) { @@ -180,7 +180,7 @@ void list_entry_destructor(void *ptr) EMPTY_SWITCH_DEFAULT_CASE() } } else { - zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)",le->type); + zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)", le->type); } } @@ -191,7 +191,7 @@ void plist_entry_destructor(void *ptr) zend_rsrc_list_dtors_entry *ld; TSRMLS_FETCH(); - if (zend_hash_index_find(&list_destructors, le->type,(void **) &ld)==SUCCESS) { + if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) { switch (ld->type) { case ZEND_RESOURCE_LIST_TYPE_STD: if (ld->plist_dtor) { @@ -206,7 +206,7 @@ void plist_entry_destructor(void *ptr) EMPTY_SWITCH_DEFAULT_CASE() } } else { - zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)",le->type); + zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)", le->type); } } @@ -325,7 +325,7 @@ ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_fu lde.type = ZEND_RESOURCE_LIST_TYPE_EX; lde.type_name = type_name; - if (zend_hash_next_index_insert(&list_destructors,(void *) &lde, sizeof(zend_rsrc_list_dtors_entry),NULL)==FAILURE) { + if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { return FAILURE; } return list_destructors.nNextFreeElement-1; @@ -340,7 +340,7 @@ ZEND_API int zend_fetch_list_dtor_id(char *type_name) while(zend_hash_get_current_data_ex(&list_destructors, (void **)&lde, &pos) == SUCCESS) { if(strcmp(type_name, lde->type_name) == 0) { #if 0 - printf("Found resource id %d for resource type %s\n",(*lde).resource_id,type_name); + printf("Found resource id %d for resource type %s\n", (*lde).resource_id, type_name); #endif return lde->resource_id; } diff --git a/Zend/zend_list.h b/Zend/zend_list.h index 6150a42efe..44a7920dd5 100644 --- a/Zend/zend_list.h +++ b/Zend/zend_list.h @@ -98,7 +98,7 @@ extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \ ZEND_VERIFY_RESOURCE(rsrc); -#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1,resource_type2) \ +#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \ rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \ ZEND_VERIFY_RESOURCE(rsrc); diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index e3ac9a6d73..e3e4945fb5 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -63,7 +63,7 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element) } -#define DEL_LLIST_ELEMENT(current,l) \ +#define DEL_LLIST_ELEMENT(current, l) \ if (current->prev) {\ current->prev->next = current->next;\ } else {\ @@ -86,7 +86,7 @@ ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare while (current) { if (compare(current->data, element)) { - DEL_LLIST_ELEMENT(current,l); + DEL_LLIST_ELEMENT(current, l); break; } current = current->next; @@ -151,7 +151,7 @@ ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)) while (element) { next = element->next; if (func(element->data)) { - DEL_LLIST_ELEMENT(element,l); + DEL_LLIST_ELEMENT(element, l); } element = next; } |