blob: 912520c744bda3f6217243bdd4fcaa87aa16efeb [file] [log] [blame]
Geoff Lang93561c32016-09-20 10:22:55 -04001diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
2index 0d7ad58..5ef0e5e 100644
Shannon Woodseb936d02013-06-12 14:05:38 -04003--- a/src/compiler/preprocessor/Tokenizer.cpp
4+++ b/src/compiler/preprocessor/Tokenizer.cpp
Geoff Lang93561c32016-09-20 10:22:55 -04005@@ -1703,7 +1703,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
6 else
7 {
8 int num_to_read =
9- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
10+ static_cast<int>(YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1);
11
12 while ( num_to_read <= 0 )
13 { /* Not enough room in the buffer - grow it. */
14@@ -1737,8 +1737,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
15
16 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
17
18- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
19- number_to_move - 1;
20+ num_to_read = static_cast<int>(YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
21+ number_to_move - 1);
22
23 }
24
25@@ -1746,8 +1746,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
26 num_to_read = YY_READ_BUF_SIZE;
27
28 /* Read in more data. */
29+ yy_size_t ret = 0;
30 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
31- yyg->yy_n_chars, num_to_read );
32+ ret, num_to_read );
33+ yyg->yy_n_chars = static_cast<int>(ret);
34
35 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
36 }
37@@ -1773,13 +1775,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
38
39 if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
40 /* Extend the array by 50%, plus the number we really need. */
41- int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
42+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
43 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
44 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
45 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
46 }
47
48- yyg->yy_n_chars += number_to_move;
49+ yyg->yy_n_chars += static_cast<int>(number_to_move);
50 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
51 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
52
53@@ -2171,7 +2173,7 @@ void pppop_buffer_state (yyscan_t yyscanner)
Shannon Woodseb936d02013-06-12 14:05:38 -040054 */
Geoff Lang93561c32016-09-20 10:22:55 -040055 static void ppensure_buffer_stack (yyscan_t yyscanner)
56 {
57- int num_to_alloc;
58+ yy_size_t num_to_alloc;
59 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
60
61 if (!yyg->yy_buffer_stack) {
62@@ -2238,7 +2240,7 @@ YY_BUFFER_STATE pp_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
63 if ( ! b )
64 YY_FATAL_ERROR( "out of dynamic memory in pp_scan_buffer()" );
65
66- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
67+ b->yy_buf_size = static_cast<int>(size - 2); /* "- 2" to take care of EOB's */
68 b->yy_buf_pos = b->yy_ch_buf = base;
69 b->yy_is_our_buffer = 0;
70 b->yy_input_file = NULL;
71@@ -2293,7 +2295,7 @@ YY_BUFFER_STATE pp_scan_bytes (yyconst char * yybytes, int _yybytes_len , yysc
72 if ( ! buf )
73 YY_FATAL_ERROR( "out of dynamic memory in pp_scan_bytes()" );
74
75- for ( i = 0; i < _yybytes_len; ++i )
76+ for ( i = 0; i < static_cast<yy_size_t>(_yybytes_len); ++i )
77 buf[i] = yybytes[i];
78
79 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;