1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00

Rename 'scm_c_make_char' to 'scm_i_make_char'.

* libguile/chars.c, libguile/chars.h, libguile/ports.c,
libguile/print.c, libguile/read.c, libguile/srfi-13.c,
libguile/strings.c, libguile/vm-engine.c: Rename 'scm_c_make_char' to
'scm_i_make_char'.
This commit is contained in:
Mark H Weaver 2019-06-18 07:30:54 -04:00
parent 2d49ffa588
commit 579dd2da44
8 changed files with 34 additions and 34 deletions

View file

@ -454,7 +454,7 @@ SCM_DEFINE (scm_char_upcase, "char-upcase", 1, 0, 0,
#define FUNC_NAME s_scm_char_upcase #define FUNC_NAME s_scm_char_upcase
{ {
SCM_VALIDATE_CHAR (1, chr); SCM_VALIDATE_CHAR (1, chr);
return scm_c_make_char (scm_c_upcase (SCM_CHAR (chr))); return scm_i_make_char (scm_c_upcase (SCM_CHAR (chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -465,7 +465,7 @@ SCM_DEFINE (scm_char_downcase, "char-downcase", 1, 0, 0,
#define FUNC_NAME s_scm_char_downcase #define FUNC_NAME s_scm_char_downcase
{ {
SCM_VALIDATE_CHAR (1, chr); SCM_VALIDATE_CHAR (1, chr);
return scm_c_make_char (scm_c_downcase (SCM_CHAR(chr))); return scm_i_make_char (scm_c_downcase (SCM_CHAR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -475,7 +475,7 @@ SCM_DEFINE (scm_char_titlecase, "char-titlecase", 1, 0, 0,
#define FUNC_NAME s_scm_char_titlecase #define FUNC_NAME s_scm_char_titlecase
{ {
SCM_VALIDATE_CHAR (1, chr); SCM_VALIDATE_CHAR (1, chr);
return scm_c_make_char (scm_c_titlecase (SCM_CHAR(chr))); return scm_i_make_char (scm_c_titlecase (SCM_CHAR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -43,7 +43,7 @@ typedef scm_t_int32 scm_t_wchar;
This macro evaluates X twice, which may lead to side effects if used This macro evaluates X twice, which may lead to side effects if used
incorrectly. It's also likely to be inefficient if X calls a incorrectly. It's also likely to be inefficient if X calls a
procedure. Use 'scm_c_make_char' in those cases. */ procedure. Use 'scm_i_make_char' in those cases. */
#define SCM_MAKE_CHAR(x) \ #define SCM_MAKE_CHAR(x) \
((x) <= 1 \ ((x) <= 1 \
? SCM_MAKE_ITAG8 ((scm_t_bits) (unsigned char) (x), scm_tc8_char) \ ? SCM_MAKE_ITAG8 ((scm_t_bits) (unsigned char) (x), scm_tc8_char) \
@ -85,7 +85,7 @@ SCM_API SCM scm_char_downcase (SCM chr);
SCM_API SCM scm_char_titlecase (SCM chr); SCM_API SCM scm_char_titlecase (SCM chr);
SCM_API SCM scm_char_general_category (SCM chr); SCM_API SCM scm_char_general_category (SCM chr);
SCM_INLINE SCM scm_c_make_char (scm_t_wchar c); SCM_INLINE SCM scm_i_make_char (scm_t_wchar c);
SCM_API scm_t_wchar scm_c_upcase (scm_t_wchar c); SCM_API scm_t_wchar scm_c_upcase (scm_t_wchar c);
SCM_API scm_t_wchar scm_c_downcase (scm_t_wchar c); SCM_API scm_t_wchar scm_c_downcase (scm_t_wchar c);
SCM_API scm_t_wchar scm_c_titlecase (scm_t_wchar c); SCM_API scm_t_wchar scm_c_titlecase (scm_t_wchar c);
@ -97,7 +97,7 @@ SCM_INTERNAL void scm_init_chars (void);
#if SCM_CAN_INLINE || defined SCM_INLINE_C_IMPLEMENTING_INLINES #if SCM_CAN_INLINE || defined SCM_INLINE_C_IMPLEMENTING_INLINES
SCM_INLINE_IMPLEMENTATION SCM SCM_INLINE_IMPLEMENTATION SCM
scm_c_make_char (scm_t_wchar c) scm_i_make_char (scm_t_wchar c)
{ {
return SCM_MAKE_CHAR(c); return SCM_MAKE_CHAR(c);
} }

View file

@ -1914,7 +1914,7 @@ SCM_DEFINE (scm_port_decode_char, "port-decode-char", 4, 0, 0,
output. */ output. */
return SCM_BOOL_F; return SCM_BOOL_F;
return scm_c_make_char (utf8_to_codepoint (utf8_buf, output_size)); return scm_i_make_char (utf8_to_codepoint (utf8_buf, output_size));
} }
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -1160,14 +1160,14 @@ SCM_DEFINE (scm_simple_format, "simple-format", 2, 0, 1,
continue; continue;
default: default:
SCM_MISC_ERROR ("FORMAT: Unsupported format option ~~~A - use (ice-9 format) instead", SCM_MISC_ERROR ("FORMAT: Unsupported format option ~~~A - use (ice-9 format) instead",
scm_list_1 (scm_c_make_char (scm_i_string_ref (message, p)))); scm_list_1 (scm_i_make_char (scm_i_string_ref (message, p))));
} }
if (!scm_is_pair (args)) if (!scm_is_pair (args))
SCM_MISC_ERROR ("FORMAT: Missing argument for ~~~A", SCM_MISC_ERROR ("FORMAT: Missing argument for ~~~A",
scm_list_1 (scm_c_make_char (scm_i_string_ref (message, p)))); scm_list_1 (scm_i_make_char (scm_i_string_ref (message, p))));
scm_lfwrite_substr (message, start, p - 1, port); scm_lfwrite_substr (message, start, p - 1, port);
/* we pass destination here */ /* we pass destination here */

View file

@ -1092,7 +1092,7 @@ scm_read_character (scm_t_wchar chr, SCM port, scm_t_read_opts *opts)
/* Ignore dotted circles, which may be used to keep combining characters from /* Ignore dotted circles, which may be used to keep combining characters from
combining with the backslash in #\charname. */ combining with the backslash in #\charname. */
if (cp == SCM_CODEPOINT_DOTTED_CIRCLE && charname_len == 2) if (cp == SCM_CODEPOINT_DOTTED_CIRCLE && charname_len == 2)
return scm_c_make_char (scm_i_string_ref (charname, 1)); return scm_i_make_char (scm_i_string_ref (charname, 1));
if (cp >= '0' && cp < '8') if (cp >= '0' && cp < '8')
{ {

View file

@ -53,7 +53,7 @@
} while (0) } while (0)
#define REF_IN_CHARSET(s, i, cs) \ #define REF_IN_CHARSET(s, i, cs) \
(scm_is_true (scm_char_set_contains_p ((cs), scm_c_make_char (scm_i_string_ref (s, i))))) (scm_is_true (scm_char_set_contains_p ((cs), scm_i_make_char (scm_i_string_ref (s, i)))))
SCM_DEFINE (scm_string_null_p, "string-null?", 1, 0, 0, SCM_DEFINE (scm_string_null_p, "string-null?", 1, 0, 0,
(SCM str), (SCM str),
@ -133,7 +133,7 @@ SCM_DEFINE (scm_string_any, "string-any-c-code", 2, 2, 0,
while (cstart < cend) while (cstart < cend)
{ {
res = scm_call_1 (char_pred, res = scm_call_1 (char_pred,
scm_c_make_char (scm_i_string_ref (s, cstart))); scm_i_make_char (scm_i_string_ref (s, cstart)));
if (scm_is_true (res)) if (scm_is_true (res))
break; break;
cstart++; cstart++;
@ -200,7 +200,7 @@ SCM_DEFINE (scm_string_every, "string-every-c-code", 2, 2, 0,
while (cstart < cend) while (cstart < cend)
{ {
res = scm_call_1 (char_pred, res = scm_call_1 (char_pred,
scm_c_make_char (scm_i_string_ref (s, cstart))); scm_i_make_char (scm_i_string_ref (s, cstart)));
if (scm_is_false (res)) if (scm_is_false (res))
break; break;
cstart++; cstart++;
@ -758,7 +758,7 @@ SCM_DEFINE (scm_string_trim, "string-trim", 1, 3, 0,
{ {
SCM res; SCM res;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cstart))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cstart)));
if (scm_is_false (res)) if (scm_is_false (res))
break; break;
cstart++; cstart++;
@ -834,7 +834,7 @@ SCM_DEFINE (scm_string_trim_right, "string-trim-right", 1, 3, 0,
{ {
SCM res; SCM res;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cend - 1))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cend - 1)));
if (scm_is_false (res)) if (scm_is_false (res))
break; break;
cend--; cend--;
@ -928,7 +928,7 @@ SCM_DEFINE (scm_string_trim_both, "string-trim-both", 1, 3, 0,
{ {
SCM res; SCM res;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cstart))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cstart)));
if (scm_is_false (res)) if (scm_is_false (res))
break; break;
cstart++; cstart++;
@ -937,7 +937,7 @@ SCM_DEFINE (scm_string_trim_both, "string-trim-both", 1, 3, 0,
{ {
SCM res; SCM res;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cend - 1))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cend - 1)));
if (scm_is_false (res)) if (scm_is_false (res))
break; break;
cend--; cend--;
@ -1698,7 +1698,7 @@ SCM_DEFINE (scm_string_index, "string-index", 2, 2, 0,
while (cstart < cend) while (cstart < cend)
{ {
SCM res; SCM res;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cstart))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cstart)));
if (scm_is_true (res)) if (scm_is_true (res))
goto found; goto found;
cstart++; cstart++;
@ -1764,7 +1764,7 @@ SCM_DEFINE (scm_string_index_right, "string-index-right", 2, 2, 0,
{ {
SCM res; SCM res;
cend--; cend--;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cend))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cend)));
if (scm_is_true (res)) if (scm_is_true (res))
goto found; goto found;
} }
@ -1850,7 +1850,7 @@ SCM_DEFINE (scm_string_skip, "string-skip", 2, 2, 0,
while (cstart < cend) while (cstart < cend)
{ {
SCM res; SCM res;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cstart))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cstart)));
if (scm_is_false (res)) if (scm_is_false (res))
goto found; goto found;
cstart++; cstart++;
@ -1917,7 +1917,7 @@ SCM_DEFINE (scm_string_skip_right, "string-skip-right", 2, 2, 0,
{ {
SCM res; SCM res;
cend--; cend--;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cend))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cend)));
if (scm_is_false (res)) if (scm_is_false (res))
goto found; goto found;
} }
@ -1983,7 +1983,7 @@ SCM_DEFINE (scm_string_count, "string-count", 2, 2, 0,
while (cstart < cend) while (cstart < cend)
{ {
SCM res; SCM res;
res = scm_call_1 (char_pred, scm_c_make_char (scm_i_string_ref (s, cstart))); res = scm_call_1 (char_pred, scm_i_make_char (scm_i_string_ref (s, cstart)));
if (scm_is_true (res)) if (scm_is_true (res))
count++; count++;
cstart++; cstart++;
@ -2240,7 +2240,7 @@ string_titlecase_x (SCM str, size_t start, size_t end)
str = scm_i_string_start_writing (str); str = scm_i_string_start_writing (str);
for(i = start; i < end; i++) for(i = start; i < end; i++)
{ {
ch = scm_c_make_char (scm_i_string_ref (str, i)); ch = scm_i_make_char (scm_i_string_ref (str, i));
if (scm_is_true (scm_char_alphabetic_p (ch))) if (scm_is_true (scm_char_alphabetic_p (ch)))
{ {
if (!in_word) if (!in_word)
@ -2338,7 +2338,7 @@ string_reverse_x (SCM str, size_t cstart, size_t cend)
cend--; cend--;
while (cstart < cend) while (cstart < cend)
{ {
tmp = scm_c_make_char (scm_i_string_ref (str, cstart)); tmp = scm_i_make_char (scm_i_string_ref (str, cstart));
scm_i_string_set_x (str, cstart, scm_i_string_ref (str, cend)); scm_i_string_set_x (str, cstart, scm_i_string_ref (str, cend));
scm_i_string_set_x (str, cend, SCM_CHAR (tmp)); scm_i_string_set_x (str, cend, SCM_CHAR (tmp));
cstart++; cstart++;
@ -2575,7 +2575,7 @@ SCM_DEFINE (scm_string_fold, "string-fold", 3, 2, 0,
result = knil; result = knil;
while (cstart < cend) while (cstart < cend)
{ {
result = scm_call_2 (kons, scm_c_make_char (scm_i_string_ref (s, cstart)), result); result = scm_call_2 (kons, scm_i_make_char (scm_i_string_ref (s, cstart)), result);
cstart++; cstart++;
} }
@ -2603,7 +2603,7 @@ SCM_DEFINE (scm_string_fold_right, "string-fold-right", 3, 2, 0,
result = knil; result = knil;
while (cstart < cend) while (cstart < cend)
{ {
result = scm_call_2 (kons, scm_c_make_char (scm_i_string_ref (s, cend-1)), result); result = scm_call_2 (kons, scm_i_make_char (scm_i_string_ref (s, cend-1)), result);
cend--; cend--;
} }
@ -2760,7 +2760,7 @@ SCM_DEFINE (scm_string_for_each, "string-for-each", 2, 2, 0,
4, end, cend); 4, end, cend);
while (cstart < cend) while (cstart < cend)
{ {
scm_call_1 (proc, scm_c_make_char (scm_i_string_ref (s, cstart))); scm_call_1 (proc, scm_i_make_char (scm_i_string_ref (s, cstart)));
cstart++; cstart++;
} }
@ -3217,7 +3217,7 @@ SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0,
while (idx < cend) while (idx < cend)
{ {
SCM res, ch; SCM res, ch;
ch = scm_c_make_char (scm_i_string_ref (s, idx)); ch = scm_i_make_char (scm_i_string_ref (s, idx));
res = scm_call_1 (char_pred, ch); res = scm_call_1 (char_pred, ch);
if (scm_is_true (res)) if (scm_is_true (res))
ls = scm_cons (ch, ls); ls = scm_cons (ch, ls);
@ -3368,7 +3368,7 @@ SCM_DEFINE (scm_string_delete, "string-delete", 2, 2, 0,
idx = cstart; idx = cstart;
while (idx < cend) while (idx < cend)
{ {
SCM res, ch = scm_c_make_char (scm_i_string_ref (s, idx)); SCM res, ch = scm_i_make_char (scm_i_string_ref (s, idx));
res = scm_call_1 (char_pred, ch); res = scm_call_1 (char_pred, ch);
if (scm_is_false (res)) if (scm_is_false (res))
ls = scm_cons (ch, ls); ls = scm_cons (ch, ls);

View file

@ -1227,9 +1227,9 @@ SCM_DEFINE (scm_string_ref, "string-ref", 2, 0, 0,
scm_out_of_range (NULL, k); scm_out_of_range (NULL, k);
if (scm_i_is_narrow_string (str)) if (scm_i_is_narrow_string (str))
return scm_c_make_char (scm_i_string_chars (str)[idx]); return scm_i_make_char (scm_i_string_chars (str)[idx]);
else else
return scm_c_make_char (scm_i_string_wide_chars (str)[idx]); return scm_i_make_char (scm_i_string_wide_chars (str)[idx]);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1239,9 +1239,9 @@ scm_c_string_ref (SCM str, size_t p)
if (p >= scm_i_string_length (str)) if (p >= scm_i_string_length (str))
scm_out_of_range (NULL, scm_from_size_t (p)); scm_out_of_range (NULL, scm_from_size_t (p));
if (scm_i_is_narrow_string (str)) if (scm_i_is_narrow_string (str))
return scm_c_make_char (scm_i_string_chars (str)[p]); return scm_i_make_char (scm_i_string_chars (str)[p]);
else else
return scm_c_make_char (scm_i_string_wide_chars (str)[p]); return scm_i_make_char (scm_i_string_wide_chars (str)[p]);
} }

View file

@ -2269,7 +2269,7 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
VM_VALIDATE_STRING (str, "string-ref"); VM_VALIDATE_STRING (str, "string-ref");
VM_VALIDATE_INDEX (c_idx, scm_i_string_length (str), "string-ref"); VM_VALIDATE_INDEX (c_idx, scm_i_string_length (str), "string-ref");
RETURN (scm_c_make_char (scm_i_string_ref (str, c_idx))); RETURN (scm_i_make_char (scm_i_string_ref (str, c_idx)));
} }
/* string-set! instruction is currently number 192. Probably need to /* string-set! instruction is currently number 192. Probably need to