From f886bfc572f6a102ed1969be6c0316402a2cbb14 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 1 May 2026 22:42:58 -0400 Subject: [PATCH] misc: Address issues uncovered with GCC 16 + binutils 2.46 (1/N) * Funky macro-based definitions for memchr and strstr which require an #undef before we use our own in codecs & plugins * Return value of of strstr is const Still have several more warnings and link failure with some plugins but this is a good start. Change-Id: Ife1f2d3e6f0e0629e3125a9058abc39c6102f452 --- apps/cuesheet.c | 7 ++++--- apps/filetypes.c | 4 ++-- apps/gui/skin_engine/skin_parser.c | 2 +- apps/playlist.c | 2 +- apps/playlist_viewer.c | 2 +- apps/plugin.h | 2 ++ apps/plugins/lua/rockconf.h | 4 ++++ lib/rbcodec/codecs/lib/codeclib.c | 7 ++++--- 8 files changed, 19 insertions(+), 11 deletions(-) diff --git a/apps/cuesheet.c b/apps/cuesheet.c index c5a1aacad9..9779f40c5d 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c @@ -46,7 +46,8 @@ static bool search_for_cuesheet(const char *path, struct cuesheet_file *cue_file { size_t len; char cuepath[MAX_PATH]; - char *dot, *slash, *slash_cuepath; + char *dot, *slash_cuepath; + const char *slash; cue_file->pos = 0; cue_file->size = 0; @@ -281,7 +282,7 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue) } s = skip_whitespace(line); -/* RECOGNIZED TAGS *********************** +/* RECOGNIZED TAGS *********************** * eCS_TRACK = 0, eCS_INDEX_01, eCS_TITLE, * eCS_PERFORMER, eCS_SONGWRITER, eCS_FILE, */ @@ -306,7 +307,7 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue) cue->tracks[cue->track_count-1].offset = parse_cue_index(s); #endif } - else if (option != eCS_NOTFOUND) + else if (option != eCS_NOTFOUND) { char *dest = NULL; char *string = get_string(s); diff --git a/apps/filetypes.c b/apps/filetypes.c index 88e6a17666..0e16b2c24b 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -525,7 +525,7 @@ static void read_config_init(int fd) static int file_find_extension(const char* file) { - char *extension = strrchr(file, '.'); + const char *extension = strrchr(file, '.'); if (extension) extension++; return find_extension(extension); @@ -704,7 +704,7 @@ int filetype_load_plugin(const char* plugin, const char* file) { int i; char plugin_name[MAX_PATH]; - char *s; + const char *s; for (i=1;icodec_get_buffer((size_t *)&bufsize); - + return 0; } @@ -64,9 +64,9 @@ void* codec_malloc(size_t size) if (mem_ptr + (long)size > bufsize) return NULL; - + x=&mallocbuf[mem_ptr]; - + /* Keep memory aligned to MEM_ALIGN_SIZE. */ mem_ptr += MEM_ALIGN_UP(size); @@ -136,6 +136,7 @@ int memcmp(const void *s1, const void *s2, size_t n) return(ci->memcmp(s1,s2,n)); } +#undef memchr void* memchr(const void *s, int c, size_t n) { return(ci->memchr(s,c,n));