Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/flex merge conflicts



details:   https://anonhg.NetBSD.org/src/rev/d2fde259e96c
branches:  trunk
changeset: 785917:d2fde259e96c
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Apr 06 14:27:52 2013 +0000

description:
merge conflicts

diffstat:

 external/bsd/flex/dist/buf.c              |     5 +-
 external/bsd/flex/dist/filter.c           |     5 +-
 external/bsd/flex/dist/flex.skl           |   122 +-
 external/bsd/flex/dist/flexdef.h          |    22 +-
 external/bsd/flex/dist/gen.c              |     2 +-
 external/bsd/flex/dist/m4/Makefile.am     |     1 -
 external/bsd/flex/dist/m4/Makefile.in     |   316 ----
 external/bsd/flex/dist/m4/codeset.m4      |    23 -
 external/bsd/flex/dist/m4/glibc21.m4      |    32 -
 external/bsd/flex/dist/m4/intdiv0.m4      |    72 -
 external/bsd/flex/dist/m4/inttypes-pri.m4 |    32 -
 external/bsd/flex/dist/m4/inttypes.m4     |    27 -
 external/bsd/flex/dist/m4/inttypes_h.m4   |    28 -
 external/bsd/flex/dist/m4/isc-posix.m4    |    26 -
 external/bsd/flex/dist/m4/lcmessage.m4    |    32 -
 external/bsd/flex/dist/m4/stdint_h.m4     |    28 -
 external/bsd/flex/dist/m4/uintmax_t.m4    |    32 -
 external/bsd/flex/dist/m4/ulonglong.m4    |    23 -
 external/bsd/flex/dist/main.c             |    13 +-
 external/bsd/flex/dist/misc.c             |   145 +-
 external/bsd/flex/dist/parse.y            |    12 +-
 external/bsd/flex/dist/scan.l             |    12 +-
 external/bsd/flex/dist/scanopt.c          |    13 +-
 external/bsd/flex/dist/tables.c           |    11 +-
 external/bsd/flex/dist/tools/cvs2cl.pl    |  1977 -----------------------------
 external/bsd/flex/dist/tools/cvsauthors   |     5 -
 external/bsd/flex/include/config.h        |    29 +-
 27 files changed, 169 insertions(+), 2876 deletions(-)

diffs (truncated from 3848 to 300 lines):

diff -r 93d045a47aba -r d2fde259e96c external/bsd/flex/dist/buf.c
--- a/external/bsd/flex/dist/buf.c      Sat Apr 06 14:05:39 2013 +0000
+++ b/external/bsd/flex/dist/buf.c      Sat Apr 06 14:27:52 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.c,v 1.1.1.2 2013/04/06 14:05:39 christos Exp $     */
+/*     $NetBSD: buf.c,v 1.2 2013/04/06 14:27:52 christos Exp $ */
 
 /* flex - tool to generate fast lexical analyzers */
 
@@ -92,7 +92,8 @@
  */
 struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
 {
-    char *dst, *src, *t;
+    char *dst, *t;
+    const char *src;
 
     t = flex_alloc (strlen ("#line \"\"\n")          +   /* constant parts */
                     2 * strlen (filename)            +   /* filename with possibly all backslashes escaped */
diff -r 93d045a47aba -r d2fde259e96c external/bsd/flex/dist/filter.c
--- a/external/bsd/flex/dist/filter.c   Sat Apr 06 14:05:39 2013 +0000
+++ b/external/bsd/flex/dist/filter.c   Sat Apr 06 14:27:52 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filter.c,v 1.1.1.2 2013/04/06 14:05:42 christos Exp $  */
+/*     $NetBSD: filter.c,v 1.2 2013/04/06 14:27:52 christos Exp $      */
 
 /* filter - postprocessing of flex output through filters */
 
@@ -137,9 +137,6 @@
 bool filter_apply_chain (struct filter * chain)
 {
        int     pid, pipes[2];
-       int     r;
-       const int readsz = 512;
-       char   *buf;
 
 
        /* Tricky recursion, since we want to begin the chain
diff -r 93d045a47aba -r d2fde259e96c external/bsd/flex/dist/flex.skl
--- a/external/bsd/flex/dist/flex.skl   Sat Apr 06 14:05:39 2013 +0000
+++ b/external/bsd/flex/dist/flex.skl   Sat Apr 06 14:27:52 2013 +0000
@@ -224,6 +224,7 @@
 #include <iostream> 
 #include <errno.h>
 #include <cstdlib>
+#include <cstdio>
 #include <cstring>
 /* end standard C++ headers. */
 %endif
@@ -294,6 +295,8 @@
 
 %# Declare yyguts variable
 m4_define( [[M4_YY_DECL_GUTS_VAR]], [[struct yyguts_t * yyg = (struct yyguts_t*)yyscanner]])
+%# Perform a noop access on yyguts to prevent unused variable complains
+m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[(void)yyg]])
 %# For use wherever a Global is accessed or assigned.
 m4_define( [[YY_G]], [[yyg->$1]])
 
@@ -351,6 +354,7 @@
 
 %# Define these macros to be no-ops.
 m4_define( [[M4_YY_DECL_GUTS_VAR]], [[m4_dnl]])
+m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[m4_dnl]])
 m4_define( [[YY_G]], [[($1)]])
 m4_define( [[M4_YY_PROTO_LAST_ARG]])
 m4_define( [[M4_YY_PROTO_ONLY_ARG]],  [[void]])
@@ -465,8 +469,13 @@
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 %if-not-reentrant
-extern int yyleng;
+extern yy_size_t yyleng;
 %endif
 
 %if-c-only
@@ -528,11 +537,6 @@
 #define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG )
 ]])
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
@@ -557,7 +561,7 @@
        /* Number of characters read into yy_ch_buf, not including EOB
         * characters.
         */
-       int yy_n_chars;
+       yy_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
@@ -646,8 +650,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 = (char *) 0;
@@ -683,7 +687,7 @@
 
 YY_BUFFER_STATE yy_scan_buffer M4_YY_PARAMS( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );
 YY_BUFFER_STATE yy_scan_string M4_YY_PARAMS( yyconst char *yy_str M4_YY_PROTO_LAST_ARG );
-YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, int len M4_YY_PROTO_LAST_ARG );
+YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, yy_size_t len M4_YY_PROTO_LAST_ARG );
 
 %endif
 
@@ -812,8 +816,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;
@@ -950,7 +954,7 @@
 
 m4_ifdef( [[M4_YY_NO_GET_LENG]],,
 [[
-int yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
+yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
 ]])
 
 m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
@@ -968,6 +972,22 @@
 void yyset_lineno M4_YY_PARAMS( int _line_number M4_YY_PROTO_LAST_ARG );
 ]])
 
+m4_ifdef( [[M4_YY_REENTRANT]],
+[[
+m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
+[[
+int yyget_column  M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );
+]])
+]])
+
+m4_ifdef( [[M4_YY_REENTRANT]],
+[[
+m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,
+[[
+void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG );
+]])
+]])
+
 %if-bison-bridge
 m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
 [[
@@ -1085,7 +1105,7 @@
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
 %endif
 %if-c++-only C++ definition
 #define ECHO LexerOutput( yytext, yyleng )
@@ -1640,7 +1660,7 @@
 
        else
                {
-                       int num_to_read =
+                       yy_size_t num_to_read =
                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
                while ( num_to_read <= 0 )
@@ -1652,14 +1672,14 @@
 ]],
 [[
                        /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
 
                        int yy_c_buf_p_offset =
                                (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf);
 
                        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;
@@ -1691,7 +1711,7 @@
 
                /* Read in more data. */
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-                       YY_G(yy_n_chars), (size_t) num_to_read );
+                       YY_G(yy_n_chars), num_to_read );
 
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
                }
@@ -1775,6 +1795,7 @@
     M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */
 %% [17.0] code to find the next state, and perhaps do backing up, goes here
 
+       M4_YY_NOOP_GUTS_VAR();
        return yy_is_jam ? 0 : yy_current_state;
 }
 
@@ -1800,7 +1821,7 @@
        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                { /* need to shift things up to make room */
                /* +2 for EOB chars. */
-               register int number_to_move = YY_G(yy_n_chars) + 2;
+               register yy_size_t number_to_move = YY_G(yy_n_chars) + 2;
                register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
                register char *source =
@@ -1867,7 +1888,7 @@
 
                else
                        { /* need more input */
-                       int offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);
+                       yy_size_t offset = 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 ) )
@@ -2063,25 +2084,6 @@
 }
 
 
-%if-c-only
-m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],,
-[[
-    m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,
-    [[
-#ifndef __cplusplus
-extern int isatty M4_YY_PARAMS( int );
-#endif /* __cplusplus */
-    ]])
-]])
-%endif
-
-%if-c++-only
-m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],,
-[[
-extern "C" int isatty M4_YY_PARAMS( int );
-]])
-%endif
-
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
  * such as during a yyrestart() or at EOF.
@@ -2246,7 +2248,7 @@
 void yyFlexLexer::yyensure_buffer_stack(void)
 %endif
 {
-       int num_to_alloc;
+       yy_size_t num_to_alloc;
     M4_YY_DECL_GUTS_VAR();
 
        if (!YY_G(yy_buffer_stack)) {
@@ -2361,12 +2363,12 @@
 %if-c-only
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  * M4_YY_DOC_PARAM
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE yy_scan_bytes  YYFARGS2( yyconst char *,yybytes, int ,_yybytes_len)
+YY_BUFFER_STATE yy_scan_bytes  YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yybytes_len)
 {
        YY_BUFFER_STATE b;
        char *buf;
@@ -2592,7 +2594,7 @@
 /** Get the length of the current token.
  * M4_YY_DOC_PARAM
  */
-int yyget_leng  YYFARGS0(void)
+yy_size_t yyget_leng  YYFARGS0(void)
 {
     M4_YY_DECL_GUTS_VAR();
     return yyleng;
@@ -2640,7 +2642,7 @@
     [[
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yyset_lineno called with no buffer" M4_YY_CALL_LAST_ARG); 



Home | Main Index | Thread Index | Old Index