From a979f1a9ffc2adfabdb6ca21683197365b6fe4ee Mon Sep 17 00:00:00 2001 From: tomo Date: Mon, 12 Jun 2000 08:17:43 +0000 Subject: [PATCH] (find_charsets_in_charc_string): Use `CHARC_CHARSET_ID'. (charc_string_displayed_columns): Use `CHARC_COLUMNS'. (convert_bufbyte_string_into_charc_dynarr): Use `CHAR_TO_CHARC'. (convert_charc_string_into_bufbyte_dynarr): Use `CHARC_TO_CHAR'. (convert_charc_string_into_malloced_string): Likewise. --- src/insdel.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/insdel.c b/src/insdel.c index a6d7eb2..8849225 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -3153,7 +3153,7 @@ find_charsets_in_charc_string (Charset_ID *charsets, const Charc *str, for (i = 0; i < len; i++) { - charsets[XCHARSET_ID (str[i].charset) - MIN_LEADING_BYTE] = 1; + charsets[CHARC_CHARSET_ID (str[i]) - MIN_LEADING_BYTE] = 1; } #endif } @@ -3186,7 +3186,7 @@ charc_string_displayed_columns (const Charc *str, Charcount len) int i; for (i = 0; i < len; i++) - cols += CHARSET_COLUMNS (XCHARSET (str[i].charset)); + cols += CHARC_COLUMNS (str[i]); return cols; #else /* not MULE */ @@ -3204,10 +3204,7 @@ convert_bufbyte_string_into_charc_dynarr (const Bufbyte *str, Bytecount len, while (str < strend) { - Charc ec; - - ec.code_point = ENCODE_CHAR (charptr_emchar (str), ec.charset); - Dynarr_add (dyn, ec); + Dynarr_add (dyn, CHAR_TO_CHARC (charptr_emchar (str))); INC_CHARPTR (str); } } @@ -3240,10 +3237,7 @@ convert_charc_string_into_bufbyte_dynarr (Charc *arr, int nels, for (i = 0; i < nels; i++) { - Charc ec = arr[i]; - - Bytecount len - = set_charptr_emchar (str, DECODE_CHAR (ec.charset, ec.code_point)); + Bytecount len = set_charptr_emchar (str, CHARC_TO_CHAR (arr[i])); Dynarr_add_many (dyn, str, len); } } @@ -3267,10 +3261,7 @@ convert_charc_string_into_malloced_string (Charc *arr, int nels, for (i = 0; i < nels; i++) { - Charc ec = arr[i]; - - str += set_charptr_emchar (str, - DECODE_CHAR (ec.charset, ec.code_point)); + str += set_charptr_emchar (str, CHARC_TO_CHAR (arr[i])); } *str = '\0'; len = str - strorig; -- 1.7.10.4