summaryrefslogtreecommitdiff
path: root/src/character.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-08-26 01:41:36 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-08-26 01:41:36 -0700
commitd5172d4fbc2ca871d18426fb9e84ee6bb87a0e68 (patch)
treefe1dd8c01faf007f86f46cbf4a6f441ae28b104d /src/character.c
parent6af64513413d7194cfa2d8308db2d73f6ed64bf4 (diff)
downloademacs-d5172d4fbc2ca871d18426fb9e84ee6bb87a0e68.tar.gz
* character.c, charset.c, chartab.c: Use bool for booleans.
* character.c (lisp_string_width, string_count_byte8) (string_escape_byte8): * charset.c (charset_map_loaded, load_charset_map, read_hex): (load_charset_map_from_file, map_charset_chars) (Fdefine_charset_internal, define_charset_internal) (Fdeclare_equiv_charset, find_charsets_in_text) (Ffind_charset_region, char_charset, Fiso_charset): * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range) (sub_char_table_set, sub_char_table_set_range) (char_table_set_range, optimize_sub_char_table) (map_sub_char_table): Use bool for boolean. * character.c (str_to_unibyte): Omit last boolean argument; it was always 0. All callers changed. * character.h, charset.h: Adjust to match previous changes. * character.h (char_printable_p): Remove decl of nonexistent function. * charset.h (struct charset): Members code_linear_p, iso_chars_96, ascii_compatible_p, supplementary_p, compact_codes_p, unified_p are all boolean, so make them single-bit bitfields.
Diffstat (limited to 'src/character.c')
-rw-r--r--src/character.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/character.c b/src/character.c
index b2acf36ec15..cfaaf8eeca9 100644
--- a/src/character.c
+++ b/src/character.c
@@ -427,7 +427,7 @@ lisp_string_width (Lisp_Object string, ptrdiff_t precision,
/* This set multibyte to 0 even if STRING is multibyte when it
contains only ascii and eight-bit-graphic, but that's
intentional. */
- int multibyte = len < SBYTES (string);
+ bool multibyte = len < SBYTES (string);
unsigned char *str = SDATA (string);
ptrdiff_t i = 0, i_byte = 0;
ptrdiff_t width = 0;
@@ -765,13 +765,10 @@ str_as_unibyte (unsigned char *str, ptrdiff_t bytes)
corresponding byte and store in DST. CHARS is the number of
characters in SRC. The value is the number of bytes stored in DST.
Usually, the value is the same as CHARS, but is less than it if SRC
- contains a non-ASCII, non-eight-bit character. If ACCEPT_LATIN_1
- is nonzero, a Latin-1 character is accepted and converted to a byte
- of that character code.
- Note: Currently the arg ACCEPT_LATIN_1 is not used. */
+ contains a non-ASCII, non-eight-bit character. */
ptrdiff_t
-str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, int accept_latin_1)
+str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars)
{
ptrdiff_t i;
@@ -781,8 +778,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i
if (CHAR_BYTE8_P (c))
c = CHAR_TO_BYTE8 (c);
- else if (! ASCII_CHAR_P (c)
- && (! accept_latin_1 || c >= 0x100))
+ else if (! ASCII_CHAR_P (c))
return i;
*dst++ = c;
}
@@ -793,7 +789,7 @@ str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, i
static ptrdiff_t
string_count_byte8 (Lisp_Object string)
{
- int multibyte = STRING_MULTIBYTE (string);
+ bool multibyte = STRING_MULTIBYTE (string);
ptrdiff_t nbytes = SBYTES (string);
unsigned char *p = SDATA (string);
unsigned char *pend = p + nbytes;
@@ -825,7 +821,7 @@ string_escape_byte8 (Lisp_Object string)
{
ptrdiff_t nchars = SCHARS (string);
ptrdiff_t nbytes = SBYTES (string);
- int multibyte = STRING_MULTIBYTE (string);
+ bool multibyte = STRING_MULTIBYTE (string);
ptrdiff_t byte8_count;
const unsigned char *src, *src_end;
unsigned char *dst;