shntool/gcc-15-fixes.patch
Felix Kaechele fc11294121
fix gcc 15 build errors
- also update upstream URLs

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
2025-01-22 21:20:28 -05:00

90 lines
2.6 KiB
Diff

From 9b27cda17e20a733549763579b0734932ab68280 Mon Sep 17 00:00:00 2001
From: Felix Kaechele <felix@kaechele.ca>
Date: Wed, 22 Jan 2025 20:53:32 -0500
Subject: [PATCH] gcc 15 fixes
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
---
include/format.h | 2 +-
include/mode.h | 2 +-
include/module-types.h | 5 ++---
src/core_mode.c | 10 ++--------
4 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/include/format.h b/include/format.h
index 567993e805ba..ab293f8ae91d 100644
--- a/include/format.h
+++ b/include/format.h
@@ -35,7 +35,7 @@ void tagcpy(unsigned char *,unsigned char *);
int tagcmp(unsigned char *,unsigned char *);
/* function to check if a file name is about to be clobbered, and if so, asks whether this is OK */
-int clobber_check(char *);
+bool clobber_check(char *);
/* find an output format module with the given name */
format_module *find_format(char *);
diff --git a/include/mode.h b/include/mode.h
index a9c8cd003d04..fc13d4f16940 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -78,7 +78,7 @@ void create_output_filename(char *,char *,char *);
FILE *open_output_stream(char *,proc_info *);
/* function to determine if two filenames point to the same file */
-int files_are_identical(char *,char *);
+bool files_are_identical(char *,char *);
/* function to remove a file if it exists */
void remove_file(char *);
diff --git a/include/module-types.h b/include/module-types.h
index c49c6613bde2..2cabf64d3598 100644
--- a/include/module-types.h
+++ b/include/module-types.h
@@ -23,6 +23,8 @@
#ifndef __MODULE_TYPES_H__
#define __MODULE_TYPES_H__
+#include <stdbool.h>
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -44,9 +46,6 @@
#define PATHSEPCHAR '/'
#endif
-/* boolean type */
-typedef int bool;
-
/* wtypes */
typedef unsigned long wlong;
typedef unsigned short wshort;
diff --git a/src/core_mode.c b/src/core_mode.c
index 4585b8376668..3e0a60c92050 100644
--- a/src/core_mode.c
+++ b/src/core_mode.c
@@ -564,18 +564,12 @@ static int compare_ascii(const wave_info **w1,const wave_info **w2)
static void ascii_sort_files(wave_info **filenames, int numfiles)
{
- int (*cmpfunc) ();
-
- cmpfunc = compare_ascii;
- qsort(filenames,numfiles,sizeof(wave_info *),cmpfunc);
+ qsort(filenames,numfiles,sizeof(wave_info *),(int (*)(const void*, const void*))compare_ascii);
}
static void version_sort_files(wave_info **filenames,int numfiles)
{
- int (*cmpfunc) ();
-
- cmpfunc = compare_version;
- qsort(filenames,numfiles,sizeof(wave_info *),cmpfunc);
+ qsort(filenames,numfiles,sizeof(wave_info *),(int (*)(const void*, const void*))compare_version);
}
/* public functions */
--
2.48.1