diff options
author | Bruno Haible <bruno@clisp.org> | 2009-04-05 13:03:09 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-04-05 13:03:09 +0200 |
commit | 70d0d751d147cd0a4f3d565622b889c211bbe917 (patch) | |
tree | 7be521a8860895cde5f5999f1703b39ec2060fdd /lib | |
parent | b298cff29e50ece882a3aea46340641f31c5b75d (diff) | |
download | gnulib-70d0d751d147cd0a4f3d565622b889c211bbe917.tar.gz |
Use the new u*_cmp2 functions.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicase.h | 2 | ||||
-rw-r--r-- | lib/unicase/u-casecmp.h | 11 | ||||
-rw-r--r-- | lib/unicase/u16-casecmp.c | 2 | ||||
-rw-r--r-- | lib/unicase/u32-casecmp.c | 2 | ||||
-rw-r--r-- | lib/unicase/u8-casecmp.c | 2 | ||||
-rw-r--r-- | lib/unicase/ulc-casecmp.c | 2 |
6 files changed, 7 insertions, 14 deletions
diff --git a/lib/unicase.h b/lib/unicase.h index 9f37a6b83c..73d2c07af2 100644 --- a/lib/unicase.h +++ b/lib/unicase.h @@ -173,7 +173,7 @@ extern int 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 * diff --git a/lib/unicase/u-casecmp.h b/lib/unicase/u-casecmp.h index 8ae23d703f..e1cf99c467 100644 --- a/lib/unicase/u-casecmp.h +++ b/lib/unicase/u-casecmp.h @@ -54,15 +54,8 @@ FUNC (const SRC_UNIT *s1, size_t n1, const SRC_UNIT *s2, size_t n2, } /* 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; diff --git a/lib/unicase/u16-casecmp.c b/lib/unicase/u16-casecmp.c index b4777f54ed..1110874ecc 100644 --- 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" diff --git a/lib/unicase/u32-casecmp.c b/lib/unicase/u32-casecmp.c index a691c43d3b..e964915f3c 100644 --- 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" diff --git a/lib/unicase/u8-casecmp.c b/lib/unicase/u8-casecmp.c index b7e250af26..4a55de911c 100644 --- 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" diff --git a/lib/unicase/ulc-casecmp.c b/lib/unicase/ulc-casecmp.c index b337ee2f6a..c061b24659 100644 --- a/lib/unicase/ulc-casecmp.c +++ b/lib/unicase/ulc-casecmp.c @@ -69,5 +69,5 @@ ulc_u8_casefold (const char *s, size_t n, const char *iso639_language, #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" |