summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2019-03-06 13:23:58 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2019-03-06 13:23:58 +0000
commitc4f771a2be42ef7a46974bea88d0a71987280e77 (patch)
treef67fd4f9e693c9779d61a34dabbca0788cfa9c2b /Build
parent5c369e9c0320131c484974d5aa932fe7d80cb7f4 (diff)
Sync with luatex revision 7102.
git-svn-id: svn://tug.org/texlive/trunk@50260 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/c-auto.in6
-rwxr-xr-xBuild/source/texk/web2c/configure2
-rw-r--r--Build/source/texk/web2c/configure.ac2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/texluac.c7
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c22
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex_svnversion.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.c4
-rw-r--r--Build/source/texk/web2c/mplibdir/mp.w23
-rw-r--r--Build/source/texk/web2c/mplibdir/psout.w3
12 files changed, 64 insertions, 17 deletions
diff --git a/Build/source/texk/web2c/c-auto.in b/Build/source/texk/web2c/c-auto.in
index 81d750ea7b8..6229f51f901 100644
--- a/Build/source/texk/web2c/c-auto.in
+++ b/Build/source/texk/web2c/c-auto.in
@@ -76,6 +76,9 @@
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
+/* Define to 1 if you have the `fabs' function. */
+#undef HAVE_FABS
+
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
@@ -103,6 +106,9 @@
/* Define to 1 if you have the <iostream> header file. */
#undef HAVE_IOSTREAM
+/* Define to 1 if you have the `labs' function. */
+#undef HAVE_LABS
+
/* Define to 1 if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H
diff --git a/Build/source/texk/web2c/configure b/Build/source/texk/web2c/configure
index 8b2a0fcd68f..8912391d251 100755
--- a/Build/source/texk/web2c/configure
+++ b/Build/source/texk/web2c/configure
@@ -22734,7 +22734,7 @@ if test "$ac_res" != no; then :
fi
-for ac_func in access atoi fmax ftime gettimeofday mkdtemp setlocale strerror strlcat strlcpy strndup
+for ac_func in access atoi fmax ftime gettimeofday fabs labs mkdtemp setlocale strerror strlcat strlcpy strndup
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/Build/source/texk/web2c/configure.ac b/Build/source/texk/web2c/configure.ac
index 5448f620321..8a6808c3de1 100644
--- a/Build/source/texk/web2c/configure.ac
+++ b/Build/source/texk/web2c/configure.ac
@@ -233,7 +233,7 @@ if test $ac_cv_sizeof_int -lt 4; then
fi
AC_CHECK_SIZEOF([long])
AC_SEARCH_LIBS([pow], [m])
-AC_CHECK_FUNCS([access atoi fmax ftime gettimeofday mkdtemp setlocale strerror strlcat strlcpy strndup])
+AC_CHECK_FUNCS([access atoi fmax ftime gettimeofday fabs labs mkdtemp setlocale strerror strlcat strlcpy strndup])
AC_CHECK_DECLS([strndup])
AC_CHECK_HEADERS([errno.h langinfo.h locale.h sys/time.h sys/timeb.h sys/wait.h time.h])
AC_CHECK_SIZEOF([void *])
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
index cb3736b8ee3..09a51bd1063 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
@@ -381,10 +381,10 @@ static int run_scan_int(lua_State * L)
*/
# define add_to_buffer(chr) \
- if (chr <= 255) { \
+ if (chr <= 127) { \
luaL_addchar(&b,(unsigned) (char) chr); \
} else { \
- uindex = uni2string((char *)word,(unsigned) chr); \
+ uindex = uni2string((char *)word,(unsigned int) chr); \
*uindex = '\0'; \
luaL_addstring(&b,(char *) word); \
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/texluac.c b/Build/source/texk/web2c/luatexdir/lua/texluac.c
index 61016cfdb5b..984a854c036 100644
--- a/Build/source/texk/web2c/luatexdir/lua/texluac.c
+++ b/Build/source/texk/web2c/luatexdir/lua/texluac.c
@@ -298,9 +298,14 @@ int luac_main(int ac, char *av[])
#define TSVALUE(o) tsvalue(o)
#endif
+/* if ts is a const pointer, using Lua's getstr(ts) is not correct */
+#define getconststr(ts) \
+ check_exp(sizeof((ts)->extra), cast(const char *, (ts)) + sizeof(UTString))
+
+
static void PrintString(const TString* ts)
{
- const char* s=getstr(ts);
+ const char* s=getconststr(ts);
size_t i,n;
#if (defined(LuajitTeX)) || (LUA_VERSION_NUM == 502)
n=ts->tsv.len;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
index 243d4ec6a44..16f540f1b0b 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
@@ -1442,7 +1442,7 @@ void NameOTLookup(OTLookup *otl,SplineFont *sf) {
found = found2;
if ( found!=NULL ) {
script_tag = found->script;
- for ( j=0; localscripts[j].text!=NULL && script_tag!=localscripts[j].tag; ++j );
+ for ( j=0; localscripts[j].text!=NULL && script_tag!=localscripts[j].tag; ++j ) {;}
#ifdef LUA_FF_LIB
buf[0] = fl->scripts->script>>24;
buf[1] = (fl->scripts->script>>16)&0xff;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
index 12b054ab46f..7d83c4e991c 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
@@ -710,8 +710,8 @@ static int PickCFFFont(char **fontnames) {
unichar_t **names;
int cnt, i, choice;
- for ( cnt=0; fontnames[cnt]!=NULL; ++cnt);
- names = gcalloc(cnt+1,sizeof(unichar_t *));
+ for ( cnt=0; fontnames[cnt]!=NULL; ++cnt){;}
+ names = gcalloc(cnt+1,sizeof(unichar_t *));
for ( i=0; i<cnt; ++i )
names[i] = uc_copy(fontnames[i]);
choice = 0;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
index f68ddc81d39..af2e72dad76 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
@@ -39,6 +39,14 @@ typedef struct quartic {
double a,b,c,d,e;
} Quartic;
+
+#ifdef HAVE_FABS
+#define FABS(x) fabs((x))
+#else
+#define FABS(x) ((x)>=0?(x):(-(x)))
+#endif
+
+
/* In an attempt to make allocation more efficient I just keep preallocated */
/* lists of certain common sizes. It doesn't seem to make much difference */
/* when allocating stuff, but does when freeing. If the extra complexity */
@@ -88,6 +96,8 @@ void chunktest(void) {
}
#endif
+
+
void *chunkalloc(int size) {
# if ALLOC_CHUNK<=1
return( gcalloc(1,size));
@@ -171,6 +181,9 @@ return;
}
#endif
+
+
+
char *strconcat(const char *str1,const char *str2) {
int len1 = strlen(str1);
char *ret = galloc(len1+strlen(str2)+1);
@@ -3109,18 +3122,21 @@ return( 0 );
return( cnt );
}
+
+
+
static int Closer(const Spline *s1,const Spline *s2,extended t1,extended t2,extended t1p,extended t2p) {
+ double dx,dy;
double x1 = ((s1->splines[0].a*t1+s1->splines[0].b)*t1+s1->splines[0].c)*t1+s1->splines[0].c;
double y1 = ((s1->splines[1].a*t1+s1->splines[1].b)*t1+s1->splines[1].c)*t1+s1->splines[1].c;
double x2 = ((s2->splines[0].a*t2+s2->splines[0].b)*t2+s2->splines[0].c)*t2+s2->splines[0].c;
double y2 = ((s2->splines[1].a*t2+s2->splines[1].b)*t2+s2->splines[1].c)*t2+s2->splines[1].c;
- double diff = abs(x1-x2) + abs(y1-y2);
+ double diff = FABS(x1-x2) + FABS(y1-y2);
double x1p = ((s1->splines[0].a*t1p+s1->splines[0].b)*t1p+s1->splines[0].c)*t1p+s1->splines[0].c;
double y1p = ((s1->splines[1].a*t1p+s1->splines[1].b)*t1p+s1->splines[1].c)*t1p+s1->splines[1].c;
double x2p = ((s2->splines[0].a*t2p+s2->splines[0].b)*t2p+s2->splines[0].c)*t2p+s2->splines[0].c;
double y2p = ((s2->splines[1].a*t2p+s2->splines[1].b)*t2p+s2->splines[1].c)*t2p+s2->splines[1].c;
- double diffp = abs(x1p-x2p) + abs(y1p-y2p);
-
+ double diffp = FABS(x1p-x2p) + FABS(y1p-y2p);
if ( diff<diffp )
return( false );
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
index 433bde2a4a7..672814ea5ef 100644
--- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1 +1 @@
-#define luatex_svn_revision 7084
+#define luatex_svn_revision 7097
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
index 78ce165957f..0bd5a3a7b12 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
@@ -947,7 +947,7 @@ static void init_pdf_outputparameters(PDF pdf)
pdf->inclusion_copy_font = fix_int(pdf_inclusion_copy_font, 0, 1);
pdf->pk_resolution = fix_int(pdf_pk_resolution, 72, 8000);
pdf->pk_fixed_dpi = fix_int(pdf_pk_fixed_dpi, 0, 1);
- if ((pdf->minor_version >= 5) && (pdf->objcompresslevel > 0)) {
+ if (((pdf->major_version > 1) || (pdf->minor_version >= 5)) && (pdf->objcompresslevel > 0)) {
pdf->os_enable = true;
} else {
if (pdf->objcompresslevel > 0) {
@@ -2483,7 +2483,7 @@ void scan_pdfcatalog(PDF pdf)
appendix C.1 of the \PDF\ standard. The maximum value of ints is |+2^32|, the
maximum value of reals is |+2^15| and the smallest values of reals is
|1/(2^16)|. We are quite large on precision, because it could happen that a
- pdf file imported as figure has real numbers with an unusual (and possibly useless)
+ pdf file imported as figure has real numbers with an unusual (and possibly useless)
high precision. Later the formatter will write the numbers in the correct format.
*/
diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w
index f4acc3d0e06..e0999e187f5 100644
--- a/Build/source/texk/web2c/mplibdir/mp.w
+++ b/Build/source/texk/web2c/mplibdir/mp.w
@@ -122,9 +122,24 @@ typedef struct pngout_data_struct *pngout_data;
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
+
#ifndef INTEGER_TYPE
typedef int integer;
+#define MPOST_ABS abs
+#else
+/* See source/texk/web2c/w2c/config.h */
+#if INTEGER_TYPE == long
+#ifdef HAVE_LABS
+#define MPOST_ABS labs
+#else
+#define MPOST_ABS abs
#endif
+#else
+#define MPOST_ABS abs
+#endif /* if INTEGER_TYPE == long */
+#endif /* ifndef INTEGER_TYPE */
+
+
@<Declare helpers@>;
@<Enumeration types@>;
@<Types in the outer block@>;
@@ -1783,7 +1798,7 @@ following subroutine is usually called with a parameter in the range |0<=n<=99|.
@c
static void mp_print_dd (MP mp, integer n) { /* prints two least significant digits */
- n = abs (n) % 100;
+ n = MPOST_ABS (n) % 100;
mp_print_char (mp, xord ('0' + (n / 10)));
mp_print_char (mp, xord ('0' + (n % 10)));
}
@@ -2943,7 +2958,11 @@ void *mp_xmalloc (MP mp, size_t nmem, size_t size) {
}
@ @<Internal library declarations@>=
-# define mp_snprintf (void)snprintf
+int mp_snprintf_res ;
+/* Some compilers (i.e. gcc 8.2.0 ) complained with the old */
+/* #define mp_snprintf (void)snprintf */
+/* about truncation. For the moment we store the result. */
+# define mp_snprintf mp_snprintf_res=snprintf
@* Dynamic memory allocation.
diff --git a/Build/source/texk/web2c/mplibdir/psout.w b/Build/source/texk/web2c/mplibdir/psout.w
index 6616d80b100..3c46d31879c 100644
--- a/Build/source/texk/web2c/mplibdir/psout.w
+++ b/Build/source/texk/web2c/mplibdir/psout.w
@@ -267,7 +267,7 @@ following subroutine is usually called with a parameter in the range |0<=n<=99|.
@c
static void mp_ps_print_dd (MP mp,integer n) { /* prints two least significant digits */
- n=abs(n) % 100;
+ n= MPOST_ABS(n) % 100;
mp_ps_print_char(mp, '0'+(n / 10));
mp_ps_print_char(mp, '0'+(n % 10));
}
@@ -560,6 +560,7 @@ avl_tree enc_tree;
@<Static variables in the outer block@>=
static char notdef[] = ".notdef";
+
@ @<Set initial...@>=
mp->ps->enc_tree = NULL;