[Midnightbsd-cvs] src [7079] trunk/contrib/flex: flex 2.5.39

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jul 9 16:52:07 EDT 2015


Revision: 7079
          http://svnweb.midnightbsd.org/src/?rev=7079
Author:   laffer1
Date:     2015-07-09 16:52:06 -0400 (Thu, 09 Jul 2015)
Log Message:
-----------
flex 2.5.39

Modified Paths:
--------------
    trunk/contrib/flex/buf.c
    trunk/contrib/flex/flex.skl
    trunk/contrib/flex/flexdef.h
    trunk/contrib/flex/flexint.h
    trunk/contrib/flex/main.c
    trunk/contrib/flex/scanflags.c

Modified: trunk/contrib/flex/buf.c
===================================================================
--- trunk/contrib/flex/buf.c	2015-07-09 20:51:56 UTC (rev 7078)
+++ trunk/contrib/flex/buf.c	2015-07-09 20:52:06 UTC (rev 7079)
@@ -90,11 +90,12 @@
  */
 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 */
-                    (int) (1 + log10 (abs (lineno))) +   /* line number */
+                    NUMCHARLINES                     +   /* line number */
                     1);                                  /* NUL */
     if (!t)
       flexfatal (_("Allocation of buffer for line directive failed"));

Modified: trunk/contrib/flex/flex.skl
===================================================================
--- trunk/contrib/flex/flex.skl	2015-07-09 20:51:56 UTC (rev 7078)
+++ trunk/contrib/flex/flex.skl	2015-07-09 20:52:06 UTC (rev 7079)
@@ -194,6 +194,15 @@
 ]])
 
 /* First, we deal with  platform-specific or compiler-specific issues. */
+#if defined(__MidnightBSD__)
+#ifndef __STDC_LIMIT_MACROS
+#define       __STDC_LIMIT_MACROS
+#endif
+#include <sys/cdefs.h>
+#include <stdint.h>
+#else
+#define       __dead2
+#endif
 
 /* begin standard C headers. */
 %if-c-only

Modified: trunk/contrib/flex/flexdef.h
===================================================================
--- trunk/contrib/flex/flexdef.h	2015-07-09 20:51:56 UTC (rev 7078)
+++ trunk/contrib/flex/flexdef.h	2015-07-09 20:52:06 UTC (rev 7079)
@@ -171,6 +171,8 @@
  */
 #define NUMDATALINES 10
 
+#define NUMCHARLINES 10
+
 /* transition_struct_out() definitions. */
 #define TRANS_STRUCT_PRINT_LENGTH 14
 

Modified: trunk/contrib/flex/flexint.h
===================================================================
--- trunk/contrib/flex/flexint.h	2015-07-09 20:51:56 UTC (rev 7078)
+++ trunk/contrib/flex/flexint.h	2015-07-09 20:52:06 UTC (rev 7079)
@@ -5,7 +5,8 @@
 
 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
 
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#if defined(__FreeBSD__) || \
+    (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  * if you want the limit (max/min) macros for int types. 

Modified: trunk/contrib/flex/main.c
===================================================================
--- trunk/contrib/flex/main.c	2015-07-09 20:51:56 UTC (rev 7078)
+++ trunk/contrib/flex/main.c	2015-07-09 20:52:06 UTC (rev 7079)
@@ -451,7 +451,7 @@
              char *str, *fmt = "#define %s %d\n";
              size_t strsz;
 
-             str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2);
+             str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + NUMCHARLINES + 2);
              if (!str)
                flexfatal(_("allocation of macro definition failed"));
              snprintf(str, strsz, fmt,      scname[i], i - 1);

Modified: trunk/contrib/flex/scanflags.c
===================================================================
--- trunk/contrib/flex/scanflags.c	2015-07-09 20:51:56 UTC (rev 7078)
+++ trunk/contrib/flex/scanflags.c	2015-07-09 20:52:06 UTC (rev 7079)
@@ -62,7 +62,7 @@
     _sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32));
     if (!_sf_stk)
         lerrsf_fatal(_("Unable to allocate %ld of stack"),
-            (long)sizeof(scanflags_t));
+            (void *)(uintptr_t)sizeof(scanflags_t));
     _sf_stk[_sf_top_ix] = 0;
 }
 



More information about the Midnightbsd-cvs mailing list