1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Zend: use type uint32_t for lineno ini scanner global

This commit is contained in:
Gina Peter Banyard
2025-10-03 16:13:46 +01:00
parent f5e782ec2d
commit 3db0ea682a
4 changed files with 4 additions and 4 deletions

View File

@@ -343,7 +343,7 @@ struct _zend_ini_scanner_globals {
zend_stack state_stack;
zend_string *filename;
int lineno;
uint32_t lineno;
/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
int scanner_mode;

View File

@@ -205,7 +205,7 @@ static ZEND_COLD void ini_error(const char *msg)
error_buf_len = 128 + (int)strlen(msg) + (int)strlen(currently_parsed_filename); /* should be more than enough */
error_buf = (char *) emalloc(error_buf_len);
sprintf(error_buf, "%s in %s on line %d\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno());
sprintf(error_buf, "%s in %s on line %" PRIu32 "\n", msg, currently_parsed_filename, zend_ini_scanner_get_lineno());
} else {
error_buf = estrdup("Invalid configuration directive\n");
}

View File

@@ -30,7 +30,7 @@ typedef struct _zend_file_handle zend_file_handle;
#define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */
BEGIN_EXTERN_C()
ZEND_COLD int zend_ini_scanner_get_lineno(void);
ZEND_COLD uint32_t zend_ini_scanner_get_lineno(void);
ZEND_COLD const char *zend_ini_scanner_get_filename(void);
zend_result zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode);
zend_result zend_ini_prepare_string_for_scanning(const char *str, int scanner_mode);

View File

@@ -230,7 +230,7 @@ void shutdown_ini_scanner(void)
/* }}} */
/* {{{ zend_ini_scanner_get_lineno() */
ZEND_COLD int zend_ini_scanner_get_lineno(void)
ZEND_COLD uint32_t zend_ini_scanner_get_lineno(void)
{
return SCNG(lineno);
}