mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
Nuke zval_reset
This commit is contained in:
parent
4cc86259dd
commit
66d94bc655
@ -1321,7 +1321,7 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro
|
||||
PHP_FN(com_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
if(!zend_is_true(return_value))
|
||||
{
|
||||
ZVAL_RESET(object);
|
||||
ZVAL_BOOL(object, 0);
|
||||
return;
|
||||
}
|
||||
ALLOC_ZVAL(object_handle);
|
||||
|
@ -161,7 +161,7 @@ void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_proper
|
||||
|
||||
if(!zend_is_true(return_value))
|
||||
{
|
||||
ZVAL_RESET(object);
|
||||
ZVAL_BOOL(object, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc
|
||||
|
||||
if(!var_arg || (type != IS_VARIANT))
|
||||
{
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -197,7 +197,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc
|
||||
switch(overloaded_property->type)
|
||||
{
|
||||
case OE_IS_ARRAY:
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
break;
|
||||
|
||||
case OE_IS_OBJECT:
|
||||
@ -211,12 +211,12 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc
|
||||
}
|
||||
else
|
||||
{
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
php_error(E_WARNING, "Unknown member.");
|
||||
}
|
||||
break;
|
||||
case OE_IS_METHOD:
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
php_error(E_WARNING, "Unknown method.");
|
||||
break;
|
||||
|
||||
|
@ -127,7 +127,7 @@ PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage)
|
||||
if(NULL == safeArray)
|
||||
{
|
||||
php_error( E_WARNING,"Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)");
|
||||
ZVAL_RESET(pval_arg);
|
||||
ZVAL_BOOL(pval_arg, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -473,7 +473,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
|
||||
if (1 != (Dims = SafeArrayGetDim(array)))
|
||||
{
|
||||
php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims);
|
||||
ZVAL_RESET(pval_arg);
|
||||
ZVAL_BOOL(pval_arg, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
SafeArrayLock( array);
|
||||
|
@ -401,7 +401,7 @@ static int checkError(pval *value) {
|
||||
if (value->type == IS_EXCEPTION) {
|
||||
php_error(E_WARNING, "%s", value->value.str.val);
|
||||
efree(value->value.str.val);
|
||||
ZVAL_RESET(value);
|
||||
ZVAL_BOOL(value, 0);
|
||||
return 1;
|
||||
};
|
||||
return 0;
|
||||
|
@ -849,7 +849,7 @@ PHP_FUNCTION(msql_result)
|
||||
return_value->value.str.val = (char *) safe_estrndup(sql_row[field_offset],return_value->value.str.len);
|
||||
}
|
||||
} else {
|
||||
ZVAL_RESET(return_value);
|
||||
ZVAL_BOOL(return_value, 0);
|
||||
}
|
||||
|
||||
return_value->type = IS_STRING;
|
||||
@ -1211,7 +1211,7 @@ static void php_msql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
|
||||
return_value->value.str.len = 11;
|
||||
return_value->type = IS_STRING;
|
||||
} else {
|
||||
ZVAL_RESET(return_value);
|
||||
ZVAL_BOOL(return_value, 0);
|
||||
}
|
||||
#else
|
||||
if ((msql_field->flags&NOT_NULL_FLAG) && (msql_field->flags&UNIQUE_FLAG)) {
|
||||
@ -1227,7 +1227,7 @@ static void php_msql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
|
||||
return_value->value.str.len = 6;
|
||||
return_value->type = IS_STRING;
|
||||
} else {
|
||||
ZVAL_RESET(return_value);
|
||||
ZVAL_BOOL(return_value, 0);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
@ -829,7 +829,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
|
||||
result->type = IS_STRING;
|
||||
} else {
|
||||
php_error(E_WARNING,"MS SQL: column %d has unknown data type (%d)", offset, coltype(offset));
|
||||
ZVAL_RESET(result);
|
||||
ZVAL_BOOL(result, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -871,7 +871,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
|
||||
result->type = IS_STRING;
|
||||
} else {
|
||||
php_error(E_WARNING,"MS SQL: column %d has unknown data type (%d)", offset, coltype(offset));
|
||||
ZVAL_RESET(result);
|
||||
ZVAL_BOOL(result, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1321,7 +1321,7 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro
|
||||
PHP_FN(com_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
if(!zend_is_true(return_value))
|
||||
{
|
||||
ZVAL_RESET(object);
|
||||
ZVAL_BOOL(object, 0);
|
||||
return;
|
||||
}
|
||||
ALLOC_ZVAL(object_handle);
|
||||
|
@ -127,7 +127,7 @@ PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage)
|
||||
if(NULL == safeArray)
|
||||
{
|
||||
php_error( E_WARNING,"Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)");
|
||||
ZVAL_RESET(pval_arg);
|
||||
ZVAL_BOOL(pval_arg, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -473,7 +473,7 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
|
||||
if (1 != (Dims = SafeArrayGetDim(array)))
|
||||
{
|
||||
php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims);
|
||||
ZVAL_RESET(pval_arg);
|
||||
ZVAL_BOOL(pval_arg, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
SafeArrayLock( array);
|
||||
|
@ -161,7 +161,7 @@ void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_proper
|
||||
|
||||
if(!zend_is_true(return_value))
|
||||
{
|
||||
ZVAL_RESET(object);
|
||||
ZVAL_BOOL(object, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc
|
||||
|
||||
if(!var_arg || (type != IS_VARIANT))
|
||||
{
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -197,7 +197,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc
|
||||
switch(overloaded_property->type)
|
||||
{
|
||||
case OE_IS_ARRAY:
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
break;
|
||||
|
||||
case OE_IS_OBJECT:
|
||||
@ -211,12 +211,12 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc
|
||||
}
|
||||
else
|
||||
{
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
php_error(E_WARNING, "Unknown member.");
|
||||
}
|
||||
break;
|
||||
case OE_IS_METHOD:
|
||||
ZVAL_RESET(&result);
|
||||
ZVAL_BOOL(&result, 0);
|
||||
php_error(E_WARNING, "Unknown method.");
|
||||
break;
|
||||
|
||||
|
@ -401,7 +401,7 @@ static int checkError(pval *value) {
|
||||
if (value->type == IS_EXCEPTION) {
|
||||
php_error(E_WARNING, "%s", value->value.str.val);
|
||||
efree(value->value.str.val);
|
||||
ZVAL_RESET(value);
|
||||
ZVAL_BOOL(value, 0);
|
||||
return 1;
|
||||
};
|
||||
return 0;
|
||||
|
@ -295,7 +295,7 @@ PHP_FUNCTION(urlencode)
|
||||
convert_to_string_ex(arg);
|
||||
|
||||
if (!(*arg)->value.str.len) {
|
||||
ZVAL_RESET(return_value);
|
||||
ZVAL_BOOL(return_value, 0);
|
||||
return;
|
||||
}
|
||||
str = php_url_encode((*arg)->value.str.val, (*arg)->value.str.len, &str_len);
|
||||
@ -316,7 +316,7 @@ PHP_FUNCTION(urldecode)
|
||||
convert_to_string_ex(arg);
|
||||
|
||||
if (!(*arg)->value.str.len) {
|
||||
ZVAL_RESET(return_value);
|
||||
ZVAL_BOOL(return_value, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -617,7 +617,7 @@ static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pva
|
||||
*result_ptr = result;
|
||||
|
||||
if (dbdatlen(sybase_ptr->link,offset) == 0) {
|
||||
ZVAL_RESET(result);
|
||||
ZVAL_BOOL(result, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -688,7 +688,7 @@ static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pva
|
||||
result->type = IS_STRING;
|
||||
} else {
|
||||
php_error(E_WARNING,"Sybase: column %d has unknown data type (%d)", offset, coltype(offset));
|
||||
ZVAL_RESET(result);
|
||||
ZVAL_BOOL(result, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -991,7 +991,7 @@ static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr)
|
||||
result->data[i] = (pval *) emalloc(sizeof(pval)*num_fields);
|
||||
for (j=0; j<num_fields; j++) {
|
||||
if (indicators[j] == -1) { /* null value */
|
||||
ZVAL_RESET(&result->data[i][j]);
|
||||
ZVAL_BOOL(&result->data[i][j], 0);
|
||||
} else {
|
||||
result->data[i][j].value.str.len = lengths[j]-1; /* we don't need the NULL in the length */
|
||||
result->data[i][j].value.str.val = estrndup(tmp_buffer[j], lengths[j]);
|
||||
|
@ -271,7 +271,7 @@ static zval *_xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encod
|
||||
MAKE_STD_ZVAL(ret);
|
||||
|
||||
if (s == NULL) {
|
||||
ZVAL_RESET(ret);
|
||||
ZVAL_BOOL(ret, 0);
|
||||
return ret;
|
||||
}
|
||||
if (len == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user