Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/flex/dist/src deal with our int -> size_t changes.



details:   https://anonhg.NetBSD.org/src/rev/4ff6fb2be9c3
branches:  trunk
changeset: 820188:4ff6fb2be9c3
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 02 20:53:11 2017 +0000

description:
deal with our int -> size_t changes.

diffstat:

 external/bsd/flex/dist/src/flex.skl   |   44 +-
 external/bsd/flex/dist/src/initscan.c |  546 +++++++++++++++++----------------
 2 files changed, 298 insertions(+), 292 deletions(-)

diffs (truncated from 2052 to 300 lines):

diff -r d485678770b6 -r 4ff6fb2be9c3 external/bsd/flex/dist/src/flex.skl
--- a/external/bsd/flex/dist/src/flex.skl       Mon Jan 02 20:45:09 2017 +0000
+++ b/external/bsd/flex/dist/src/flex.skl       Mon Jan 02 20:53:11 2017 +0000
@@ -384,9 +384,13 @@
 #define YY_TYPEDEF_YY_SIZE_T
 typedef size_t yy_size_t;
 #endif
+#ifndef YY_TYPEDEF_YY_SSIZE_T
+#define YY_TYPEDEF_YY_SSIZE_T
+typedef ssize_t yy_ssize_t;
+#endif
 
 %if-not-reentrant
-extern int yyleng;
+extern yy_size_t yyleng;
 %endif
 
 %if-c-only
@@ -463,12 +467,12 @@
        /* Size of input buffer in bytes, not including room for EOB
         * characters.
         */
-       int yy_buf_size;
+       size_t yy_buf_size;
 
        /* Number of characters read into yy_ch_buf, not including EOB
         * characters.
         */
-       int yy_n_chars;
+       size_t yy_n_chars;
 
        /* Whether we "own" the buffer - i.e., we know we created it,
         * and can realloc() it to grow it, and should free() it to
@@ -553,8 +557,8 @@
 %not-for-header
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
-static int yy_n_chars;         /* number of characters read into yy_ch_buf */
-int yyleng;
+static yy_size_t yy_n_chars;           /* number of characters read into yy_ch_buf */
+yy_size_t yyleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = NULL;
@@ -586,7 +590,7 @@
 
 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );
 YY_BUFFER_STATE yy_scan_string ( const char *yy_str M4_YY_PROTO_LAST_ARG );
-YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len M4_YY_PROTO_LAST_ARG );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len M4_YY_PROTO_LAST_ARG );
 
 %endif
 
@@ -701,8 +705,8 @@
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -839,7 +843,7 @@
 
 m4_ifdef( [[M4_YY_NO_GET_LENG]],,
 [[
-                       int yyget_leng ( M4_YY_PROTO_ONLY_ARG );
+                       yy_size_t yyget_leng ( M4_YY_PROTO_ONLY_ARG );
 ]])
 
 m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
@@ -1546,7 +1550,7 @@
     M4_YY_DECL_GUTS_VAR();
        char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
        char *source = YY_G(yytext_ptr);
-       int number_to_move, i;
+       yy_size_t number_to_move, i;
        int ret_val;
 
        if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] )
@@ -1575,7 +1579,7 @@
        /* Try to read more data. */
 
        /* First move last chars to start of buffer. */
-       number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - 1);
+       number_to_move = (yy_size_t) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - 1);
 
        for ( i = 0; i < number_to_move; ++i )
                *(dest++) = *(source++);
@@ -1588,7 +1592,7 @@
 
        else
                {
-                       int num_to_read =
+                       yy_ssize_t num_to_read =
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
                while ( num_to_read <= 0 )
@@ -1607,7 +1611,7 @@
 
                        if ( b->yy_is_our_buffer )
                                {
-                               int new_size = b->yy_buf_size * 2;
+                               yy_size_t new_size = b->yy_buf_size * 2;
 
                                if ( new_size <= 0 )
                                        b->yy_buf_size += b->yy_buf_size / 8;
@@ -1749,7 +1753,7 @@
        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                { /* need to shift things up to make room */
                /* +2 for EOB chars. */
-               int number_to_move = YY_G(yy_n_chars) + 2;
+               yy_size_t number_to_move = YY_G(yy_n_chars) + 2;
                char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
                char *source =
@@ -1761,7 +1765,7 @@
                yy_cp += (int) (dest - source);
                yy_bp += (int) (dest - source);
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-                       YY_G(yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+                       YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
 
                if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -1816,7 +1820,7 @@
 
                else
                        { /* need more input */
-                       int offset = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr));
+                       yy_size_t offset = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr));
                        ++YY_G(yy_c_buf_p);
 
                        switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )
@@ -2315,7 +2319,7 @@
 {
     m4_dnl M4_YY_DECL_GUTS_VAR();
 
-       return yy_scan_bytes( yystr, (int) strlen(yystr) M4_YY_CALL_LAST_ARG);
+       return yy_scan_bytes( yystr, strlen(yystr) M4_YY_CALL_LAST_ARG);
 }
 %endif
 ]])
@@ -2331,12 +2335,12 @@
  * M4_YY_DOC_PARAM
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE yy_scan_bytes  YYFARGS2( const char *,yybytes, int ,_yybytes_len)
+YY_BUFFER_STATE yy_scan_bytes  YYFARGS2( const char *,yybytes, yy_size_t ,_yybytes_len)
 {
        YY_BUFFER_STATE b;
        char *buf;
        yy_size_t n;
-       int i;
+       yy_size_t i;
     m4_dnl M4_YY_DECL_GUTS_VAR();
 
        /* Get memory for full buffer, including space for trailing EOB's. */
@@ -2558,7 +2562,7 @@
 /** Get the length of the current token.
  * M4_YY_DOC_PARAM
  */
-int yyget_leng  (M4_YY_DEF_ONLY_ARG)
+yy_size_t yyget_leng  (M4_YY_DEF_ONLY_ARG)
 {
     M4_YY_DECL_GUTS_VAR();
     return yyleng;
diff -r d485678770b6 -r 4ff6fb2be9c3 external/bsd/flex/dist/src/initscan.c
--- a/external/bsd/flex/dist/src/initscan.c     Mon Jan 02 20:45:09 2017 +0000
+++ b/external/bsd/flex/dist/src/initscan.c     Mon Jan 02 20:53:11 2017 +0000
@@ -104,7 +104,7 @@
 
 /* end standard C headers. */
 
-/*     $NetBSD: initscan.c,v 1.4 2017/01/02 18:33:22 christos Exp $    */
+/*     $NetBSD: initscan.c,v 1.5 2017/01/02 20:53:11 christos Exp $    */
 
 /* flex integer type definitions */
 
@@ -170,6 +170,8 @@
 
 #endif /* ! FLEXINT_H */
 
+/* begin standard C++ headers. */
+
 /* TODO: this is always defined, so inline it */
 #define yyconst const
 
@@ -1919,10 +1921,10 @@
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
-#line 1 "/usr/src/external/bsd/flex/dist/src/scan.l"
-/*     $NetBSD: initscan.c,v 1.4 2017/01/02 18:33:22 christos Exp $    */
+#line 1 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
+/*     $NetBSD: initscan.c,v 1.5 2017/01/02 20:53:11 christos Exp $    */
 /* scan.l - scanner for flex input -*-C-*- */
-#line 6 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 6 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 /*  Copyright (c) 1990 The Regents of the University of California. */
 /*  All rights reserved. */
 
@@ -1954,7 +1956,7 @@
 /*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
 /*  PURPOSE. */
 #include "flexdef.h"
-__RCSID("$NetBSD: initscan.c,v 1.4 2017/01/02 18:33:22 christos Exp $");
+__RCSID("$NetBSD: initscan.c,v 1.5 2017/01/02 20:53:11 christos Exp $");
 
 #include "parse.h"
 extern bool tablesverify, tablesext;
@@ -2042,10 +2044,10 @@
     if (!indented_code) line_directive_out(NULL, 0);\
 } while (0)
 
-#line 2045 "<stdout>"
-
 #line 2047 "<stdout>"
 
+#line 2049 "<stdout>"
+
 #define INITIAL 0
 #define SECT2 1
 #define SECT2PROLOG 2
@@ -2298,9 +2300,9 @@
                }
 
        {
-#line 162 "/usr/src/external/bsd/flex/dist/src/scan.l"
-
-#line 164 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 162 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
+
+#line 164 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
        static int bracelevel, didadef, indented_code;
        static int doing_rule_action = false;
        static int option_sense;
@@ -2310,7 +2312,7 @@
        char nmdef[MAXLINE];
 
 
-#line 2313 "<stdout>"
+#line 2315 "<stdout>"
 
        while ( /*CONSTCOND*/1 )                /* loops until end-of-file is reached */
                {
@@ -2370,39 +2372,39 @@
 
 case 1:
 YY_RULE_SETUP
-#line 174 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 174 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 START_CODEBLOCK(true);
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 175 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 175 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 add_action("/*[""["); yy_push_state( COMMENT );
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 176 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 176 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 yy_push_state( LINEDIR );
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 177 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 177 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 return SCDECL;
        YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 178 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 178 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 return XSCDECL;
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 179 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 179 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 START_CODEBLOCK(false);
        YY_BREAK
 case 7:
 /* rule 7 can match eol */
 YY_RULE_SETUP
-#line 180 "/usr/src/external/bsd/flex/dist/src/scan.l"
+#line 180 "/p/netbsd/cvsroot/src/external/bsd/flex/dist/src/scan.l"
 {
                 brace_start_line = linenum;
                 ++linenum;
@@ -2413,17 +2415,17 @@
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 188 "/usr/src/external/bsd/flex/dist/src/scan.l"



Home | Main Index | Thread Index | Old Index