Description: Update regex library internal prototypes with arguments and reorder type definitions and prototypes.
 Needed to work with GCC15
Bug-Debian: https://bugs.debian.org/1097343

--- a/src/libraries/regex/regex.c
+++ b/src/libraries/regex/regex.c
@@ -839,13 +839,47 @@ static const char *re_error_msg[] =
     "Unmatched ) or \\)",			/* REG_ERPAREN */
   };
 
+
+/* Since we have one byte reserved for the register number argument to
+   {start,stop}_memory, the maximum number of groups we can report
+   things about is what fits in that byte.  */
+#define MAX_REGNUM 255
+
+/* But patterns can have more than `MAX_REGNUM' registers.  We just
+   ignore the excess.  */
+typedef unsigned regnum_t;
+
+
+/* Macros for the compile stack.  */
+
+/* Since offsets can go either forwards or backwards, this type needs to
+   be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1.  */
+typedef int pattern_offset_t;
+
+typedef struct
+{
+  pattern_offset_t begalt_offset;
+  pattern_offset_t fixup_alt_jump;
+  pattern_offset_t inner_group_offset;
+  pattern_offset_t laststart_offset;  
+  regnum_t regnum;
+} compile_stack_elt_t;
+
+
+typedef struct
+{
+  compile_stack_elt_t *stack;
+  unsigned size;
+  unsigned avail;			/* Offset of next open position.  */
+} compile_stack_type;
+
 /* Subroutine declarations and macros for regex_compile.  */
 
-static void store_op1 (), store_op2 ();
-static void insert_op1 (), insert_op2 ();
-static boolean at_begline_loc_p (), at_endline_loc_p ();
-static boolean group_in_compile_stack ();
-static reg_errcode_t compile_range ();
+static void store_op1 (re_opcode_t, unsigned char*, int), store_op2 (re_opcode_t, unsigned char*, int, int);
+static void insert_op1 (re_opcode_t, unsigned char*, int, unsigned char*), insert_op2 (re_opcode_t, unsigned char*, int, int, unsigned char*);
+static boolean at_begline_loc_p (const char *, const char *, reg_syntax_t), at_endline_loc_p (const char *, const char *, int);
+static boolean group_in_compile_stack (compile_stack_type, regnum_t);
+static reg_errcode_t compile_range (const char **, const char *, char *, reg_syntax_t, unsigned char*);
 
 /* Fetch the next character in the uncompiled pattern---translating it 
    if necessary.  Also cast from a signed character in the constant
@@ -966,39 +1000,6 @@ static reg_errcode_t compile_range ();
   } while (0)
 
 
-/* Since we have one byte reserved for the register number argument to
-   {start,stop}_memory, the maximum number of groups we can report
-   things about is what fits in that byte.  */
-#define MAX_REGNUM 255
-
-/* But patterns can have more than `MAX_REGNUM' registers.  We just
-   ignore the excess.  */
-typedef unsigned regnum_t;
-
-
-/* Macros for the compile stack.  */
-
-/* Since offsets can go either forwards or backwards, this type needs to
-   be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1.  */
-typedef int pattern_offset_t;
-
-typedef struct
-{
-  pattern_offset_t begalt_offset;
-  pattern_offset_t fixup_alt_jump;
-  pattern_offset_t inner_group_offset;
-  pattern_offset_t laststart_offset;  
-  regnum_t regnum;
-} compile_stack_elt_t;
-
-
-typedef struct
-{
-  compile_stack_elt_t *stack;
-  unsigned size;
-  unsigned avail;			/* Offset of next open position.  */
-} compile_stack_type;
-
 
 #define INIT_COMPILE_STACK_SIZE 32
 
@@ -2991,12 +2992,6 @@ re_search_2 (bufp, string1, size1, strin
   return -1;
 } /* re_search_2 */
 
-/* Declarations and macros for re_match_2.  */
-
-static int bcmp_translate ();
-static boolean alt_match_null_string_p (),
-               common_op_match_null_string_p (),
-               group_match_null_string_p ();
 
 /* Structure for per-register (a.k.a. per-group) information.
    This must not be longer than one word, because we push this value
@@ -3024,6 +3019,13 @@ typedef union
   } bits;
 } register_info_type;
 
+/* Declarations and macros for re_match_2.  */
+
+static int bcmp_translate (unsigned char *, unsigned char *, register int, char*);
+static boolean alt_match_null_string_p (unsigned char *, unsigned char *, register_info_type*),
+    common_op_match_null_string_p (unsigned char **, unsigned char *, register_info_type*),
+    group_match_null_string_p (unsigned char **, unsigned char *, register_info_type*);
+
 #define REG_MATCH_NULL_STRING_P(R)  ((R).bits.match_null_string_p)
 #define IS_ACTIVE(R)  ((R).bits.is_active)
 #define MATCHED_SOMETHING(R)  ((R).bits.matched_something)
