Author: Andreas Tille <tille@debian.org>
Last-Update: 2025-03-08
Bug-Debian: https://bugs.debian.org/1066362
Description: Deal with gcc-14 related issues:
- implicit-int
- implicit-function-declaration
Forwarded: not-needed
--- a/dconv.c
+++ b/dconv.c
@@ -17,7 +17,7 @@
 void (*dc_setrule)();
 int dc_scale;
 
-setcurdconv(dp)
+int setcurdconv(dp)
 struct dconv *dp;
 {
     curdconvp = dp;
@@ -42,14 +42,14 @@
     dc_scale = dp->dc_scale;
 }
 
-setdirhor()
+void setdirhor()
 {
     dc_movedown = curdconvp->dc_movedown;
     dc_moveover = curdconvp->dc_moveover;
     dc_setrule = curdconvp->dc_setrule;
 }
 
-setdirver()
+void setdirver()
 {
     dc_movedown = curdconvp->dc_movedown_v;
     dc_moveover = curdconvp->dc_moveover_v;
--- a/fontcom.c
+++ b/fontcom.c
@@ -6,6 +6,8 @@
 struct font_entry *hdfontent = NULL;
 struct font_entry *curfontent;
 
+extern int replfont(char *n, int s, char *rn, int *rd, int *rs);
+
 /*-->ReadFontDef*/
 /**********************************************************************/
 /****************************  ReadFontDef  ***************************/
@@ -93,7 +95,7 @@
  * font, the font may be used only in some chars of vf and the chars may
  * not be used in a particular dvi.
  */
-first_markchar(c)
+int  first_markchar(c)
 int c;
 {
     init_fontinfo(curfontent);
@@ -142,7 +144,7 @@
 /* operations for null font */
 
 /* ARGSUSED */
-null_markchar(c)
+int null_markchar(c)
 int c;
 {
 }
@@ -169,14 +171,14 @@
 }
 
 /* ARGSUSED */
-null_setchar(c)
+int null_setchar(c)
 int c;
 {
     return 0;
 }
 
 /* ARGSUSED */
-null_setstring(s, len)
+int null_setstring(s, len)
 char *s;
 int len;
 {
--- a/dviconv.c
+++ b/dviconv.c
@@ -247,13 +247,13 @@
 	}
 }
 
-initdir()
+void initdir()
 {
     dir = VER;
     setdir(HOR);
 }
 
-setdir(d)
+void setdir(d)
 int d;
 {
     d = d%NDIR;
--- a/fontdesc.c
+++ b/fontdesc.c
@@ -71,6 +71,7 @@
     NULL
 };
 
+ int getqfield0(char *field);
 
 /*
  * read_fontdesc
@@ -152,7 +153,7 @@
  * newlcd <- dir part of lcd+f
  */
 static
-findsearchfile(newf, newlcd, ld, lcd, f, ext)
+int findsearchfile(newf, newlcd, ld, lcd, f, ext)
 char *newf, *newlcd, *ld, *lcd, *f, *ext;
 {
     char *p;
@@ -180,7 +181,7 @@
  * newf, newlcd <- set by findsearchfile
  */
 static
-pathsearchfile(nextpath, path, newf, newlcd, newld, lcd, f, ext)
+int pathsearchfile(nextpath, path, newf, newlcd, newld, lcd, f, ext)
 char **nextpath, *path;
 char *newf, *newlcd, *newld, *lcd, *f, *ext;
 {
@@ -207,7 +208,7 @@
     return FALSE;
 }
 
-searchfile(f, newf, nld, top, ext)
+int searchfile(f, newf, nld, top, ext)
 char *f, *newf;
 struct libdir_body *nld;
 BOOLEAN top;
@@ -274,7 +275,7 @@
     return FALSE;
 }
 
-searchfiledir(f, ld, newf)
+int searchfiledir(f, ld, newf)
 char *f;
 struct libdir_body *ld;
 char *newf;
@@ -318,7 +319,7 @@
 	Fatal("fontdesc: %s illegal line %d", fdname, fdline);
 }
 
-getfield(field)
+int getfield(field)
 char *field;
 {
     char *fend;
@@ -343,8 +344,7 @@
     *field = '\0';
 }
 
-getqfield0(field)
-char *field;
+int getqfield0(char *field)
 {
     char *fend;
     int c;
@@ -367,14 +367,14 @@
 	getfield(field);
 }
 
-getqfield(field)
+int getqfield(field)
 char *field;
 {
     skipblanks();
     getqfield0(field);
 }
 
-getoqfield(field)
+int getoqfield(field)
 char *field;
 {
     skipblanks0();
@@ -384,7 +384,7 @@
 	*field = '\0';
 }
 
-getlfield(field)
+int getlfield(field)
 char *field;
 {
     char *fend;
@@ -520,7 +520,7 @@
     return NULL;
 }
 
-pathtype_init(proto, ff)
+int pathtype_init(proto, ff)
 char *proto;
 struct funcfont **ff;
 {
@@ -545,7 +545,7 @@
 static struct definition *definitions = NULL;
 static struct definition *arg_defs = NULL;
 
-add_def0(var, val)
+int add_def0(var, val)
 char *var, *val;
 {
     struct definition *def;
@@ -559,7 +559,7 @@
     definitions = def;
 }
 
-add_def(var, val)
+int add_def(var, val)
 char *var, *val;
 {
     char path[PATHLEN];
@@ -586,7 +586,7 @@
     return NULL;
 }
 
-arg_define(def)
+int arg_define(def)
 char *def;
 {
     char *val;
@@ -661,7 +661,7 @@
     getresolution
 };
 
-set_resolution(r)
+int set_resolution(r)
 char *r;
 {
     char val[PATHLEN];
@@ -747,7 +747,7 @@
     add_devfile(f, top, kind, "setupfile", &nextsf);
 }
 
-add_devfile(f, top, kind, k, np)
+int add_devfile(f, top, kind, k, np)
 char *f;
 BOOLEAN top;
 int kind;
@@ -778,7 +778,7 @@
     *np = &(df->df_next);
 }
 
-add_include_spec(f, op)
+int add_include_spec(f, op)
 char *f;
 void (*op)();
 {
@@ -792,7 +792,7 @@
     nextif = &(df->df_next);
 }
 
-add_setup_spec(f, op)
+int add_setup_spec(f, op)
 char *f;
 void (*op)();
 {
@@ -830,7 +830,7 @@
     getdevfileif(add_setupif);
 }
 
-getdevfile(add)
+int getdevfile(add)
 void (*add)();
 {
     char field_file[PATHLEN];
@@ -840,7 +840,7 @@
     (*add)(field_file, FALSE);
 }
 
-getdevfileif(add)
+int getdevfileif(add)
 void (*add)();
 {
     char field_kind[PATHLEN];
@@ -853,17 +853,17 @@
     (*add)(field_file, FALSE, dev_devfilekind(field_kind));
 }
 
-do_include()
+int do_include()
 {
     do_devfile(includefiles);
 }
 
-do_setup()
+int do_setup()
 {
     do_devfile(setupfiles);
 }
 
-do_devfile(df)
+int do_devfile(df)
 struct devfile *df;
 {
     for (; df != NULL; df = df->df_next)
@@ -892,7 +892,7 @@
     cconvlibdir.defpath = dvi2lib;
 }
 
-findcconvmap(name, file)
+int findcconvmap(name, file)
 char *name, *file;
 {
     return searchfiledir(name, &cconvlibdir, file);
@@ -1008,14 +1008,14 @@
 char *mfmodevname = "mode";
 char *kpsevname = "kpse";
 
-init_default(def_mfmode, def_kpse)
+int init_default(def_mfmode, def_kpse)
 char *def_mfmode, *def_kpse;
 {
     add_def0(mfmodevname, mfmode = def_mfmode);
     add_def0(kpsevname, def_kpse);
 }
 
-fix_default(def_resolution, def_mfmode)
+int fix_default(def_resolution, def_mfmode)
 int def_resolution;
 char *def_mfmode;
 {
@@ -1034,11 +1034,7 @@
 /*
  * replace font
  */
-replfont(n, s, rn, rd, rs)
-char *n;
-int s;
-char *rn;
-int *rd, *rs;
+int replfont(char *n, int s, char *rn, int *rd, int *rs)
 {
     struct fontreplace *fr;
     char *sb, *se;
--- a/dvi2.c
+++ b/dvi2.c
@@ -108,7 +108,7 @@
 /*******************************  main  *******************************/
 /**********************************************************************/
 
-main(argc, argv)
+int main(argc, argv)
 int argc;
 char *argv[];
 {
@@ -236,7 +236,7 @@
     /*NOTREACHED*/
 }
 
-default_def()
+int default_def()
 {
 #ifdef KPATHSEA
     add_def0("TEXMF", kpse_var_value("TEXMF"));
--- a/run.c
+++ b/run.c
@@ -312,7 +312,7 @@
 	Fatal("can't write to output file \"%s\"", outfile);
 }
 
-usage(c)
+int usage(c)
 char c;
 {
     (void)fprintf(stderr, "%c is not a legal flag\n", c);
--- a/virfont.c
+++ b/virfont.c
@@ -30,7 +30,7 @@
     init_jvf_fontinfo,
 };
 
-vftype_access(proto, fe, acca)
+int vftype_access(proto, fe, acca)
 char *proto;
 struct font_entry *fe;
 struct accarg *acca;
@@ -38,7 +38,7 @@
     return vfty_acc(proto, fe, acca, "vf", NULL);
 }
 
-jvftype_access(proto, fe, acca)
+int jvftype_access(proto, fe, acca)
 char *proto;
 struct font_entry *fe;
 struct accarg *acca;
@@ -47,7 +47,7 @@
     return vfty_acc(proto, fe, acca, "jvf", NULL);
 }
 
-vfty_acc(proto, fe, acca, type, suffix)
+int vfty_acc(proto, fe, acca, type, suffix)
 char *proto;
 struct font_entry *fe;
 struct accarg *acca;
@@ -104,19 +104,19 @@
 #define	NJISCHARS	(94*94+1)
 #define	JISDEFAULT	(94*94)
 
-read_vf_dviinfo(fe)
+int read_vf_dviinfo(fe)
 struct font_entry *fe;
 {
     read_vf_di(fe, CODE_NORMAL);
 }
 
-read_jvf_dviinfo(fe)
+int read_jvf_dviinfo(fe)
 struct font_entry *fe;
 {
     read_vf_di(fe, CODE_JIS);
 }
 
-read_vf_di(fe, coding)
+int read_vf_di(fe, coding)
 struct font_entry *fe;
 int coding;
 {
@@ -264,13 +264,13 @@
     return vfi;
 }
 
-vf_markchar(c)
+int vf_markchar(c)
 int c;
 {
     vf_mc(curfontent, &virfinfo(curfontent)->ch[c], c);
 }
 
-jvf_markchar(c)
+int jvf_markchar(c)
 int c;
 {
     int idx;
@@ -304,7 +304,7 @@
     return dvip;
 }
 
-vf_mc(fe, ce, c)
+void vf_mc(fe, ce, c)
 struct font_entry *fe;
 struct vfchar_entry *ce;
 int c;
@@ -392,7 +392,7 @@
     setcurfont(save_curfontent);
 }
 
-setc_com(cmd, dvip, dvilen, ce)
+int setc_com(cmd, dvip, dvilen, ce)
 byte cmd;
 byte *dvip;
 int dvilen;
@@ -445,13 +445,13 @@
     Fatal("%s implementation error: vf_fontdict", G_progname);
 }
 
-vf_setchar(c)
+int vf_setchar(c)
 int c;
 {
     return vf_sc(curfontent, &virfinfo(curfontent)->ch[c], c);
 }
 
-jvf_setchar(c)
+int jvf_setchar(c)
 int c;
 {
     int idx;
@@ -463,7 +463,7 @@
 }
 
 /* ARGSUSED */
-vf_sc(fe, ce, c)
+int vf_sc(fe, ce, c)
 struct font_entry *fe;
 struct vfchar_entry *ce;
 int c;
@@ -515,7 +515,7 @@
     return ce->tfmw;
 }
 
-vf_setstring(s, len)
+int vf_setstring(s, len)
 unsigned char *s;
 int len;
 {
@@ -530,7 +530,7 @@
     return 0;
 }
 
-jvf_setstring(s, len)
+int jvf_setstring(s, len)
 unsigned char *s;
 int len;
 {
--- a/gffont.c
+++ b/gffont.c
@@ -24,7 +24,7 @@
 static FILE *fntfp;
 void loadgfchar();
 
-gftype_access(proto, fe, acca)
+int gftype_access(proto, fe, acca)
 char *proto;
 struct font_entry *fe;
 struct accarg *acca;
--- a/pkfont.c
+++ b/pkfont.c
@@ -26,7 +26,7 @@
 static FILE *fntfp;
 void loadpkchar();
 
-pktype_access(proto, fe, acca)
+int pktype_access(proto, fe, acca)
 char *proto;
 struct font_entry *fe;
 struct accarg *acca;
@@ -135,7 +135,7 @@
     free((char *)rii);
 }
 
-readpkchar(flag, fe, rii)
+void readpkchar(flag, fe, rii)
 int flag;
 struct font_entry *fe;
 struct rastinitfontinfo *rii;
@@ -249,7 +249,7 @@
 
 /*	unpack run_encoded packet	*/
 
-unpack_run(pl)
+int unpack_run(pl)
 long pl;
 {
     unsigned char *p, *q;
@@ -290,7 +290,7 @@
 
 /*	unpack raster packet	*/
 
-unpack_raster()
+int unpack_raster()
 {
     unsigned char *p;
     int n, m, t, h, v;
--- a/rastfont.c
+++ b/rastfont.c
@@ -4,7 +4,7 @@
 
 struct rastaccessinfo raccinfo;
 
-rast_mag(fe, acca, t)
+int rast_mag(fe, acca, t)
 struct font_entry *fe;
 struct accarg *acca;
 int t;
@@ -30,7 +30,7 @@
 }
 
 #ifdef DEBUG
-rast_debug_report(fe, acca, ok, type)
+int rast_debug_report(fe, acca, ok, type)
 struct font_entry *fe;
 struct accarg *acca;
 BOOLEAN ok;
@@ -46,7 +46,7 @@
 }
 #endif
 
-check_id(name, id)
+int check_id(name, id)
 char	*name;
 int	id;
 {
@@ -67,12 +67,14 @@
     return TRUE;
 }
 
-init_rast_fontinfo(fe)
+int rast_markchar(int c);
+
+int init_rast_fontinfo(fe)
 struct font_entry *fe;
 {
     int i;
     struct rastinitfontinfo *k;
-    int	rast_markchar();
+    int rast_markchar();
 
     fe->fnt_markchar = rast_markchar;
     k = (struct rastinitfontinfo *)
@@ -86,16 +88,15 @@
     rastinifinfo(fe) = k;
 }
 
-rast_markchar(c)
-int c;
+int rast_markchar(int c)
 {
     if (c > MAXMARKCHAR) {
 	Warning("char %d in %s ignored", c, curfontent->name);
-	return;
+    } else {
+        rastinifinfo(curfontent)->mark[c] = TRUE;
+        if (c > rastinifinfo(curfontent)->maxc)
+	    rastinifinfo(curfontent)->maxc = c;
     }
-    rastinifinfo(curfontent)->mark[c] = TRUE;
-    if (c > rastinifinfo(curfontent)->maxc)
-	rastinifinfo(curfontent)->maxc = c;
 }
 
 struct rastfntinfo *
--- a/bifont.c
+++ b/bifont.c
@@ -69,7 +69,7 @@
 
 /* generic template for tfm access
  */
-gentfm_access(proto, fe, acca, dev_is_format, type)
+int gentfm_access(proto, fe, acca, dev_is_format, type)
 char *proto;
 struct font_entry *fe;
 struct accarg *acca;
@@ -102,7 +102,7 @@
 
 /* TYPE: tfm
  */
-tfm_access(proto, fe, acca)
+int tfm_access(proto, fe, acca)
 char *proto;
 struct font_entry *fe;
 struct accarg *acca;
--- a/pst1form.c
+++ b/pst1form.c
@@ -107,7 +107,7 @@
     EMIT(outfp, "readonly def\n");
 }
 
-stdex_type1_encoding(mark, maxc, remap)
+void stdex_type1_encoding(mark, maxc, remap)
 Boolean *mark;
 int maxc;
 unsigned char *remap;
--- a/ttfont.c
+++ b/ttfont.c
@@ -431,7 +431,7 @@
     if ((filename = kpsearch_file(fn, fe->n, kpse_truetype_format)) == NULL) {
 	Warning("FreeType font file %s not found", fn);
 	read_null_fontinfo(fe);
-	return;
+	return NULL;
     }
 #else
     filename = fn;
--- a/wlfont.c
+++ b/wlfont.c
@@ -93,7 +93,7 @@
 					      kpse_type1_format)) == NULL) {
 		    Warning("FreeType font file %s not found", k1wlfn);
 		    read_null_fontinfo(fe);
-		    return;
+		    return NULL;
 		}
 #else
 		filename = k1wlfn;
