net-analyzer/ttcp: fix GCC 15.x issues

Closes: https://bugs.gentoo.org/945186
Closes: https://github.com/gentoo/gentoo/pull/44675
Signed-off-by: Vladislav Mikhailikov <vmikhailikov@gmail.com>
Signed-off-by: David Seifert <soap@gentoo.org>
This commit is contained in:
Vladislav Mikhailikov
2026-02-10 20:16:46 +01:00
committed by David Seifert
parent 837177b505
commit ae6ebec352
2 changed files with 80 additions and 1 deletions
@@ -0,0 +1,77 @@
Fix GCC 15.x issues.
--- a/ttcp.c
+++ b/ttcp.c
@@ -157,16 +157,16 @@
unsigned long numCalls; /* # of I/O system calls */
double cput, realt; /* user, real time (seconds) */
-void err();
-void mes();
-void pattern();
+void err(const char *);
+void mes(const char *);
+void pattern(register char *, register int);
void prep_timer();
-double read_timer();
-int Nread();
-int Nwrite();
-void delay();
-int mread();
-char *outfmt();
+double read_timer(char *, int);
+int Nread(int, void *, int);
+int Nwrite(int, void *, int);
+void delay(int);
+int mread(int, register char *, unsigned int);
+char *outfmt(const double);
int
main(int argc, char **argv)
@@ -560,7 +560,7 @@
}
void
-err(char *s)
+err(const char *s)
{
fprintf(stderr, "ttcp%s: ", trans ? "-t" : "-r");
perror(s);
@@ -569,7 +569,7 @@
}
void
-mes(char *s)
+mes(const char *s)
{
fprintf(stderr, "ttcp%s: %s\n", trans ? "-t" : "-r", s);
}
@@ -586,7 +586,7 @@
}
char *
-outfmt(double b)
+outfmt(const double b)
{
static char obuf[50];
switch (fmt) {
@@ -616,10 +616,15 @@
static struct timeval time0; /* Time at which timing started */
static struct rusage ru0; /* Resource utilization at the start */
-static void prusage();
-static void tvadd();
-static void tvsub();
-static void psecs();
+static void prusage(
+ register struct rusage *,
+ register struct rusage *,
+ struct timeval *,
+ struct timeval *,
+ char *);
+static void tvadd(struct timeval *, struct timeval *, struct timeval *);
+static void tvsub(struct timeval *, struct timeval *, struct timeval *);
+static void psecs(long, register char *);
/*
* P R E P _ T I M E R
+3 -1
View File
@@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -17,6 +17,8 @@ LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~mips ~ppc ~sparc ~x86"
PATCHES=( "${FILESDIR}"/${P}-c23.patch )
src_prepare() {
cp "${DISTDIR}"/${P}.c ${PN}.c || die
default