Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static ZEND_INI_MH(OnUpdateScriptEncoding) /* {{{ */

static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
{
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();

zend_long val = zend_ini_parse_quantity_warn(new_value, entry->name);

Expand Down
16 changes: 8 additions & 8 deletions Zend/zend_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,15 +963,15 @@ ZEND_INI_DISP(display_link_numbers) /* {{{ */
/* Standard message handlers */
ZEND_API ZEND_INI_MH(OnUpdateBool) /* {{{ */
{
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
return SUCCESS;
}
/* }}} */

ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
{
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_quantity_warn(new_value, entry->name);
return SUCCESS;
}
Expand All @@ -984,7 +984,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */
return FAILURE;
}

zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = tmp;

return SUCCESS;
Expand All @@ -993,15 +993,15 @@ ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */

ZEND_API ZEND_INI_MH(OnUpdateReal) /* {{{ */
{
double *p = (double *) ZEND_INI_GET_ADDR();
double *p = ZEND_INI_GET_ADDR();
*p = zend_strtod(ZSTR_VAL(new_value), NULL);
return SUCCESS;
}
/* }}} */

ZEND_API ZEND_INI_MH(OnUpdateString) /* {{{ */
{
char **p = (char **) ZEND_INI_GET_ADDR();
char **p = ZEND_INI_GET_ADDR();
*p = new_value ? ZSTR_VAL(new_value) : NULL;
return SUCCESS;
}
Expand All @@ -1013,15 +1013,15 @@ ZEND_API ZEND_INI_MH(OnUpdateStringUnempty) /* {{{ */
return FAILURE;
}

char **p = (char **) ZEND_INI_GET_ADDR();
char **p = ZEND_INI_GET_ADDR();
*p = new_value ? ZSTR_VAL(new_value) : NULL;
return SUCCESS;
}
/* }}} */

ZEND_API ZEND_INI_MH(OnUpdateStr) /* {{{ */
{
zend_string **p = (zend_string **) ZEND_INI_GET_ADDR();
zend_string **p = ZEND_INI_GET_ADDR();
*p = new_value;
return SUCCESS;
}
Expand All @@ -1033,7 +1033,7 @@ ZEND_API ZEND_INI_MH(OnUpdateStrNotEmpty) /* {{{ */
return FAILURE;
}

zend_string **p = (zend_string **) ZEND_INI_GET_ADDR();
zend_string **p = ZEND_INI_GET_ADDR();
*p = new_value;
return SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,6 @@ typedef struct _zend_ini_parser_param {
# define ZEND_INI_GET_BASE() ((char *) ts_resource(*((int *) mh_arg2)))
#endif

#define ZEND_INI_GET_ADDR() (ZEND_INI_GET_BASE() + (size_t) mh_arg1)
#define ZEND_INI_GET_ADDR() ((void*)(ZEND_INI_GET_BASE() + (size_t) mh_arg1))

#endif /* ZEND_INI_H */
3 changes: 1 addition & 2 deletions ext/bcmath/bcmath.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ ZEND_GET_MODULE(bcmath)

ZEND_INI_MH(OnUpdateScale)
{
int *p;
int *p = ZEND_INI_GET_ADDR();
zend_long tmp;

tmp = zend_ini_parse_quantity_warn(new_value, entry->name);
if (tmp < 0 || tmp > INT_MAX) {
return FAILURE;
}

p = (int *) ZEND_INI_GET_ADDR();
*p = (int) tmp;

return SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/php_intl.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ char* canonicalize_locale_string(const char* locale) {

static PHP_INI_MH(OnUpdateErrorLevel)
{
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_quantity_warn(new_value, entry->name);
if (*p) {
php_error_docref("session.configuration", E_DEPRECATED,
Expand Down
22 changes: 11 additions & 11 deletions ext/opcache/zend_accelerator_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption)
return FAILURE;
}

zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
zend_long memsize = atoi(ZSTR_VAL(new_value));
/* sanity check we must use at least 8 MB */
if (memsize < 8) {
Expand All @@ -104,7 +104,7 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption)

static ZEND_INI_MH(OnUpdateInternedStringsBuffer)
{
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
zend_long size = zend_ini_parse_quantity_warn(new_value, entry->name);

if (size < 0) {
Expand All @@ -123,7 +123,7 @@ static ZEND_INI_MH(OnUpdateInternedStringsBuffer)

static ZEND_INI_MH(OnUpdateMaxAcceleratedFiles)
{
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
zend_long size = atoi(ZSTR_VAL(new_value));
/* sanity check we must use a value between MIN_ACCEL_FILES and MAX_ACCEL_FILES */
if (size < MIN_ACCEL_FILES) {
Expand All @@ -140,7 +140,7 @@ static ZEND_INI_MH(OnUpdateMaxAcceleratedFiles)

static ZEND_INI_MH(OnUpdateMaxWastedPercentage)
{
double *p = (double *) ZEND_INI_GET_ADDR();
double *p = ZEND_INI_GET_ADDR();
zend_long percentage = atoi(ZSTR_VAL(new_value));

if (percentage <= 0 || percentage > 50) {
Expand All @@ -159,7 +159,7 @@ static ZEND_INI_MH(OnEnable)
return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
} else {
/* It may be only temporarily disabled */
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
if (zend_ini_parse_bool(new_value)) {
if (*p) {
/* Do not warn if OPcache is enabled, as the update would be a noop anyways. */
Expand Down Expand Up @@ -206,7 +206,7 @@ static ZEND_INI_MH(OnUpdateJit)

static ZEND_INI_MH(OnUpdateJitDebug)
{
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
zend_long val = zend_ini_parse_quantity_warn(new_value, entry->name);

if (zend_jit_debug_config(*p, val, stage) == SUCCESS) {
Expand All @@ -220,7 +220,7 @@ static ZEND_INI_MH(OnUpdateCounter)
{
zend_long val = zend_ini_parse_quantity_warn(new_value, entry->name);
if (val >= 0 && val < 256) {
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = val;
return SUCCESS;
}
Expand All @@ -232,7 +232,7 @@ static ZEND_INI_MH(OnUpdateUnrollC)
{
zend_long val = zend_ini_parse_quantity_warn(new_value, entry->name);
if (val > 0 && val < ZEND_JIT_TRACE_MAX_CALL_DEPTH) {
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = val;
return SUCCESS;
}
Expand All @@ -245,7 +245,7 @@ static ZEND_INI_MH(OnUpdateUnrollR)
{
zend_long val = zend_ini_parse_quantity_warn(new_value, entry->name);
if (val >= 0 && val < ZEND_JIT_TRACE_MAX_RET_DEPTH) {
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = val;
return SUCCESS;
}
Expand All @@ -258,7 +258,7 @@ static ZEND_INI_MH(OnUpdateUnrollL)
{
zend_long val = zend_ini_parse_quantity_warn(new_value, entry->name);
if (val > 0 && val < ZEND_JIT_TRACE_MAX_LOOPS_UNROLL) {
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = val;
return SUCCESS;
}
Expand All @@ -271,7 +271,7 @@ static ZEND_INI_MH(OnUpdateMaxTraceLength)
{
zend_long val = zend_ini_parse_quantity_warn(new_value, entry->name);
if (val > 3 && val <= ZEND_JIT_TRACE_MAX_LENGTH) {
zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = val;
return SUCCESS;
}
Expand Down
8 changes: 4 additions & 4 deletions ext/session/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ static PHP_INI_MH(OnUpdateSessionGcProbability)
return FAILURE;
}

zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = tmp;

return SUCCESS;
Expand All @@ -830,7 +830,7 @@ static PHP_INI_MH(OnUpdateSessionDivisor)
return FAILURE;
}

zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = tmp;

return SUCCESS;
Expand Down Expand Up @@ -859,7 +859,7 @@ static PHP_INI_MH(OnUpdateUseOnlyCookies)
{
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
if (!*p) {
php_error_docref("session.configuration", E_DEPRECATED, "Disabling session.use_only_cookies INI setting is deprecated");
Expand All @@ -871,7 +871,7 @@ static PHP_INI_MH(OnUpdateUseTransSid)
{
SESSION_CHECK_ACTIVE_STATE;
SESSION_CHECK_OUTPUT_STATE;
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
if (*p) {
php_error_docref("session.configuration", E_DEPRECATED, "Enabling session.use_trans_sid INI setting is deprecated");
Expand Down
2 changes: 1 addition & 1 deletion ext/soap/soap.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ ZEND_GET_MODULE(soap)

ZEND_INI_MH(OnUpdateCacheMode)
{
char *p = (char *) ZEND_INI_GET_ADDR();
char *p = ZEND_INI_GET_ADDR();
*p = (char)atoi(ZSTR_VAL(new_value));
return SUCCESS;
}
Expand Down
8 changes: 4 additions & 4 deletions ext/standard/assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static PHP_INI_MH(OnChangeCallback) /* {{{ */

static PHP_INI_MH(OnUpdateActiveBool)
{
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
if (php_must_emit_ini_deprecation(stage) && !*p) {
php_error_docref(NULL, E_DEPRECATED, "assert.active INI setting is deprecated");
Expand All @@ -89,7 +89,7 @@ static PHP_INI_MH(OnUpdateActiveBool)

static PHP_INI_MH(OnUpdateBailBool)
{
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
if (php_must_emit_ini_deprecation(stage) && *p) {
php_error_docref(NULL, E_DEPRECATED, "assert.bail INI setting is deprecated");
Expand All @@ -99,7 +99,7 @@ static PHP_INI_MH(OnUpdateBailBool)

static PHP_INI_MH(OnUpdateExceptionBool)
{
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
if (php_must_emit_ini_deprecation(stage) && !*p) {
php_error_docref(NULL, E_DEPRECATED, "assert.exception INI setting is deprecated");
Expand All @@ -110,7 +110,7 @@ static PHP_INI_MH(OnUpdateExceptionBool)

static PHP_INI_MH(OnUpdateWarningBool)
{
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
*p = zend_ini_parse_bool(new_value);
if (php_must_emit_ini_deprecation(stage) && !*p) {
php_error_docref(NULL, E_DEPRECATED, "assert.warning INI setting is deprecated");
Expand Down
2 changes: 1 addition & 1 deletion ext/zend_test/observer.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static void zend_test_execute_internal(zend_execute_data *execute_data, zval *re

static ZEND_INI_MH(zend_test_observer_OnUpdateCommaList)
{
zend_array **p = (zend_array **) ZEND_INI_GET_ADDR();
zend_array **p = ZEND_INI_GET_ADDR();
zend_string *funcname;
zend_function *func;
if (!ZT_G(observer_enabled)) {
Expand Down
2 changes: 1 addition & 1 deletion ext/zlib/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
}
}

zend_long *p = (zend_long *) ZEND_INI_GET_ADDR();
zend_long *p = ZEND_INI_GET_ADDR();
*p = int_value;

ZLIBG(output_compression) = ZLIBG(output_compression_default);
Expand Down
2 changes: 1 addition & 1 deletion main/fopen_wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Allows any change to open_basedir setting in during Startup and Shutdown events,
or a tightening during activation/runtime/deactivation */
PHPAPI ZEND_INI_MH(OnUpdateBaseDir)
{
char **p = (char **) ZEND_INI_GET_ADDR();
char **p = ZEND_INI_GET_ADDR();
char *pathbuf, *ptr, *end;

if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) {
Expand Down
6 changes: 3 additions & 3 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ static PHP_INI_MH(OnUpdateInputEncoding)

static PHP_INI_MH(OnUpdateReportMemleaks)
{
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool *p = ZEND_INI_GET_ADDR();
bool new_bool_value = zend_ini_parse_bool(new_value);

if (!new_bool_value) {
Expand Down Expand Up @@ -707,7 +707,7 @@ static PHP_INI_MH(OnUpdateErrorLog)
return FAILURE;
}
}
char **p = (char **) ZEND_INI_GET_ADDR();
char **p = ZEND_INI_GET_ADDR();
*p = new_value && ZSTR_LEN(new_value) > 0 ? ZSTR_VAL(new_value) : NULL;
return SUCCESS;
}
Expand All @@ -722,7 +722,7 @@ static PHP_INI_MH(OnUpdateMailLog)
return FAILURE;
}
}
char **p = (char **) ZEND_INI_GET_ADDR();
char **p = ZEND_INI_GET_ADDR();
*p = new_value && ZSTR_LEN(new_value) > 0 ? ZSTR_VAL(new_value) : NULL;
return SUCCESS;
}
Expand Down
Loading