cvs: ZendEngine2 / zend.c zend_API.c zend_compile.c zend_constants.c zend_execute.c zend_execute_API.c zend_mm.c zend_opcode.c zend_reflection_api.c

From: Date: Mon, 30 Jun 2003 20:22:36 +0000
Subject: cvs: ZendEngine2 / zend.c zend_API.c zend_compile.c zend_constants.c zend_execute.c zend_execute_API.c zend_mm.c zend_opcode.c zend_reflection_api.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1412@lists.php.net to get a copy of this message
andi Mon Jun 30 16:22:36 2003 EDT Modified files: /ZendEngine2 zend.c zend_API.c zend_compile.c zend_constants.c zend_execute.c zend_execute_API.c zend_mm.c zend_opcode.c zend_reflection_api.c Log: - ZE coding style requires if ( instead of if(

Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.239 ZendEngine2/zend.c:1.240 --- ZendEngine2/zend.c:1.239 Sun Jun 15 11:07:55 2003 +++ ZendEngine2/zend.c Mon Jun 30 16:22:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.239 2003/06/15 15:07:55 stas Exp $ */ +/* $Id: zend.c,v 1.240 2003/06/30 20:22:35 andi Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -305,7 +305,7 @@ Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC); } zend_printf("%s Object (", class_name?class_name:"Unknown Class"); - if(class_name) { + if (class_name) { efree(class_name); } if (Z_OBJ_HANDLER_P(expr, get_properties)) { @@ -358,7 +358,7 @@ Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC); } zend_printf("%s Object\n", class_name?class_name:"Unknown Class"); - if(class_name) { + if (class_name) { efree(class_name); } if (Z_OBJ_HANDLER_P(expr, get_properties)) { @@ -1017,7 +1017,7 @@ zend_execute(EG(active_op_array) TSRMLS_CC); if (EG(exception)) { char ex_class_name[128]; - if(Z_TYPE_P(EG(exception)) == IS_OBJECT) { + if (Z_TYPE_P(EG(exception)) == IS_OBJECT) { strncpy(ex_class_name, Z_OBJ_CLASS_NAME_P(EG(exception)), 127); ex_class_name[127] = '\0'; } else { @@ -1043,7 +1043,7 @@ } efree(params); zval_ptr_dtor(&old_exception); - if(EG(exception)) { + if (EG(exception)) { zval_ptr_dtor(&EG(exception)); EG(exception) = NULL; } Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.177 ZendEngine2/zend_API.c:1.178 --- ZendEngine2/zend_API.c:1.177 Tue Jun 10 16:03:24 2003 +++ ZendEngine2/zend_API.c Mon Jun 30 16:22:35 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.177 2003/06/10 20:03:24 imajes Exp $ */ +/* $Id: zend_API.c,v 1.178 2003/06/30 20:22:35 andi Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1505,9 +1505,9 @@ lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj)); - if(EG(active_op_array) && strcmp(lcname, "self") == 0) { + if (EG(active_op_array) && strcmp(lcname, "self") == 0) { ce = EG(active_op_array)->scope; - } else if(strcmp(lcname, "parent") == 0 && EG(active_op_array) && EG(active_op_array)->scope) { + } else if (strcmp(lcname, "parent") == 0 && EG(active_op_array) && EG(active_op_array)->scope) { ce = EG(active_op_array)->scope->parent; } else if (zend_lookup_class(lcname, Z_STRLEN_PP(obj), &pce TSRMLS_CC) == SUCCESS) { ce = *pce; Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.429 ZendEngine2/zend_compile.c:1.430 --- ZendEngine2/zend_compile.c:1.429 Sat Jun 21 17:56:06 2003 +++ ZendEngine2/zend_compile.c Mon Jun 30 16:22:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.429 2003/06/21 21:56:06 helly Exp $ */ +/* $Id: zend_compile.c,v 1.430 2003/06/30 20:22:35 andi Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -1321,9 +1321,9 @@ zend_op *opline; - if(is_method && function_name && function_name->op_type == IS_UNUSED) { + if (is_method && function_name && function_name->op_type == IS_UNUSED) { /* clone */ - if(argument_list->u.constant.value.lval != 0) { + if (argument_list->u.constant.value.lval != 0) { zend_error(E_WARNING, "Clone method does not require arguments"); } opline = &CG(active_op_array)->opcodes[function_name->u.constant.value.lval]; Index: ZendEngine2/zend_constants.c diff -u ZendEngine2/zend_constants.c:1.57 ZendEngine2/zend_constants.c:1.58 --- ZendEngine2/zend_constants.c:1.57 Mon Jun 16 06:16:50 2003 +++ ZendEngine2/zend_constants.c Mon Jun 30 16:22:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_constants.c,v 1.57 2003/06/16 10:16:50 stas Exp $ */ +/* $Id: zend_constants.c,v 1.58 2003/06/30 20:22:35 andi Exp $ */ #include "zend.h" #include "zend_constants.h" @@ -215,7 +215,7 @@ int retval = 1; char *colon; - if((colon = memchr(name, ':', name_len)) && colon[1] == ':') { + if ((colon = memchr(name, ':', name_len)) && colon[1] == ':') { /* class constant */ zend_class_entry **ce = NULL, *scope; int class_name_len = colon-name; @@ -223,7 +223,7 @@ char *constant_name = colon+2; zval **ret_constant; - if(EG(in_execution)) { + if (EG(in_execution)) { scope = EG(scope); } else { scope = CG(active_class_entry); @@ -232,8 +232,8 @@ lookup_name = do_alloca(class_name_len+1); zend_str_tolower_copy(lookup_name, name, class_name_len); lookup_name[class_name_len] = '\0'; - if(class_name_len == sizeof("self")-1 && strcmp(lookup_name, "self") == 0) { - if(scope) { + if (class_name_len == sizeof("self")-1 && strcmp(lookup_name, "self") == 0) { + if (scope) { ce = &scope; } else { zend_error(E_ERROR, "Cannot access self:: when no class scope is active"); @@ -248,12 +248,12 @@ ce = &scope->parent; } } else { - if(zend_lookup_class(lookup_name, class_name_len, &ce TSRMLS_CC) != SUCCESS) { + if (zend_lookup_class(lookup_name, class_name_len, &ce TSRMLS_CC) != SUCCESS) { retval = 0; } } - if(retval && ce) { + if (retval && ce) { if (zend_hash_find(&((*ce)->constants_table), constant_name, const_name_len+1, (void **) &ret_constant) != SUCCESS) { retval = 0; } @@ -261,7 +261,7 @@ retval = 0; } - if(retval) { + if (retval) { *result = **ret_constant; zval_copy_ctor(result); } Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.480 ZendEngine2/zend_execute.c:1.481 --- ZendEngine2/zend_execute.c:1.480 Mon Jun 30 09:51:48 2003 +++ ZendEngine2/zend_execute.c Mon Jun 30 16:22:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.480 2003/06/30 13:51:48 zeev Exp $ */ +/* $Id: zend_execute.c,v 1.481 2003/06/30 20:22:35 andi Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -470,7 +470,7 @@ if (op2) { if (op2->op_type == IS_VAR) { if (value == &T(op2->u.var).tmp_var) { - if(result->u.EA.type & EXT_TYPE_UNUSED) { + if (result->u.EA.type & EXT_TYPE_UNUSED) { /* We are not going to use return value, drop it */ STR_FREE(value->value.str.val); } else { @@ -2208,7 +2208,7 @@ static int zend_import_check_function(HashTable *target_ht, zend_function *function, zend_hash_key *hash_key, void *param) { - if(zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { + if (zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { zend_error(E_ERROR, "Import: function %s() already exists in current scope", function->common.function_name?function->common.function_name:"main"); } return 1; /* OK */ @@ -2243,7 +2243,7 @@ static int zend_import_check_class(HashTable *target_ht, zend_class_entry **ce, zend_hash_key *hash_key, void *param) { - if(zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { + if (zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { zend_error(E_ERROR, "Import: class '%s' already exists in current scope", (*ce)->name); } return 1; /* OK */ @@ -3130,7 +3130,7 @@ { zval *obj = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - if(Z_TYPE_P(obj) != IS_OBJECT) { + if (Z_TYPE_P(obj) != IS_OBJECT) { zend_error(E_WARNING, "__clone method called on non-object"); EX_T(EX(opline)->result.u.var).var.ptr = EG(error_zval_ptr); EX_T(EX(opline)->result.u.var).var.ptr->refcount++; Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.212 ZendEngine2/zend_execute_API.c:1.213 --- ZendEngine2/zend_execute_API.c:1.212 Sun Jun 15 10:46:15 2003 +++ ZendEngine2/zend_execute_API.c Mon Jun 30 16:22:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.212 2003/06/15 14:46:15 stas Exp $ */ +/* $Id: zend_execute_API.c,v 1.213 2003/06/30 20:22:35 andi Exp $ */ #include <stdio.h> #include <signal.h> @@ -542,10 +542,10 @@ int found = FAILURE; lc_class = zend_str_tolower_dup(Z_STRVAL_PP(object_pp), Z_STRLEN_PP(object_pp)); - if(EG(active_op_array) && strcmp(lc_class, "self") == 0) { + if (EG(active_op_array) && strcmp(lc_class, "self") == 0) { ce = &(EG(active_op_array)->scope); found = (*ce != NULL?SUCCESS:FAILURE); - } else if(strcmp(lc_class, "parent") == 0 && EG(active_op_array) && EG(active_op_array)->scope) { + } else if (strcmp(lc_class, "parent") == 0 && EG(active_op_array) && EG(active_op_array)->scope) { ce = &(EG(active_op_array)->scope->parent); found = (*ce != NULL?SUCCESS:FAILURE); } else { Index: ZendEngine2/zend_mm.c diff -u ZendEngine2/zend_mm.c:1.21 ZendEngine2/zend_mm.c:1.22 --- ZendEngine2/zend_mm.c:1.21 Tue Jun 10 16:03:25 2003 +++ ZendEngine2/zend_mm.c Mon Jun 30 16:22:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_mm.c,v 1.21 2003/06/10 20:03:25 imajes Exp $ */ +/* $Id: zend_mm.c,v 1.22 2003/06/30 20:22:35 andi Exp $ */ #include "zend.h" #include "zend_mm.h" @@ -204,7 +204,7 @@ zend_mm_free_block **free_list_bucket; size_t index; - /* The max() can probably be optimized with an if() which checks more specific cases */ + /* The max() can probably be optimized with an if () which checks more specific cases */ true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE); index = ZEND_MM_BUCKET_INDEX(true_size); Index: ZendEngine2/zend_opcode.c diff -u ZendEngine2/zend_opcode.c:1.92 ZendEngine2/zend_opcode.c:1.93 --- ZendEngine2/zend_opcode.c:1.92 Tue Jun 10 16:03:25 2003 +++ ZendEngine2/zend_opcode.c Mon Jun 30 16:22:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_opcode.c,v 1.92 2003/06/10 20:03:25 imajes Exp $ */ +/* $Id: zend_opcode.c,v 1.93 2003/06/30 20:22:35 andi Exp $ */ #include <stdio.h> @@ -119,7 +119,7 @@ ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC) { - if(function->type == ZEND_USER_FUNCTION) { + if (function->type == ZEND_USER_FUNCTION) { zend_cleanup_op_array_data((zend_op_array *) function); } return 0; @@ -127,7 +127,7 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC) { - if((*pce)->type == ZEND_USER_CLASS) { + if ((*pce)->type == ZEND_USER_CLASS) { /* Clean all parts that can contain run-time data */ /* Note that only run-time accessed data need to be cleaned up, pre-defined data can not contain objects and thus are not probelmatic */ Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.2 ZendEngine2/zend_reflection_api.c:1.3 --- ZendEngine2/zend_reflection_api.c:1.2 Mon Jun 30 16:17:01 2003 +++ ZendEngine2/zend_reflection_api.c Mon Jun 30 16:22:35 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.2 2003/06/30 20:17:01 sebastian Exp $ */ +/* $Id: zend_reflection_api.c,v 1.3 2003/06/30 20:22:35 andi Exp $ */ #include "zend.h" #include "zend_API.h" @@ -93,13 +93,13 @@ object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { return; } convert_to_string_ex(name); zval_add_ref(name); zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) name, sizeof(zval *), NULL); - if(zend_hash_find(EG(function_table), (char *)Z_STRVAL_PP(name), (int)(Z_STRLEN_PP(name) + 1), (void **)&fptr) == FAILURE) { + if (zend_hash_find(EG(function_table), (char *)Z_STRVAL_PP(name), (int)(Z_STRLEN_PP(name) + 1), (void **)&fptr) == FAILURE) { zval *ex; zval *tmp; MAKE_STD_ZVAL(ex); @@ -144,10 +144,10 @@ } object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { RETURN_FALSE; } - if((fptr = intern->ptr) == NULL) { + if ((fptr = intern->ptr) == NULL) { RETURN_FALSE; } RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION); @@ -164,10 +164,10 @@ } object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { return; } - if((fptr = intern->ptr) == NULL) { + if ((fptr = intern->ptr) == NULL) { return; } RETURN_BOOL(fptr->type == ZEND_USER_FUNCTION); @@ -184,13 +184,13 @@ } object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { return; } - if((fptr = intern->ptr) == NULL) { + if ((fptr = intern->ptr) == NULL) { return; } - if(fptr->type == ZEND_USER_FUNCTION) { + if (fptr->type == ZEND_USER_FUNCTION) { RETURN_STRING(fptr->op_array.filename, 1); } RETURN_FALSE; @@ -207,13 +207,13 @@ } object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { return; } - if((fptr = intern->ptr) == NULL) { + if ((fptr = intern->ptr) == NULL) { return; } - if(fptr->type == ZEND_USER_FUNCTION) { + if (fptr->type == ZEND_USER_FUNCTION) { RETURN_LONG(fptr->op_array.line_start); } RETURN_FALSE; @@ -230,13 +230,13 @@ } object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { RETURN_FALSE; } - if((fptr = intern->ptr) == NULL) { + if ((fptr = intern->ptr) == NULL) { RETURN_FALSE; } - if(fptr->type == ZEND_USER_FUNCTION) { + if (fptr->type == ZEND_USER_FUNCTION) { RETURN_LONG(fptr->op_array.line_end); } RETURN_FALSE; @@ -253,13 +253,13 @@ } object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { RETURN_FALSE; } - if((fptr = intern->ptr) == NULL) { + if ((fptr = intern->ptr) == NULL) { RETURN_FALSE; } - if(fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) { + if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) { RETURN_STRINGL(fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1); } RETURN_FALSE; @@ -276,10 +276,10 @@ } object = getThis(); intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL) { + if (intern == NULL) { RETURN_FALSE; } - if((fptr = intern->ptr) == NULL || fptr->op_array.static_variables == NULL) { + if ((fptr = intern->ptr) == NULL || fptr->op_array.static_variables == NULL) { RETURN_FALSE; } array_init(return_value); @@ -302,11 +302,11 @@ } intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC); - if(intern == NULL || (fptr = intern->ptr) == NULL) { + if (intern == NULL || (fptr = intern->ptr) == NULL) { efree(params); RETURN_FALSE; } - if(fast_call_user_function(EG(function_table), NULL, NULL, + if (fast_call_user_function(EG(function_table), NULL, NULL, &retval_ptr, argc, params, 1, NULL, &fptr TSRMLS_CC) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
« previous php.zend-engine.cvs (#1412) next »