diff --git a/source/texk/web2c/c-auto.in b/source/texk/web2c/c-auto.in index 81d750ea7b837bc1f8795fdab26b46d8c14346dc..6229f51f9011ec492ca8f1df8c9d322617d72c3b 100644 --- a/source/texk/web2c/c-auto.in +++ b/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/source/texk/web2c/configure b/source/texk/web2c/configure index 8b2a0fcd68f52f22927ead5aad2dcc54299e53a6..8912391d2518b5337f8101039cec9694940dce7b 100755 --- a/source/texk/web2c/configure +++ b/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/source/texk/web2c/configure.ac b/source/texk/web2c/configure.ac index 10aa5be8b1b35806393a82aee7fd067484703931..942fd0e5aa9aef6bd61bdb9b5c2ea0e9050d82f6 100644 --- a/source/texk/web2c/configure.ac +++ b/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/source/texk/web2c/luatexdir/lua/texluac.c b/source/texk/web2c/luatexdir/lua/texluac.c index 61016cfdb5b0ad42a6d207e7ad40eaa5024f50b3..984a854c036b780d625215fbe75e10d7b8f96c8f 100644 --- a/source/texk/web2c/luatexdir/lua/texluac.c +++ b/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/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c b/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c index 3d086b104822259f2dd36efedc297fe8965dca9a..4fd63c3defc8f3e58306487cd306a926c51b11c7 100644 --- a/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c +++ b/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c @@ -88,6 +88,13 @@ void chunktest(void) { } #endif +#ifdef HAVE_FABS +#define FABS(x) fabs((x)) +#else +#define FABS(x) ((x)>=0?(x):(-(x))) +#endif + + void *chunkalloc(int size) { # if ALLOC_CHUNK<=1 return( gcalloc(1,size)); @@ -3109,22 +3116,19 @@ 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; - /*was double diff = abs(x1-x2) + abs(y1-y2);*/ - dx=(x1-x2); dy=(y1-y2); - double diff = (dx>=0?dx:(-dx)) + (dy>=0?dy:(-dy)); + 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; - /*was double diffp = abs(x1p-x2p) + abs(y1p-y2p);*/ - dx=(x1p-x2p); dy=(y1p-y2p); - double diffp = (dx>=0?dx:(-dx)) + (dy>=0?dy:(-dy)); + double diffp = FABS(x1p-x2p) + FABS(y1p-y2p); if ( diff<diffp ) return( false ); diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index bbc8b545505e9cb04b3c94adedfc9ac89c563e77..672814ea5efdf32991876b50091218c0cebd5ece 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1 +1 @@ -#define luatex_svn_revision 7096 +#define luatex_svn_revision 7097 diff --git a/source/texk/web2c/mplibdir/mp.w b/source/texk/web2c/mplibdir/mp.w index f4acc3d0e0614a7a59fd153f449ade55c712913b..50423624f11cc507b5566ce1d38e209c4d3bf390 100644 --- a/source/texk/web2c/mplibdir/mp.w +++ b/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. @@ -3253,6 +3272,7 @@ mp_begin_group, /* beginning of a group (\&{begingroup}) */ mp_nullary, /* an operator without arguments (e.g., \&{normaldeviate}) */ mp_unary, /* an operator with one argument (e.g., \&{sqrt}) */ mp_str_op, /* convert a suffix to a string (\&{str}) */ +mp_void_op, /* convert a suffix to a boolean (\&{void}) */ mp_cycle, /* close a cyclic path (\&{cycle}) */ mp_primary_binary, /* binary operation taking `\&{of}' (e.g., \&{point}) */ mp_capsule_token, /* a value that has been put into a token list */ @@ -5009,6 +5029,8 @@ mp_primitive (mp, "step", mp_step_token, 0); @:step_}{\&{step} primitive@>; mp_primitive (mp, "str", mp_str_op, 0); @:str_}{\&{str} primitive@>; +mp_primitive (mp, "void", mp_void_op, 0); +@:void_}{\&{void} primitive@>; mp_primitive (mp, "tension", mp_tension, 0); @:tension_}{\&{tension} primitive@>; mp_primitive (mp, "to", mp_to_token, 0); @@ -5141,6 +5163,9 @@ break; case mp_str_op: mp_print (mp, "str"); break; +case mp_void_op: +mp_print (mp, "void"); +break; case mp_tension: mp_print (mp, "tension"); break; @@ -23733,6 +23758,25 @@ RESTART: mp->cur_exp.type = mp_string_type; goto DONE; break; + case mp_void_op: + { + /* Convert a suffix to a boolean */ + mp_value new_expr; + memset(&new_expr,0,sizeof(mp_value)); + new_number(new_expr.data.n); + mp_get_x_next (mp); + mp_scan_suffix (mp); + if (cur_exp_node() == NULL) { + set_number_from_boolean (new_expr.data.n, mp_true_code); + } else { + set_number_from_boolean (new_expr.data.n, mp_false_code); + } + mp_flush_cur_exp (mp, new_expr); + cur_exp_node() = NULL; /* !! do not replace with |set_cur_exp_node()| !! */ + mp->cur_exp.type = mp_boolean_type; + goto DONE; + } + break; case mp_internal_quantity: /* Scan an internal numeric quantity */ /* If an internal quantity appears all by itself on the left of an diff --git a/source/texk/web2c/mplibdir/psout.w b/source/texk/web2c/mplibdir/psout.w index 6616d80b1003a591675921f69c4b42e07e8d7bdf..3c46d31879cd7cb790fb843c3607a2ba667f5d5f 100644 --- a/source/texk/web2c/mplibdir/psout.w +++ b/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;