From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by sourceware.org (Postfix) with ESMTP id 02DF63858C74 for ; Sun, 23 Apr 2023 00:55:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02DF63858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=nabijaczleweli.xyz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nabijaczleweli.xyz Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id DDE3168A0 for ; Sun, 23 Apr 2023 02:55:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1682211306; bh=wpKa8iYUbcYZqrFVH9FlMWhVoqDAHBV6miILoqmlwfM=; h=Date:From:Cc:Subject:From; b=D8NXAB1nKjxVZjSQSpZ3spSzNB0hMdfLdXz9VdIO1FC+KUloKxkpGWtr3ynNJ8JzF a/HOfw9+RzvstfYrf4Kx00E5+fvISnEssc9sbF3BY94F/dTfKBhf92GLFYixrp9hlU VJEmYVnTdG6sGVhnIfE2UkOJaZ957agvvvR78zAeFV1oxhDLhqmMvWPU5Vp2BIlEgG hqYVSz6PrkDUYKethbHjE5oNWMKfm6e5iguuCUw2WY1AxFtJRD8aM2di0vyqhwcLYC FZYmKiZWSCguU/kjYqqZeua0zADdRhQSxZ+43yT9KLBB5Jnwov6hWP4Mumc2tHfXRW 8xxX+Li3lnndQ== Date: Sun, 23 Apr 2023 02:55:05 +0200 From: =?utf-8?B?0L3QsNCx?= Cc: libc-alpha@sourceware.org Subject: [PATCH] Fix regex type usage Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eyljl3vo5p55yy4w" Content-Disposition: inline User-Agent: NeoMutt/20230407 X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,MISSING_HEADERS,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --eyljl3vo5p55yy4w Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable include/regex.h had not been updated during the int -> Idx transition, and the prototypes don't matched the definitions in regexec.c. In regcomp.c, most interfaces were updated for Idx, except for two ones guarded by #if _LIBC. Signed-off-by: Ahelenia Ziemia=C5=84ska --- Please keep me in CC, as I'm not subscribed. include/regex.h | 22 +++++++++++----------- posix/regcomp.c | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/regex.h b/include/regex.h index 34fb67d855..0ab70a63d4 100644 --- a/include/regex.h +++ b/include/regex.h @@ -11,27 +11,27 @@ extern const char *__re_compile_pattern (const char *pa= ttern, size_t length, extern int __re_compile_fastmap (struct re_pattern_buffer *buffer) attribute_hidden; =20 -extern int __re_search (struct re_pattern_buffer *buffer, const char *stri= ng, - int length, int start, int range, +extern regoff_t __re_search (struct re_pattern_buffer *buffer, const char = *string, + regoff_t length, regoff_t start, regoff_t range, struct re_registers *regs); =20 -extern int __re_search_2 +extern regoff_t __re_search_2 (struct re_pattern_buffer *buffer, const char *string1, - int length1, const char *string2, int length2, - int start, int range, struct re_registers *regs, int stop); + regoff_t length1, const char *string2, regoff_t length2, + regoff_t start, regoff_t range, struct re_registers *regs, regoff_t sto= p); =20 -extern int __re_match +extern regoff_t __re_match (struct re_pattern_buffer *buffer, const char *string, - int length, int start, struct re_registers *regs); + regoff_t length, regoff_t start, struct re_registers *regs); =20 -extern int __re_match_2 +extern regoff_t __re_match_2 (struct re_pattern_buffer *buffer, const char *string1, - int length1, const char *string2, int length2, - int start, struct re_registers *regs, int stop); + regoff_t length1, const char *string2, regoff_t length2, + regoff_t start, struct re_registers *regs, regoff_t stop); =20 extern void __re_set_registers (struct re_pattern_buffer *buffer, struct re_registers *regs, - unsigned num_regs, regoff_t *starts, regoff_t *ends); + __re_size_t num_regs, regoff_t *starts, regoff_t *ends); =20 extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags= ); libc_hidden_proto (__regcomp) diff --git a/posix/regcomp.c b/posix/regcomp.c index cbd9bfc673..a928ef6c2d 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -2940,7 +2940,7 @@ lookup_collation_sequence_value (bracket_elem_t *br_e= lem, uint32_t nrules, =20 static inline reg_errcode_t __attribute__ ((always_inline)) -build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc, +build_range_exp (bitset_t sbcset, re_charset_t *mbcset, Idx *range_alloc, bracket_elem_t *start_elem, bracket_elem_t *end_elem, re_dfa_t *dfa, reg_syntax_t syntax, uint32_t nrules, const unsigned char *collseqmb, const char *collseqwc, @@ -2984,7 +2984,7 @@ build_range_exp (bitset_t sbcset, re_charset_t *mbcse= t, int *range_alloc, /* There is not enough space, need realloc. */ uint32_t *new_array_start; uint32_t *new_array_end; - int new_nranges; + Idx new_nranges; =20 /* +1 in case of mbcset->nranges is 0. */ new_nranges =3D 2 * mbcset->nranges + 1; @@ -3030,7 +3030,7 @@ build_range_exp (bitset_t sbcset, re_charset_t *mbcse= t, int *range_alloc, static inline reg_errcode_t __attribute__ ((always_inline)) build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset, - int *coll_sym_alloc, const unsigned char *name, + Idx *coll_sym_alloc, const unsigned char *name, uint32_t nrules, int32_t table_size, const int32_t *symb_table, const unsigned char *extra) { @@ -3063,7 +3063,7 @@ build_collating_symbol (bitset_t sbcset, re_charset_t= *mbcset, { /* Not enough, realloc it. */ /* +1 in case of mbcset->ncoll_syms is 0. */ - int new_coll_sym_alloc =3D 2 * mbcset->ncoll_syms + 1; + Idx new_coll_sym_alloc =3D 2 * mbcset->ncoll_syms + 1; /* Use realloc since mbcset->coll_syms is NULL if *alloc =3D=3D 0. */ int32_t *new_coll_syms =3D re_realloc (mbcset->coll_syms, int32_t, --=20 2.30.2 --eyljl3vo5p55yy4w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmREgekACgkQvP0LAY0m WPHSug/+KnsiJm6pANvoaz8Ts76dpq/PxKxHh0gBoNATuZYSkr2CCLqbows4Ua0+ J0KOv/BXUKMZ2QO8HM7ILto6+90wGzJVX6FLlykao/sWgYnopUp6cOUf5Ep2IAx1 r+S3desC3SmQ7hkSJARrUZsk/nLdJ6CihuM4R062TeqFE6OxDW5R97IBLOjA37ae MiUKRr74hvP8dUqzrO+ngpUr0CN/TDiw8JQZy4uGVcZi0oGRmDGAhhqnnNgcPt9s LNq/xSNX2ZyX2yBt9vPlxilvwxdRvfhsmPkFxNn6ndjc14z3LauVck2syO1yMMLw xVSq0Idp2tlgg5BpseiR16Ca4bdCUR93XM2RcIwm7Oc4SseDh5Jd5adztbntIFQp 7TFKFb9whoPnTJ8JCkpBV9KkA/REK0H55idR9TtOkPq2zGA7TPV+LLS6xwAKBbMM jZUvHPbgHTz7uI4Ca7/Bwx5UOoEYm5aKPZhzGm5IWhepwTGG5JhqirqEBV3cbj6o JSbKVRDPEIyNua63nxNZTxLkhrrQWbwxXzJ5PluJTN4GW1YKzcNVpZquE8Nni1N8 m6mrjhndyljJ66hTFa8mKfnaP0+gMojmRd/39i7NdaI2LKrJQ6zOnWsfYVhLqJas LAr5xAzWGgfimw42KsY0FZicMluVlGqipHIWHJ5LYZYiIuHWC/s= =pXkV -----END PGP SIGNATURE----- --eyljl3vo5p55yy4w--