diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:06:52 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:06:52 +0200 |
commit | 27dae84ed92f1ef0300263091972338d12e78348 (patch) | |
tree | 7c52931f474fafb8a4bd4fd15ca3461c77cdecc2 /lib/mbchar.h | |
parent | 4682deeb62247d34de87f8e777f99e2d337fd377 (diff) |
New upstream version 1.4.1upstream/1.4.1upstream
Diffstat (limited to 'lib/mbchar.h')
-rw-r--r-- | lib/mbchar.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/mbchar.h b/lib/mbchar.h index 5a1529dd..ba142425 100644 --- a/lib/mbchar.h +++ b/lib/mbchar.h @@ -1,5 +1,5 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005-2007, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2007, 2009-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -217,12 +217,12 @@ typedef struct mbchar mbchar_t; ((mbc1).wc_valid && (mbc2).wc_valid \ ? (mbc1).wc == (mbc2).wc \ : (mbc1).bytes == (mbc2).bytes \ - && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) + && memeq ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)) #define mb_caseequal(mbc1, mbc2) \ ((mbc1).wc_valid && (mbc2).wc_valid \ ? c32tolower ((mbc1).wc) == c32tolower ((mbc2).wc) \ : (mbc1).bytes == (mbc2).bytes \ - && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) + && memeq ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)) /* <ctype.h>, <wctype.h> classification. */ #define mb_isascii(mbc) \ @@ -262,9 +262,14 @@ mb_width_aux (char32_t wc) #if defined GNULIB_MBFILE /* Assignment. */ -# define mb_setascii(mbc, sc) \ - ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \ - (mbc)->wc = (mbc)->buf[0] = (sc)) +MBCHAR_INLINE void +mb_setascii (mbchar_t *mbc, char sc) +{ + mbc->ptr = mbc->buf; + mbc->bytes = 1; + mbc->wc_valid = true; + mbc->wc = mbc->buf[0] = sc; +} #endif /* Copying a character. */ |