diff options
Diffstat (limited to 'Build/source/texk/web2c/mplibdir')
-rw-r--r-- | Build/source/texk/web2c/mplibdir/ChangeLog | 45 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/am/libmplib.am | 47 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/am/mplib.am | 19 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/memio.w | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mp.w | 23 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mpost.w | 11 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mpxout.w | 34 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/psout.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/svgout.w | 17 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/tfmin.w | 6 |
10 files changed, 146 insertions, 72 deletions
diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog index 19a2050dee0..9484869d4d5 100644 --- a/Build/source/texk/web2c/mplibdir/ChangeLog +++ b/Build/source/texk/web2c/mplibdir/ChangeLog @@ -1,7 +1,52 @@ +2009-10-06 Peter Breitenlohner <peb@mppmu.mpg.de> + + * am/libmplib.am, am/mplib.am: Enable compiler warnings. + + * memio.w: Create and #include mpmemio.h (new internal header). + * tfmin.w: Create and #include mptfmin.h (new internal header). + * mp.w: #include mpmemio.h and mptfmin.h; drop extern decls for + functions from memio.w and tfmin.w. + + Avoid many (--enable-...=max) compiler warnings. + + * mp.w (mp_set_internal): Declare local string errid as const. + (mp_check_mem): Declare as static. + (mp_w_open_in, mp_print_word, mp_search_mem, mp_divide_scaled): + Comment out unused functions. + * psout.w (cs_do_debug, mp_gr_htap_ypoc): Comment out unused + functions. + * svgout.w: #include mplibsvg.h. + (mp_svg_font_pair_out, mp_svg_trans_pair_out, + mp_svg_print_glyph_defs): Declare as static. + (mp_svg_open_starttag, mp_svg_endtag, mp_svg_attribute): Declare + param strings as const. + (append_string): Declare local string ss as const. + (mp_svg_print): Drop useless (const *) cast. + + * mpost.w (recorder_start, internal_set_option, run_set_list): + Declare as static. + (mpost_run_make_mpx, mpost_run_dvitomp): Declare local string + banner as const. + * mpxout.w (mpx_printf, mpx_report, mpx_warn, mpx_error, + mpx_abort, mpx_xfopen, mpx_match_str, mpx_def_named_color, + mpx_fsearch, mpx_read_fmap, mpx_read_char_adj, mpx_rename): + Declare param strings as const. + (progname): Declare global string as const. + (named_color_record): Declare member strings as const. + 2009-10-02 Taco Hoekwater <taco@elvenkind.com> * Released version of MPLib 1.208 +2009-08-21 Peter Breitenlohner <peb@mppmu.mpg.de> + + * mpost.w (kpathsea_version_string): Drop extern decl. + +2009-08-16 Peter Breitenlohner <peb@mppmu.mpg.de> + + * am/mplib.am (mplib_ctangle): Use tangle-sh. + * am/libmplib.am, am/mplib.am: Adapt to tangle-sh. + 2009-08-12 Taco Hoekwater <taco@elvenkind.com> * Released version of MPLib 1.207, including diff --git a/Build/source/texk/web2c/mplibdir/am/libmplib.am b/Build/source/texk/web2c/mplibdir/am/libmplib.am index bd8038d3de0..57bd47dae53 100644 --- a/Build/source/texk/web2c/mplibdir/am/libmplib.am +++ b/Build/source/texk/web2c/mplibdir/am/libmplib.am @@ -8,38 +8,41 @@ EXTRA_LIBRARIES += libmplib.a libmplib_a_CPPFLAGS = -I$(srcdir)/mplibdir +libmplib_a_CFLAGS = $(WARNING_CFLAGS) ## libmplib C sources libmplib_a_SOURCES = mplibdir/avl.h mplibdir/avl.c -nodist_libmplib_a_SOURCES = memio.c tfmin.c -nodist_libmplib_a_SOURCES += $(mp_c_h) $(psout_c_h) $(svgout_c_h) +nodist_libmplib_a_SOURCES = $(memio_c_h) $(mp_c_h) $(psout_c_h) $(svgout_c_h) $(tfmin_c_h) +memio_c_h = memio.c mpmemio.h mp_c_h = mp.c mplib.h mpmp.h psout_c_h = mppsout.h psout.c mplibps.h svgout_c_h = mplibsvg.h mpsvgout.h svgout.c +tfmin_c_h = mptfmin.h tfmin.c -memio.c: ctangle$(EXEEXT) mplibdir/memio.w - $(mp_ctangle) memio.w +$(memio_c_h): memio-tangle + @$(mp_ctangle_sh) memio +memio-tangle: ctangle$(EXEEXT) mplibdir/memio.w tangle-sh + @$(mp_ctangle_sh) memio -tfmin.c: ctangle$(EXEEXT) mplibdir/tfmin.w - $(mp_ctangle) tfmin.w +$(mp_c_h): mp-tangle + @$(mp_ctangle_sh) mp +mp-tangle: ctangle$(EXEEXT) mplibdir/mp.w tangle-sh + @$(mp_ctangle_sh) mp -$(mp_c_h): mp-ctangle -mp-ctangle: ctangle$(EXEEXT) mplibdir/mp.w - $(mp_ctangle) mp.w - echo timestamp >$@ - touch $(mp_c_h) +$(psout_c_h): psout-tangle + @$(mp_ctangle_sh) psout +psout-tangle: ctangle$(EXEEXT) mplibdir/psout.w tangle-sh + @$(mp_ctangle_sh) psout -$(psout_c_h): psout-ctangle -psout-ctangle: ctangle$(EXEEXT) mplibdir/psout.w - $(mp_ctangle) psout.w - echo timestamp >$@ - touch $(psout_c_h) +$(svgout_c_h): svgout-tangle + @$(mp_ctangle_sh) svgout +svgout-tangle: ctangle$(EXEEXT) mplibdir/svgout.w tangle-sh + @$(mp_ctangle_sh) svgout -$(svgout_c_h): svgout-ctangle -svgout-ctangle: ctangle$(EXEEXT) mplibdir/svgout.w - $(mp_ctangle) svgout.w - echo timestamp >$@ - touch $(svgout_c_h) +$(tfmin_c_h): tfmin-tangle + @$(mp_ctangle_sh) tfmin +tfmin-tangle: ctangle$(EXEEXT) mplibdir/tfmin.w tangle-sh + @$(mp_ctangle_sh) tfmin ## libmplib CWeb sources libmplib_web = mplibdir/mp.w mplibdir/psout.w mplibdir/svgout.w @@ -50,7 +53,7 @@ $(libmplib_a_OBJECTS): $(nodist_libmplib_a_SOURCES) EXTRA_DIST += $(libmplib_web) DISTCLEANFILES += $(nodist_libmplib_a_SOURCES) \ - mp-ctangle psout-ctangle svgout-ctangle + memio-tangle mp-tangle psout-tangle svgout-tangle tfmin-tangle ## only used by luaTeX EXTRA_DIST += mplibdir/lmplib.c diff --git a/Build/source/texk/web2c/mplibdir/am/mplib.am b/Build/source/texk/web2c/mplibdir/am/mplib.am index a4deeeb5c6d..64adde04a08 100644 --- a/Build/source/texk/web2c/mplibdir/am/mplib.am +++ b/Build/source/texk/web2c/mplibdir/am/mplib.am @@ -10,12 +10,16 @@ bin_PROGRAMS += mpost endif MP EXTRA_PROGRAMS += mpost -mp_ctangle = CWEBINPUTS=$(srcdir)/mplibdir $(ctangle) - mpost_CPPFLAGS = -I$(srcdir)/mplibdir +mpost_CFLAGS = $(WARNING_CFLAGS) mpost_DEPENDENCIES = libmplib.a mpost_LDADD = libmplib.a $(KPATHSEA_LIBS) -lm +# Creating one file: just one rule +mp_ctangle = CWEBINPUTS=$(srcdir)/mplibdir $(ctangle) +# Creating several files: need stamp file and two identical rules +mp_ctangle_sh = CWEBINPUTS=$(srcdir)/mplibdir $(SHELL) ./tangle-sh $@ $(CTANGLE) + ## MetaPost C sources nodist_mpost_SOURCES = mpost.c $(mpxout_c_h) mpxout_c_h = mpxout.c mpxout.h @@ -23,11 +27,10 @@ mpxout_c_h = mpxout.c mpxout.h mpost.c: ctangle$(EXEEXT) mplibdir/mpost.w $(mp_ctangle) mpost.w -$(mpxout_c_h): mpxout-ctangle -mpxout-ctangle: ctangle$(EXEEXT) mplibdir/mpxout.w - $(mp_ctangle) mpxout.w - echo timestamp >$@ - touch $(mpxout_c_h) +$(mpxout_c_h): mpxout-tangle + @$(mp_ctangle_sh) mpxout +mpxout-tangle: ctangle$(EXEEXT) mplibdir/mpxout.w tangle-sh + @$(mp_ctangle_sh) mpxout ## MetaPost CWeb sources mpost_web = mplibdir/mpost.w mplibdir/mpxout.w @@ -36,7 +39,7 @@ $(mpost_OBJECTS): $(nodist_mpost_SOURCES) libmplib.a EXTRA_DIST += mplibdir/ChangeLog $(mpost_web) -DISTCLEANFILES += $(nodist_mpost_SOURCES) mpxout-ctangle +DISTCLEANFILES += $(nodist_mpost_SOURCES) mpxout-tangle # Double-colon rules since we do something similar in luatexdir (maybe others). if MP diff --git a/Build/source/texk/web2c/mplibdir/memio.w b/Build/source/texk/web2c/mplibdir/memio.w index f487a4adc2b..d08df1be02a 100644 --- a/Build/source/texk/web2c/mplibdir/memio.w +++ b/Build/source/texk/web2c/mplibdir/memio.w @@ -53,6 +53,10 @@ #include <string.h> #include "mplib.h" #include "mpmp.h" +#include "mpmemio.h" /* internal header */ + +@ @(mpmemio.h@>= +extern void mp_store_mem_file (MP mp); @ @c void mp_store_mem_file (MP mp) { integer k; /* all-purpose index */ @@ -80,7 +84,10 @@ incompatible with the present \MP\ table sizes, etc. goto OFF_BASE; } -@c +@(mpmemio.h@>= +extern boolean mp_load_mem_file (MP mp); + +@ @c boolean mp_load_mem_file (MP mp) { integer k; /* all-purpose index */ pointer p,q; /* all-purpose pointers */ @@ -168,6 +175,9 @@ the same strings. (And it is, of course, a good thing that they do.) @.WEB@> @^string pool@> +@(mpmemio.h@>= +extern int mp_undump_constants (MP mp); + @ @c int mp_undump_constants (MP mp) { integer x; diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w index 63b7f301da0..f43416d57aa 100644 --- a/Build/source/texk/web2c/mplibdir/mp.w +++ b/Build/source/texk/web2c/mplibdir/mp.w @@ -157,7 +157,8 @@ typedef struct MP_instance { #include "mpmp.h" /* internal header */ #include "mppsout.h" /* internal header */ #include "mpsvgout.h" /* internal header */ -extern font_number mp_read_font_info (MP mp, char *fname); /* tfmin.w */ +#include "mptfmin.h" /* internal header */ +#include "mpmemio.h" /* internal header */ @h @<Declarations@> @<Basic printing procedures@> @@ -700,11 +701,13 @@ static boolean mp_a_open_in (MP mp, void **f, int ftype) { OPEN_FILE("r"); } @# +#if 0 /* unused */ boolean mp_w_open_in (MP mp, void **f) { /* open a word file for input */ *f = (mp->open_file)(mp,mp->name_of_file,"r",mp_filetype_memfile); return (*f ? true : false); } +#endif @# static boolean mp_a_open_out (MP mp, void **f, int ftype) { /* open a text file for output */ @@ -3837,6 +3840,7 @@ what type it is; so we print it in all modes. @^debugging@> @c +#if 0 /* unused */ void mp_print_word (MP mp,memory_word w) { /* prints |w| in all ways */ mp_print_int(mp, w.cint); mp_print_char(mp, xord(' ')); @@ -3851,6 +3855,7 @@ void mp_print_word (MP mp,memory_word w) { mp_print_int(mp, w.qqqq.b2); mp_print_char(mp, xord(':')); mp_print_int(mp, w.qqqq.b3); } +#endif @* \[10] Dynamic memory allocation. @@ -4504,7 +4509,7 @@ static void mp_reallocate_memory(MP mp, int l) { that are reserved now but were free the last time this procedure was called. @c -void mp_check_mem (MP mp,boolean print_locs ) { +static void mp_check_mem (MP mp,boolean print_locs ) { pointer p,q,r; /* current locations of interest in |mem| */ boolean clobbered; /* is something amiss? */ for (p=0;p<=mp->lo_mem_max;p++) { @@ -4626,6 +4631,7 @@ to rule out the places that do {\sl not\/} point to |p|, so a few false drops are tolerable. @c +#if 0 /* unused */ void mp_search_mem (MP mp, pointer p) { /* look for pointers to |p| */ integer q; /* current position being searched */ for (q=0;q<=mp->lo_mem_max;q++) { @@ -4646,6 +4652,7 @@ void mp_search_mem (MP mp, pointer p) { /* look for pointers to |p| */ } @<Search |eqtb| for equivalents equal to |p|@>; } +#endif @ Just before \.{INIMP} writes out the memory, it sorts the doubly linked available space list. The list is probably very short at such times, so a @@ -22434,7 +22441,7 @@ it calls |atoi| to get an integer from the start of the string. void mp_set_internal (MP mp, char *n, char *v, int isstring) { integer l = strlen(n); char err[256]; - char *errid = NULL; + const char *errid = NULL; if (l>0) { integer h = mp_compute_hash(mp, n,l); pointer p = h+hash_base; /* we start searching here */ @@ -25878,7 +25885,9 @@ for (i = 1;i<= 9; i++ ) { @ The following function divides |s| by |m|. |dd| is number of decimal digits. -@c scaled mp_divide_scaled (MP mp,scaled s, scaled m, integer dd) { +@c +#if 0 /* unused */ +scaled mp_divide_scaled (MP mp,scaled s, scaled m, integer dd) { scaled q,r; integer sign,i; sign = 1; @@ -25898,6 +25907,7 @@ for (i = 1;i<= 9; i++ ) { mp->scaled_out = sign*(s - (r / mp->ten_pow[dd])); return (sign*q); } +#endif @* \[44] Shipping pictures out. The |ship_out| procedure, to be described below, is given a pointer to @@ -26555,11 +26565,6 @@ mp->mem_ident=NULL; @ @<Initialize table entries...@>= mp->mem_ident=xstrdup(" (INIMP)"); -@ @<Declarations@>= -extern void mp_store_mem_file (MP mp) ; -extern boolean mp_load_mem_file (MP mp); -extern int mp_undump_constants (MP mp); - @ @<Dealloc variables@>= xfree(mp->mem_ident); diff --git a/Build/source/texk/web2c/mplibdir/mpost.w b/Build/source/texk/web2c/mplibdir/mpost.w index ddafb427cf7..3a76e5c3d34 100644 --- a/Build/source/texk/web2c/mplibdir/mpost.w +++ b/Build/source/texk/web2c/mplibdir/mpost.w @@ -53,7 +53,6 @@ have our customary command-line interface. #include <process.h> #endif #include <kpathsea/kpathsea.h> -extern KPSEDLL char *kpathsea_version_string; @= /*@@null@@*/ @> static char *mpost_tex_program = NULL; static int debug = 0; /* debugging for makempx */ #ifdef WIN32 @@ -208,7 +207,7 @@ static string normalize_quotes (const char *name, const char *mesg) { @ Helpers for the filename recorder. @c -void recorder_start(char *jobname) { +static void recorder_start(char *jobname) { char cwd[1024]; if (jobname==NULL) { recorder_name = mpost_xstrdup("mpout.fls"); @@ -359,7 +358,7 @@ static int mpost_run_make_mpx (MP mp, char *mpname, char *mpxname) { mpxopt->mpxname = qmpxname; mpxopt->find_file = makempx_find_file; { - char *banner = "% Written by metapost version "; + const char *banner = "% Written by metapost version "; mpxopt->banner = mpost_xmalloc(strlen(mpversion)+strlen(banner)+1); strcpy (mpxopt->banner, banner); strcat (mpxopt->banner, mpversion); @@ -425,7 +424,7 @@ static int mpost_run_dvitomp (char *dviname, char *mpxname) { mpxopt->find_file = makempx_find_file; { - char *banner = "% Written by dvitomp version "; + const char *banner = "% Written by dvitomp version "; mpxopt->banner = mpost_xmalloc(strlen(mpversion)+strlen(banner)+1); strcpy (mpxopt->banner, banner); strcat (mpxopt->banner, mpversion); @@ -585,7 +584,7 @@ As a special hidden feature, a missing right hand side is treated as if it was the integer value |1|. @c -void internal_set_option(const char *opt) { +static void internal_set_option(const char *opt) { struct set_list_item *itm; char *s, *v; int isstring = 0; @@ -625,7 +624,7 @@ runs thourgh the list of options and feeds them to the MPlib function |mp_set_internal|. @c -void run_set_list (MP mp) { +static void run_set_list (MP mp) { struct set_list_item *itm; itm = set_list; while (itm!=NULL) { diff --git a/Build/source/texk/web2c/mplibdir/mpxout.w b/Build/source/texk/web2c/mplibdir/mpxout.w index c8476685476..d82eab751df 100644 --- a/Build/source/texk/web2c/mplibdir/mpxout.w +++ b/Build/source/texk/web2c/mplibdir/mpxout.w @@ -206,7 +206,7 @@ int lnno ; /* current line number */ @ A set of basic reporting functions.
@c
-static void mpx_printf(MPX mpx, char *header, char *msg, va_list ap) {
+static void mpx_printf(MPX mpx, const char *header, const char *msg, va_list ap) {
fprintf(mpx->errfile, "makempx %s: %s:", header, mpx->mpname);
if (mpx->lnno!=0)
fprintf(mpx->errfile, "%d:", mpx->lnno);
@@ -216,7 +216,7 @@ static void mpx_printf(MPX mpx, char *header, char *msg, va_list ap) { }
@ @c
-static void mpx_report(MPX mpx, char *msg, ...) {
+static void mpx_report(MPX mpx, const char *msg, ...) {
va_list ap;
if (mpx->debug==0) return;
va_start(ap, msg);
@@ -227,7 +227,7 @@ static void mpx_report(MPX mpx, char *msg, ...) { }
@ @c
-static void mpx_warn(MPX mpx, char *msg, ...) {
+static void mpx_warn(MPX mpx, const char *msg, ...) {
va_list ap;
va_start(ap, msg);
mpx_printf(mpx, "warning", msg, ap);
@@ -237,7 +237,7 @@ static void mpx_warn(MPX mpx, char *msg, ...) { }
@ @c
-static void mpx_error(MPX mpx, char *msg, ...) {
+static void mpx_error(MPX mpx, const char *msg, ...) {
va_list ap;
va_start(ap, msg);
mpx_printf(mpx, "error", msg, ap);
@@ -255,7 +255,7 @@ jmp_buf jump_buf; @
@c
-static void mpx_abort(MPX mpx, char *msg, ...) {
+static void mpx_abort(MPX mpx, const char *msg, ...) {
va_list ap;
va_start(ap, msg);
fprintf(stderr, "fatal: ");
@@ -279,7 +279,7 @@ if (setjmp(mpx->jump_buf) != 0) { }
@ @c
-static FILE *mpx_xfopen (MPX mpx, char *fname, char *fmode) {
+static FILE *mpx_xfopen (MPX mpx, const char *fname, const char *fmode) {
FILE *f = fopen(fname,fmode);
if (f == NULL)
mpx_abort(mpx,"File open error for %s in mode %s", fname, fmode);
@@ -427,7 +427,7 @@ static char *mpx_getline(MPX mpx, FILE *mpfile) { and the next character is not a letter or an underscore.
@c
-static int mpx_match_str(char *s, char *t) {
+static int mpx_match_str(const char *s, const char *t) {
while (*t != 0) {
if (*s != *t)
return 0;
@@ -2158,8 +2158,8 @@ name, and decorate the relevant drawing commands with ``\.{withcolor @<Types...@>=
typedef struct named_color_record {
- char *name; /* color name */
- char *value; /* text to pass to MetaPost */
+ const char *name; /* color name */
+ const char *value; /* text to pass to MetaPost */
} named_color_record;
@ Declare the named-color array itself.
@@ -2172,7 +2172,7 @@ web_integer num_named_colors; /* number of elements of |named_colors| that are v @ This function, used only during initialization, defines a named color.
@c
-static void mpx_def_named_color (MPX mpx, char *n, char *v) {
+static void mpx_def_named_color (MPX mpx, const char *n, const char *v) {
mpx->num_named_colors++;
assert(mpx->num_named_colors<max_named_colors);
mpx->named_colors[mpx->num_named_colors].name = n;
@@ -2180,7 +2180,7 @@ static void mpx_def_named_color (MPX mpx, char *n, char *v) { }
@ @<Declarations@>=
-static void mpx_def_named_color (MPX mpx, char *n, char *v);
+static void mpx_def_named_color (MPX mpx, const char *n, const char *v);
@ During the initialization phase, we define values for all the named
colors defined in \.{colordvi.tex}. CMYK-to-RGB conversion by GhostScript.
@@ -2556,10 +2556,10 @@ static char *mpx_find_file (MPX mpx, const char *nam, const char *mode, int ftyp mpx->find_file = mpx_find_file;
@ @<Declarations@>=
-static FILE *mpx_fsearch(MPX mpx, char *nam, int format);
+static FILE *mpx_fsearch(MPX mpx, const char *nam, int format);
@ @c
-static FILE *mpx_fsearch(MPX mpx, char *nam, int format) {
+static FILE *mpx_fsearch(MPX mpx, const char *nam, int format) {
FILE *f = NULL;
char *fname = (mpx->find_file)(mpx, nam, "r", format);
if (fname) {
@@ -2752,7 +2752,7 @@ if the \TeX\ name matches the PostScript name. (|\t| means one or more tabs.) avl_tree trfonts;
@ @c
-static void mpx_read_fmap(MPX mpx, char *dbase) {
+static void mpx_read_fmap(MPX mpx, const char *dbase) {
FILE *fin;
avl_entry *tmp;
char *nam; /* a font name being read */
@@ -2808,7 +2808,7 @@ becomes redundant. Simply keeping an empty "trchars.adj" file around will do fine without requiring any changes to this program.
@c
-static void mpx_read_char_adj(MPX mpx, char *adjfile) {
+static void mpx_read_char_adj(MPX mpx, const char *adjfile) {
FILE *fin;
char buf[200];
avl_entry tmp, *p;
@@ -3805,7 +3805,7 @@ There is a -debug switch, preventing the removal of tmp files #define TROFF_OUTERR "mpxerr.t"
@ @c
-static void mpx_rename (MPX mpx, char *a, char *b) {
+static void mpx_rename (MPX mpx, const char *a, const char *b) {
mpx_report(mpx,"renaming %s to %s",a,b);
rename(a,b);
}
@@ -3813,7 +3813,7 @@ static void mpx_rename (MPX mpx, char *a, char *b) { @ @<Globals@>=
char tex[15] ;
int debug ;
-char *progname;
+const char *progname;
@ Cleaning up
@c
diff --git a/Build/source/texk/web2c/mplibdir/psout.w b/Build/source/texk/web2c/mplibdir/psout.w index 6ef31241135..1f65153f259 100644 --- a/Build/source/texk/web2c/mplibdir/psout.w +++ b/Build/source/texk/web2c/mplibdir/psout.w @@ -3569,6 +3569,7 @@ boolean cs_parse (MP mp, mp_ps_font *f, const char *cs_name, int subr); @c +#if 0 /* unused */ void cs_do_debug (MP mp, mp_ps_font *f, int i, char *s) { int n = cc_tab[i].nargs; (void)mp; /* for -Wall */ @@ -3579,6 +3580,7 @@ void cs_do_debug (MP mp, mp_ps_font *f, int i, char *s) { } fprintf (stdout,"%s\n", s); } +#endif boolean cs_parse (MP mp, mp_ps_font *f, const char *cs_name, int subr) { @@ -4926,6 +4928,7 @@ All node types are assumed to be |endpoint| or |explicit| only. This function is currenly unused. @c +#if 0 /* unused */ mp_knot * mp_gr_htap_ypoc (MP mp, mp_knot *p) { mp_knot *q, *pp, *qq, *rr; /* for list manipulation */ q=mp_xmalloc(mp, 1, sizeof (mp_knot)); /* this will correspond to |p| */ @@ -4951,6 +4954,7 @@ mp_knot * mp_gr_htap_ypoc (MP mp, mp_knot *p) { pp=gr_next_knot(pp); } } +#endif @ When a cyclic list of knot nodes is no longer needed, it can be recycled by calling the following subroutine. diff --git a/Build/source/texk/web2c/mplibdir/svgout.w b/Build/source/texk/web2c/mplibdir/svgout.w index 035734da53e..b94f469d78b 100644 --- a/Build/source/texk/web2c/mplibdir/svgout.w +++ b/Build/source/texk/web2c/mplibdir/svgout.w @@ -57,6 +57,7 @@ #include <string.h> #include "mplib.h" #include "mplibps.h" /* external header */ +#include "mplibsvg.h" /* external header */ #include "mpmp.h" /* internal header */ #include "mppsout.h" /* internal header */ #include "mpsvgout.h" /* internal header */ @@ -128,7 +129,7 @@ not be an issue to any respectable XML processing tool. @c static void mp_svg_print (MP mp, const char *ss) { - (mp->write_ascii_file)(mp,mp->output_file,(char *)ss); + (mp->write_ascii_file)(mp,mp->output_file,ss); mp->svg->file_offset += strlen(ss); } @@ -184,7 +185,7 @@ the end of the buffer. } while (0) @d append_string(A) do { - char *ss = (A); + const char *ss = (A); while (*ss != '\0') { append_char(*ss); ss++ ;} } while (0) @@ -303,7 +304,7 @@ The close function is trivial of course, but it looks nicer in the source. @d mp_svg_starttag(A,B) { mp_svg_open_starttag (A,B); mp_svg_close_starttag(A); } @c -static void mp_svg_open_starttag (MP mp, char *s) { +static void mp_svg_open_starttag (MP mp, const char *s) { int l = mp->svg->level * 2; mp_svg_print_ln(mp); while (l-->0) { @@ -326,7 +327,7 @@ level. If it is false, the end tag will appear immediatelu after the preceding output. @c -static void mp_svg_endtag (MP mp, char *s, boolean indent) { +static void mp_svg_endtag (MP mp, const char *s, boolean indent) { mp->svg->level--; if (indent) { int l = mp->svg->level * 2; @@ -345,7 +346,7 @@ static void mp_svg_endtag (MP mp, char *s, boolean indent) { that that is the |v| argument. @c -static void mp_svg_attribute (MP mp, char *s, char *v) { +static void mp_svg_attribute (MP mp, const char *s, const char *v) { mp_svg_print_char(mp, ' '); mp_svg_print(mp, s); mp_svg_print(mp,"=\""); @@ -388,7 +389,7 @@ void mp_svg_pair_out (MP mp,scaled x, scaled y) { } @ @c -void mp_svg_font_pair_out (MP mp,scaled x, scaled y) { +static void mp_svg_font_pair_out (MP mp,scaled x, scaled y) { mp_svg_store_scaled(mp, (x)); append_char(' '); mp_svg_store_scaled(mp, -(y)); @@ -406,7 +407,7 @@ have a specific helper to write such distorted pairs of coordinates out. @d double_from_scaled(a) (double)((a)/65536.0) @c -void mp_svg_trans_pair_out (MP mp, mp_pen_info *pen, scaled x, scaled y) { +static void mp_svg_trans_pair_out (MP mp, mp_pen_info *pen, scaled x, scaled y) { double sx,sy, rx,ry, px, py, retval, divider; sx = double_from_scaled(pen->sx); sy = double_from_scaled(pen->sy); @@ -793,7 +794,7 @@ static void mp_svg_font_path_out (MP mp, mp_knot *h) { } while (0) @c -void mp_svg_print_glyph_defs (MP mp, mp_edge_object *h) { +static void mp_svg_print_glyph_defs (MP mp, mp_edge_object *h) { mp_graphic_object *p; /* object index */ int k, l; /* general purpose indices */ int **mp_chars = NULL; /* a twodimensional array of used glyphs */ diff --git a/Build/source/texk/web2c/mplibdir/tfmin.w b/Build/source/texk/web2c/mplibdir/tfmin.w index 075db665af4..db604b67caf 100644 --- a/Build/source/texk/web2c/mplibdir/tfmin.w +++ b/Build/source/texk/web2c/mplibdir/tfmin.w @@ -49,13 +49,17 @@ #include <string.h> #include "mplib.h" #include "mpmp.h" /* internal header */ +#include "mptfmin.h" /* internal header */ @h @ The |font_ps_name| for a built-in font should be what PostScript expects. A preliminary name is obtained here from the \.{TFM} name as given in the |fname| argument. This gets updated later from an external table if necessary. -@c +@(mptfmin.h@>= +extern font_number mp_read_font_info (MP mp, char *fname); + +@ @c font_number mp_read_font_info (MP mp, char *fname) { boolean file_opened; /* has |tfm_infile| been opened? */ font_number n; /* the number to return */ |