Mercurial > hg > octave-kai > gnulib-hg
changeset 11458:96c4e5d901b9
Use the new u*_cmp2 functions.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 05 Apr 2009 13:03:09 +0200 |
parents | cc6b3eba9118 |
children | 5ebb27d6a0cc |
files | ChangeLog lib/unicase.h lib/unicase/u-casecmp.h lib/unicase/u16-casecmp.c lib/unicase/u32-casecmp.c lib/unicase/u8-casecmp.c lib/unicase/ulc-casecmp.c modules/unicase/u16-casecmp modules/unicase/u32-casecmp modules/unicase/u8-casecmp modules/unicase/ulc-casecmp |
diffstat | 11 files changed, 25 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2009-04-05 Bruno Haible <bruno@clisp.org> + * lib/unicase.h: Mention u*_cmp2. + * lib/unicase/u-casecmp.h (FUNC): Invoke U_CMP2 instead of U_CMP. + * lib/unicase/u8-casecmp.c: Use u8_cmp2 instead of u8_cmp. + * lib/unicase/ulc-casecmp.c: Likewise. + * lib/unicase/u16-casecmp.c: Use u16_cmp2 instead of u16_cmp. + * lib/unicase/u32-casecmp.c: Use u32_cmp2 instead of u32_cmp. + * modules/unicase/u8-casecmp (Depends-on): Add unistr/u8-cmp2, remove + unistr/u8-cmp. + * modules/unicase/ulc-casecmp (Depends-on): Likewise. + * modules/unicase/u16-casecmp (Depends-on): Add unistr/u16-cmp2, remove + unistr/u16-cmp. + * modules/unicase/u32-casecmp (Depends-on): Add unistr/u32-cmp2, remove + unistr/u32-cmp. + * lib/uninorm.h: Mention u*_cmp2. * lib/uninorm/u-normcmp.h (FUNC): Invoke U_CMP2 instead of U_CMP. * lib/uninorm/u8-normcmp.c: Use u8_cmp2 instead of u8_cmp.
--- a/lib/unicase.h +++ b/lib/unicase.h @@ -173,7 +173,7 @@ const char *iso639_language, uninorm_t nf, int *resultp); /* Converts the string S of length N to a string in locale encoding, in such a - way that comparing uN_casexfrm (S1) and uN_casexfrm (S2) with memcmp2() is + way that comparing uN_casexfrm (S1) and uN_casexfrm (S2) with uN_cmp2() is equivalent to comparing S1 and S2 with uN_casecoll(). NF must be either UNINORM_NFC, UNINORM_NFKC, or NULL for no normalization. */ extern char *
--- a/lib/unicase/u-casecmp.h +++ b/lib/unicase/u-casecmp.h @@ -54,15 +54,8 @@ } /* Compare the normalized strings. */ - cmp = U_CMP (norms1, norms2, MIN (norms1_length, norms2_length)); - if (cmp == 0) - { - if (norms1_length < norms2_length) - cmp = -1; - else if (norms1_length > norms2_length) - cmp = 1; - } - else if (cmp > 0) + cmp = U_CMP2 (norms1, norms1_length, norms2, norms2_length); + if (cmp > 0) cmp = 1; else if (cmp < 0) cmp = -1;
--- a/lib/unicase/u16-casecmp.c +++ b/lib/unicase/u16-casecmp.c @@ -31,5 +31,5 @@ #define UNIT uint16_t #define SRC_UNIT uint16_t #define U_CASEFOLD u16_casefold -#define U_CMP u16_cmp +#define U_CMP2 u16_cmp2 #include "u-casecmp.h"
--- a/lib/unicase/u32-casecmp.c +++ b/lib/unicase/u32-casecmp.c @@ -31,5 +31,5 @@ #define UNIT uint32_t #define SRC_UNIT uint32_t #define U_CASEFOLD u32_casefold -#define U_CMP u32_cmp +#define U_CMP2 u32_cmp2 #include "u-casecmp.h"
--- a/lib/unicase/u8-casecmp.c +++ b/lib/unicase/u8-casecmp.c @@ -31,5 +31,5 @@ #define UNIT uint8_t #define SRC_UNIT uint8_t #define U_CASEFOLD u8_casefold -#define U_CMP u8_cmp +#define U_CMP2 u8_cmp2 #include "u-casecmp.h"
--- a/lib/unicase/ulc-casecmp.c +++ b/lib/unicase/ulc-casecmp.c @@ -69,5 +69,5 @@ #define UNIT uint8_t #define SRC_UNIT char #define U_CASEFOLD ulc_u8_casefold -#define U_CMP u8_cmp +#define U_CMP2 u8_cmp2 #include "u-casecmp.h"
--- a/modules/unicase/u16-casecmp +++ b/modules/unicase/u16-casecmp @@ -9,7 +9,7 @@ unicase/base unicase/u16-casefold uninorm/decomposing-form -unistr/u16-cmp +unistr/u16-cmp2 minmax configure.ac:
--- a/modules/unicase/u32-casecmp +++ b/modules/unicase/u32-casecmp @@ -9,7 +9,7 @@ unicase/base unicase/u32-casefold uninorm/decomposing-form -unistr/u32-cmp +unistr/u32-cmp2 minmax configure.ac: