Skip to content

Commit caafc3d

Browse files
committed
Optimizations
1 parent b9b9685 commit caafc3d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ext/date/php_date.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2211,6 +2211,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, const char *time_str, size
22112211
time_str = "now";
22122212
time_str_len = sizeof("now") - 1;
22132213
}
2214+
// TODO: drop this const casts
22142215
dateobj->time = timelib_strtotime((char *) time_str, time_str_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
22152216
}
22162217

@@ -2220,7 +2221,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, const char *time_str, size
22202221

22212222
if (ctor && err && err->error_count) {
22222223
/* spit out the first library error message, at least */
2223-
php_error_docref(NULL, E_WARNING, "Failed to parse time string (%.*s) at position %d (%c): %s", (int) time_str_len, time_str,
2224+
php_error_docref(NULL, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str,
22242225
err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message);
22252226
}
22262227
if (err && err->error_count) {

ext/session/php_session.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS);
247247
PHPAPI int php_session_validate_sid(PS_VALIDATE_SID_ARGS);
248248
PHPAPI int php_session_update_timestamp(PS_UPDATE_TIMESTAMP_ARGS);
249249

250-
PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen);
250+
PHPAPI void session_adapt_url(const char *url, size_t url_len, char **new_url, size_t *new_len);
251251

252252
PHPAPI int php_session_destroy(void);
253253
PHPAPI void php_add_session_var(zend_string *name);

ext/session/session.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,10 +1648,10 @@ static int php_session_reset(void) /* {{{ */
16481648
/* This API is not used by any PHP modules including session currently.
16491649
session_adapt_url() may be used to set Session ID to target url without
16501650
starting "URL-Rewriter" output handler. */
1651-
PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen) /* {{{ */
1651+
PHPAPI void session_adapt_url(const char *url, size_t url_len, char **new_url, size_t *new_len) /* {{{ */
16521652
{
16531653
if (APPLY_TRANS_SID && (PS(session_status) == php_session_active)) {
1654-
*new = php_url_scanner_adapt_single_url(url, urllen, PS(session_name), ZSTR_VAL(PS(id)), newlen, 1);
1654+
*new_url = php_url_scanner_adapt_single_url(url, url_len, PS(session_name), ZSTR_VAL(PS(id)), new_len, 1);
16551655
}
16561656
}
16571657
/* }}} */

main/php_variables.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,8 @@ PHPAPI void php_build_argv(const char *s, zval *track_vars_array)
614614
}
615615
}
616616
} else if (s && *s) {
617-
const char* space;
618617
while (1) {
619-
space = strchr(s, '+');
618+
const char *space = strchr(s, '+');
620619
/* auto-type */
621620
ZVAL_STRINGL(&tmp, s, space ? space - s : strlen(s));
622621
count++;

0 commit comments

Comments
 (0)