Fix warnings in session/spl

This fixes -Winline errors where the functions are not ever inlined.

Also fixes some signature mismatches which were fixed previously but
for whatever reason were not ported to all maintained branches:

/usr/local/src/php/ext/session/session.c:1299:20:
warning:conflicting types for 'php_session_send_cookie' due to enum/integer mismatch;
have 'zend_result(void)' {aka 'ZEND_RESULT_CODE(void)'} [-Wenum-int-mismatch]
 1299 | static zend_result php_session_send_cookie(void) /* {{{ */
      |                    ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/php/ext/session/session.c💯12:
note: previous declaration of 'php_session_send_cookie' with type 'int(void)'
  100 | static int php_session_send_cookie(void);
      |            ^~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Levi Morrison 2024-07-23 16:15:07 -06:00
parent acf758d2ea
commit 0956267c08
No known key found for this signature in database
3 changed files with 7 additions and 7 deletions

View file

@ -56,8 +56,8 @@
PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps) PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps)
static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra); static zend_result php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra);
static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra); static zend_result (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra);
static void php_session_track_init(void); static void php_session_track_init(void);
/* SessionHandler class */ /* SessionHandler class */
@ -97,8 +97,8 @@ zend_class_entry *php_session_update_timestamp_iface_entry;
#define APPLY_TRANS_SID (PS(use_trans_sid) && !PS(use_only_cookies)) #define APPLY_TRANS_SID (PS(use_trans_sid) && !PS(use_only_cookies))
static int php_session_send_cookie(void); static zend_result php_session_send_cookie(void);
static int php_session_abort(void); static zend_result php_session_abort(void);
/* Initialized in MINIT, readonly otherwise. */ /* Initialized in MINIT, readonly otherwise. */
static int my_module_number = 0; static int my_module_number = 0;
@ -122,7 +122,7 @@ static inline void php_rinit_session_globals(void) /* {{{ */
/* }}} */ /* }}} */
/* Dispatched by RSHUTDOWN and by php_session_destroy */ /* Dispatched by RSHUTDOWN and by php_session_destroy */
static inline void php_rshutdown_session_globals(void) /* {{{ */ static void php_rshutdown_session_globals(void) /* {{{ */
{ {
/* Do NOT destroy PS(mod_user_names) here! */ /* Do NOT destroy PS(mod_user_names) here! */
if (!Z_ISUNDEF(PS(http_session_vars))) { if (!Z_ISUNDEF(PS(http_session_vars))) {

View file

@ -240,7 +240,7 @@ PHPAPI zend_string *spl_filesystem_object_get_path(spl_filesystem_object *intern
return zend_string_copy(intern->path); return zend_string_copy(intern->path);
} /* }}} */ } /* }}} */
static inline zend_result spl_filesystem_object_get_file_name(spl_filesystem_object *intern) /* {{{ */ static zend_result spl_filesystem_object_get_file_name(spl_filesystem_object *intern) /* {{{ */
{ {
if (intern->file_name) { if (intern->file_name) {
/* already known */ /* already known */

View file

@ -501,7 +501,7 @@ static zend_result spl_heap_object_count_elements(zend_object *object, zend_long
} }
/* }}} */ /* }}} */
static inline HashTable* spl_heap_object_get_debug_info(zend_class_entry *ce, zend_object *obj) { /* {{{ */ static HashTable* spl_heap_object_get_debug_info(zend_class_entry *ce, zend_object *obj) { /* {{{ */
spl_heap_object *intern = spl_heap_from_obj(obj); spl_heap_object *intern = spl_heap_from_obj(obj);
zval tmp, heap_array; zval tmp, heap_array;
zend_string *pnstr; zend_string *pnstr;