Submitted By:            DJ Lucas <dj@linuxfromscratch.org>
Date:                    2025-06-14
Initial Package Version: 1.2.13
Upstream Status:         Applied
Origin:                  https://sourceforge.net/p/xine/xine-lib-1.2/commit_browser
                         Commits [a38be3] and [b5fd08]
Description:             Fixes build with GCC-15.


diff -Naurp xine-lib-1.2.13-orig/contrib/libfaad/sbr_fbt.c xine-lib-1.2.13/contrib/libfaad/sbr_fbt.c
--- xine-lib-1.2.13-orig/contrib/libfaad/sbr_fbt.c	2018-07-14 16:11:45.000000000 +0000
+++ xine-lib-1.2.13/contrib/libfaad/sbr_fbt.c	2025-06-15 02:44:59.208472828 +0000
@@ -105,9 +105,11 @@ uint8_t qmf_start_channel(uint8_t bs_sta
     }
 }
 
-static int longcmp(const void *a, const void *b)
-{
-    return ((int)(*(int32_t*)a - *(int32_t*)b));
+static int longcmp (const void *a, const void *b) {
+    const int32_t *d = (const int32_t *)a;
+    const int32_t *e = (const int32_t *)b;
+
+    return (int)(*d - *e);
 }
 
 /* calculate the stop QMF channel for the master frequency band table */
diff -Naurp xine-lib-1.2.13-orig/src/input/input_file.c xine-lib-1.2.13/src/input/input_file.c
--- xine-lib-1.2.13-orig/src/input/input_file.c	2023-01-25 16:03:17.000000000 +0000
+++ xine-lib-1.2.13/src/input/input_file.c	2025-06-15 02:44:59.208246778 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000-2022 the xine project
+ * Copyright (C) 2000-2025 the xine project
  *
  * This file is part of xine, a free video player.
  *
@@ -649,10 +649,13 @@ static int file_input_strverscmp (const
 }
 
 /*
- * Wrapper to file_input_strverscmp() for qsort() calls, which sort mrl_t type array.
+ * Wrapper to file_input_strverscmp () for qsort () calls, which sort mrl_t type array.
  */
-static int file_input_sortfiles_default (const xine_mrl_t *s1, const xine_mrl_t *s2) {
-  return(file_input_strverscmp(s1->mrl, s2->mrl));
+static int file_input_sortfiles_default (const void *a, const void *b) {
+  const xine_mrl_t *d = (const xine_mrl_t *)a;
+  const xine_mrl_t *e = (const xine_mrl_t *)b;
+
+  return file_input_strverscmp (d->mrl, e->mrl);
 }
 
 /*
@@ -735,7 +738,7 @@ static xine_mrl_t **file_input_class_get
   int                   num_dir_files   = 0;
   int                   num_norm_files  = 0;
   int                   num_files       = -1;
-  int                 (*func) ()        = file_input_sortfiles_default;
+  int                 (*cmp) (const void *a, const void *b) = file_input_sortfiles_default;
   int                   already_tried   = 0;
   int                   show_hidden_files;
 
@@ -914,14 +917,14 @@ static xine_mrl_t **file_input_class_get
     /*
      * Sort arrays
      */
-    if(num_dir_files)
-      qsort(dir_files, num_dir_files, sizeof(xine_mrl_t), func);
+    if (num_dir_files)
+      qsort (dir_files, num_dir_files, sizeof (xine_mrl_t), cmp);
 
-    if(num_hide_files)
-      qsort(hide_files, num_hide_files, sizeof(xine_mrl_t), func);
+    if (num_hide_files)
+      qsort (hide_files, num_hide_files, sizeof (xine_mrl_t), cmp);
 
-    if(num_norm_files)
-      qsort(norm_files, num_norm_files, sizeof(xine_mrl_t), func);
+    if (num_norm_files)
+      qsort (norm_files, num_norm_files, sizeof (xine_mrl_t), cmp);
 
     /*
      * Add directories entries
diff -Naurp xine-lib-1.2.13-orig/src/input/input_smb.c xine-lib-1.2.13/src/input/input_smb.c
--- xine-lib-1.2.13-orig/src/input/input_smb.c	2020-06-29 21:11:48.000000000 +0000
+++ xine-lib-1.2.13/src/input/input_smb.c	2025-06-15 02:45:38.424428767 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2020 the xine project
+ * Copyright (C) 2008-2025 the xine project
  *
  * This file is part of xine, a free video player.
  *
@@ -229,10 +229,13 @@ static int _strverscmp(const char *s1, c
 }
 
 /*
- * Wrapper to _strverscmp() for qsort() calls, which sort mrl_t type array.
+ * Wrapper to _strverscmp () for qsort () calls, which sort mrl_t type array.
  */
-static int _sortfiles_default(const xine_mrl_t *s1, const xine_mrl_t *s2) {
-  return(_strverscmp(s1->mrl, s2->mrl));
+static int smb_input_sortfiles_default (const void *a, const void *b) {
+  const xine_mrl_t *d = (const xine_mrl_t *)a;
+  const xine_mrl_t *e = (const xine_mrl_t *)b;
+
+  return _strverscmp (d->mrl, e->mrl);
 }
 
 
@@ -240,7 +243,7 @@ static xine_mrl_t **smb_class_get_dir (i
           const char *filename, int *nFiles) {
 
 	smb_input_class_t   *this = (smb_input_class_t *) this_gen;
-	int                 (*func) ()        = _sortfiles_default;
+	int                (*cmp) (const void *a, const void *b) = smb_input_sortfiles_default;
 	int        dir;
 	int i;
 	struct smbc_dirent  *pdirent;
@@ -338,11 +341,11 @@ static xine_mrl_t **smb_class_get_dir (i
 		/*
 		 * Sort arrays
 		 */
-		if(num_dir_files)
-			qsort(dir_files, num_dir_files, sizeof(xine_mrl_t), func);
+		if (num_dir_files)
+			qsort (dir_files, num_dir_files, sizeof (xine_mrl_t), cmp);
 
-		if(num_norm_files)
-			qsort(norm_files, num_norm_files, sizeof(xine_mrl_t), func);
+		if (num_norm_files)
+			qsort (norm_files, num_norm_files, sizeof (xine_mrl_t), cmp);
 
 		/*
 		 * Add directories entries
