Subject: Fixing build error with GCC-14
Origin: upstream, commit mgetty_1_2_0-39-g823fb8d
Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Date: Mon Oct 28 08:24:03 2024 +0100
Bug-Debian: https://bugs.debian.org/1075266

    Greetings,

    Debian bug report <https://bugs.debian.org/1075266>:

    The GCC version 14 implemented stricter checks and/or Debian changed the
    default compile options. As a result, mgetty no longer builds for
    various -Wimplicit-int in contrib/g3toxwd.c and ontrib/g3tolj.c and
    other warnings.

    The patch attached add[s] the missing declarations. It's untested but still
    should do the right things.

    Cheers,

        Christoph

--- a/contrib/g3tolj.c
+++ b/contrib/g3tolj.c
@@ -66,6 +66,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 typedef unsigned char bit;
 
@@ -361,8 +362,8 @@
 
 static int dpi = 300;
 static int doubleheight = 1;
-static hscale = 100;
-static vscale = 100;
+static int hscale = 100;
+static int vscale = 100;
 static int cmode = 0;		/* compression mode, 1=rll, 2=tiff */
 
 static void putinit (), putbit (), putrest (), putitem ();
@@ -427,7 +428,7 @@
     return b;
 }
 
-addtohash (hash, te, n, a, b)
+void addtohash (hash, te, n, a, b)
      tableentry *hash[];
      tableentry *te;
      int n, a, b;
@@ -463,7 +464,7 @@
     return ((te && te->length == length && te->code == code) ? te : 0);
 }
 
-getfaxrow (row, bitrow)
+int getfaxrow (row, bitrow)
      int row;
      bit *bitrow;
 {
@@ -675,7 +676,7 @@
 static int lncnt = 0;
 static int maxline = 11 * 300;
 
-newpage (FILE * fd)
+void newpage (FILE * fd)
 {
     int i;
 
--- a/contrib/g3toxwd.c
+++ b/contrib/g3toxwd.c
@@ -415,8 +415,8 @@
 }
 
 static int doubleheight = 1;
-static hscale = 100;
-static vscale = 100;
+static int hscale = 100;
+static int vscale = 100;
 
 static void putinit (), putbit (), putrest (), putitem ();
 static int item, bitsperitem;
@@ -480,7 +480,7 @@
     return b;
 }
 
-addtohash (hash, te, n, a, b)
+void addtohash (hash, te, n, a, b)
      tableentry *hash[];
      tableentry *te;
      int n, a, b;
@@ -516,7 +516,7 @@
     return ((te && te->length == length && te->code == code) ? te : 0);
 }
 
-getfaxrow (row, bitrow)
+int getfaxrow (row, bitrow)
      int row;
      bit *bitrow;
 {
