|
30 | 30 | #include "zend_language_scanner_defs.h" |
31 | 31 |
|
32 | 32 | #include <errno.h> |
| 33 | +#include <stdint.h> |
33 | 34 | #include "zend.h" |
34 | 35 | #ifdef ZEND_WIN32 |
35 | 36 | # include <Winuser.h> |
@@ -600,7 +601,7 @@ static zend_op_array *zend_compile(int type) |
600 | 601 | CG(ast_arena) = zend_arena_create(1024 * 32); |
601 | 602 |
|
602 | 603 | if (!zendparse()) { |
603 | | - int last_lineno = CG(zend_lineno); |
| 604 | + uint32_t last_lineno = CG(zend_lineno); |
604 | 605 | zend_file_context original_file_context; |
605 | 606 | zend_oparray_context original_oparray_context; |
606 | 607 | zend_op_array *original_active_op_array = CG(active_op_array); |
@@ -1140,7 +1141,7 @@ skip_escape_conversion: |
1140 | 1141 | unsigned char *str; |
1141 | 1142 | // TODO: avoid realocation ??? |
1142 | 1143 | s = Z_STRVAL_P(zendlval); |
1143 | | - SCNG(output_filter)(&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval)); |
| 1144 | + SCNG(output_filter)(&str, &sz, (unsigned char *)s, Z_STRLEN_P(zendlval)); |
1144 | 1145 | zval_ptr_dtor(zendlval); |
1145 | 1146 | ZVAL_STRINGL(zendlval, (char *) str, sz); |
1146 | 1147 | efree(str); |
@@ -1172,7 +1173,7 @@ static bool strip_multiline_string_indentation( |
1172 | 1173 | const char *str = Z_STRVAL_P(zendlval), *end = str + Z_STRLEN_P(zendlval); |
1173 | 1174 | char *copy = Z_STRVAL_P(zendlval); |
1174 | 1175 |
|
1175 | | - int newline_count = 0; |
| 1176 | + uint32_t newline_count = 0; |
1176 | 1177 | size_t newline_len; |
1177 | 1178 | const char *nl; |
1178 | 1179 |
|
@@ -1253,7 +1254,7 @@ static void copy_heredoc_label_stack(void *void_heredoc_label) |
1253 | 1254 | } |
1254 | 1255 |
|
1255 | 1256 | /* Check that { }, [ ], ( ) are nested correctly */ |
1256 | | -static void report_bad_nesting(char opening, int opening_lineno, char closing) |
| 1257 | +static void report_bad_nesting(char opening, uint32_t opening_lineno, char closing) |
1257 | 1258 | { |
1258 | 1259 | char buf[256]; |
1259 | 1260 | size_t used = 0; |
@@ -1361,7 +1362,7 @@ int ZEND_FASTCALL lex_scan(zval *zendlval, zend_parser_stack_elem *elem) |
1361 | 1362 | { |
1362 | 1363 | int token; |
1363 | 1364 | int offset; |
1364 | | -int start_line = CG(zend_lineno); |
| 1365 | +uint32_t start_line = CG(zend_lineno); |
1365 | 1366 |
|
1366 | 1367 | ZVAL_UNDEF(zendlval); |
1367 | 1368 | restart: |
@@ -2499,7 +2500,7 @@ inline_char_handler: |
2499 | 2500 | if (YYCURSOR < YYLIMIT) { |
2500 | 2501 | YYCURSOR++; |
2501 | 2502 | } else { |
2502 | | - zend_throw_exception_ex(zend_ce_parse_error, 0, "Unterminated comment starting line %d", CG(zend_lineno)); |
| 2503 | + zend_throw_exception_ex(zend_ce_parse_error, 0, "Unterminated comment starting line %" PRIu32, CG(zend_lineno)); |
2503 | 2504 | if (PARSER_MODE()) { |
2504 | 2505 | RETURN_TOKEN(T_ERROR); |
2505 | 2506 | } |
@@ -2616,7 +2617,7 @@ skip_escape_conversion: |
2616 | 2617 | zend_string *new_str; |
2617 | 2618 | s = Z_STRVAL_P(zendlval); |
2618 | 2619 | // TODO: avoid reallocation ??? |
2619 | | - SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval)); |
| 2620 | + SCNG(output_filter)((unsigned char **)&str, &sz, (unsigned char *)s, Z_STRLEN_P(zendlval)); |
2620 | 2621 | new_str = zend_string_init(str, sz, 0); |
2621 | 2622 | if (str != s) { |
2622 | 2623 | efree(str); |
|
0 commit comments