Commit a08d4ba7 authored by Paul Eggert's avatar Paul Eggert
Browse files

* doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.

* doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
(Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
(Fsubstitute_command_keys):
* editfns.c (region_limit, find_field, Fconstrain_to_field)
(save_excursion_save, save_excursion_restore)
(disassemble_lisp_time, decode_time_components, emacs_nmemftime)
(format_time_string, general_insert_function)
(make_buffer_string, make_buffer_string_both)
(Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
* insdel.c (check_markers, gap_left, adjust_markers_for_insert)
(copy_text, insert_1, insert_1_both, insert_from_string)
(insert_from_string_before_markers, insert_from_string_1)
(insert_from_buffer, insert_from_buffer_1, replace_range)
(replace_range_2, del_range_1, del_range_byte, del_range_both)
(del_range_2, modify_region):
* intervals.c (intervals_equal, balance_possible_root_interval)
(adjust_intervals_for_insertion, merge_properties_sticky)
(graft_intervals_into_buffer, lookup_char_property)
(adjust_for_invis_intang, set_point_both)
(get_property_and_range, compare_string_intervals)
(set_intervals_multibyte_1, set_intervals_multibyte):
* keyboard.c (decode_timer):
Use bool for boolean.
* intervals.h, lisp.h, systime.h: Reflect above API changes.
* editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
parent 6a787d9a
2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
* doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
* doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
(Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
(Fsubstitute_command_keys):
* editfns.c (region_limit, find_field, Fconstrain_to_field)
(save_excursion_save, save_excursion_restore)
(disassemble_lisp_time, decode_time_components, emacs_nmemftime)
(format_time_string, general_insert_function)
(make_buffer_string, make_buffer_string_both)
(Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
* insdel.c (check_markers, gap_left, adjust_markers_for_insert)
(copy_text, insert_1, insert_1_both, insert_from_string)
(insert_from_string_before_markers, insert_from_string_1)
(insert_from_buffer, insert_from_buffer_1, replace_range)
(replace_range_2, del_range_1, del_range_byte, del_range_both)
(del_range_2, modify_region):
* intervals.c (intervals_equal, balance_possible_root_interval)
(adjust_intervals_for_insertion, merge_properties_sticky)
(graft_intervals_into_buffer, lookup_char_property)
(adjust_for_invis_intang, set_point_both)
(get_property_and_range, compare_string_intervals)
(set_intervals_multibyte_1, set_intervals_multibyte):
* keyboard.c (decode_timer):
Use bool for boolean.
* intervals.h, lisp.h, systime.h: Reflect above API changes.
* editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2012-09-02 Chong Yidong <cyd@gnu.org> 2012-09-02 Chong Yidong <cyd@gnu.org>
* keymap.c (push_key_description): Print M-TAB as C-M-i * keymap.c (push_key_description): Print M-TAB as C-M-i
......
...@@ -48,7 +48,7 @@ static unsigned char *read_bytecode_pointer; ...@@ -48,7 +48,7 @@ static unsigned char *read_bytecode_pointer;
If UNREADFLAG is 1, we unread a byte. */ If UNREADFLAG is 1, we unread a byte. */
int int
read_bytecode_char (int unreadflag) read_bytecode_char (bool unreadflag)
{ {
if (unreadflag) if (unreadflag)
{ {
...@@ -70,20 +70,18 @@ read_bytecode_char (int unreadflag) ...@@ -70,20 +70,18 @@ read_bytecode_char (int unreadflag)
(e.g. because the file has been modified and the location is stale), (e.g. because the file has been modified and the location is stale),
return nil. return nil.
If UNIBYTE is nonzero, always make a unibyte string. If UNIBYTE, always make a unibyte string.
If DEFINITION is nonzero, assume this is for reading If DEFINITION, assume this is for reading
a dynamic function definition; convert the bytestring a dynamic function definition; convert the bytestring
and the constants vector with appropriate byte handling, and the constants vector with appropriate byte handling,
and return a cons cell. */ and return a cons cell. */
Lisp_Object Lisp_Object
get_doc_string (Lisp_Object filepos, int unibyte, int definition) get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
{ {
char *from, *to; char *from, *to, *name, *p, *p1;
register int fd; int fd;
register char *name;
register char *p, *p1;
ptrdiff_t minsize; ptrdiff_t minsize;
int offset; int offset;
EMACS_INT position; EMACS_INT position;
...@@ -302,7 +300,7 @@ read_doc_string (Lisp_Object filepos) ...@@ -302,7 +300,7 @@ read_doc_string (Lisp_Object filepos)
return get_doc_string (filepos, 0, 1); return get_doc_string (filepos, 0, 1);
} }
static int static bool
reread_doc_file (Lisp_Object file) reread_doc_file (Lisp_Object file)
{ {
#if 0 #if 0
...@@ -335,7 +333,7 @@ string is passed through `substitute-command-keys'. */) ...@@ -335,7 +333,7 @@ string is passed through `substitute-command-keys'. */)
Lisp_Object fun; Lisp_Object fun;
Lisp_Object funcar; Lisp_Object funcar;
Lisp_Object doc; Lisp_Object doc;
int try_reload = 1; bool try_reload = 1;
documentation: documentation:
...@@ -467,7 +465,7 @@ This differs from `get' in that it can refer to strings stored in the ...@@ -467,7 +465,7 @@ This differs from `get' in that it can refer to strings stored in the
aren't strings. */) aren't strings. */)
(Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw) (Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw)
{ {
int try_reload = 1; bool try_reload = 1;
Lisp_Object tem; Lisp_Object tem;
documentation_property: documentation_property:
...@@ -562,12 +560,11 @@ the same file name is found in the `doc-directory'. */) ...@@ -562,12 +560,11 @@ the same file name is found in the `doc-directory'. */)
{ {
int fd; int fd;
char buf[1024 + 1]; char buf[1024 + 1];
register int filled; int filled;
register EMACS_INT pos; EMACS_INT pos;
register char *p;
Lisp_Object sym; Lisp_Object sym;
char *name; char *p, *name;
int skip_file = 0; bool skip_file = 0;
CHECK_STRING (filename); CHECK_STRING (filename);
...@@ -722,9 +719,9 @@ Otherwise, return a new string, without any text properties. */) ...@@ -722,9 +719,9 @@ Otherwise, return a new string, without any text properties. */)
(Lisp_Object string) (Lisp_Object string)
{ {
char *buf; char *buf;
int changed = 0; bool changed = 0;
register unsigned char *strp; unsigned char *strp;
register char *bufp; char *bufp;
ptrdiff_t idx; ptrdiff_t idx;
ptrdiff_t bsize; ptrdiff_t bsize;
Lisp_Object tem; Lisp_Object tem;
...@@ -733,7 +730,7 @@ Otherwise, return a new string, without any text properties. */) ...@@ -733,7 +730,7 @@ Otherwise, return a new string, without any text properties. */)
ptrdiff_t length, length_byte; ptrdiff_t length, length_byte;
Lisp_Object name; Lisp_Object name;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int multibyte; bool multibyte;
ptrdiff_t nchars; ptrdiff_t nchars;
if (NILP (string)) if (NILP (string))
...@@ -787,7 +784,7 @@ Otherwise, return a new string, without any text properties. */) ...@@ -787,7 +784,7 @@ Otherwise, return a new string, without any text properties. */)
else if (strp[0] == '\\' && strp[1] == '[') else if (strp[0] == '\\' && strp[1] == '[')
{ {
ptrdiff_t start_idx; ptrdiff_t start_idx;
int follow_remap = 1; bool follow_remap = 1;
changed = 1; changed = 1;
strp += 2; /* skip \[ */ strp += 2; /* skip \[ */
......
...@@ -65,7 +65,7 @@ extern Lisp_Object w32_get_internal_run_time (void); ...@@ -65,7 +65,7 @@ extern Lisp_Object w32_get_internal_run_time (void);
#endif #endif
static Lisp_Object format_time_string (char const *, ptrdiff_t, EMACS_TIME, static Lisp_Object format_time_string (char const *, ptrdiff_t, EMACS_TIME,
int, struct tm *); bool, struct tm *);
static int tm_diff (struct tm *, struct tm *); static int tm_diff (struct tm *, struct tm *);
static void update_buffer_properties (ptrdiff_t, ptrdiff_t); static void update_buffer_properties (ptrdiff_t, ptrdiff_t);
...@@ -246,11 +246,11 @@ The return value is POSITION. */) ...@@ -246,11 +246,11 @@ The return value is POSITION. */)
/* Return the start or end position of the region. /* Return the start or end position of the region.
BEGINNINGP non-zero means return the start. BEGINNINGP means return the start.
If there is no region active, signal an error. */ If there is no region active, signal an error. */
static Lisp_Object static Lisp_Object
region_limit (int beginningp) region_limit (bool beginningp)
{ {
Lisp_Object m; Lisp_Object m;
...@@ -264,7 +264,7 @@ region_limit (int beginningp) ...@@ -264,7 +264,7 @@ region_limit (int beginningp)
error ("The mark is not set now, so there is no region"); error ("The mark is not set now, so there is no region");
/* Clip to the current narrowing (bug#11770). */ /* Clip to the current narrowing (bug#11770). */
return make_number ((PT < XFASTINT (m)) == (beginningp != 0) return make_number ((PT < XFASTINT (m)) == beginningp
? PT ? PT
: clip_to_bounds (BEGV, XFASTINT (m), ZV)); : clip_to_bounds (BEGV, XFASTINT (m), ZV));
} }
...@@ -435,12 +435,12 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o ...@@ -435,12 +435,12 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o
BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned
results; they do not effect boundary behavior. results; they do not effect boundary behavior.
If MERGE_AT_BOUNDARY is nonzero, then if POS is at the very first If MERGE_AT_BOUNDARY is non-nil, then if POS is at the very first
position of a field, then the beginning of the previous field is position of a field, then the beginning of the previous field is
returned instead of the beginning of POS's field (since the end of a returned instead of the beginning of POS's field (since the end of a
field is actually also the beginning of the next input field, this field is actually also the beginning of the next input field, this
behavior is sometimes useful). Additionally in the MERGE_AT_BOUNDARY behavior is sometimes useful). Additionally in the MERGE_AT_BOUNDARY
true case, if two fields are separated by a field with the special non-nil case, if two fields are separated by a field with the special
value `boundary', and POS lies within it, then the two separated value `boundary', and POS lies within it, then the two separated
fields are considered to be adjacent, and POS between them, when fields are considered to be adjacent, and POS between them, when
finding the beginning and ending of the "merged" field. finding the beginning and ending of the "merged" field.
...@@ -455,10 +455,10 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, ...@@ -455,10 +455,10 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
{ {
/* Fields right before and after the point. */ /* Fields right before and after the point. */
Lisp_Object before_field, after_field; Lisp_Object before_field, after_field;
/* 1 if POS counts as the start of a field. */ /* True if POS counts as the start of a field. */
int at_field_start = 0; bool at_field_start = 0;
/* 1 if POS counts as the end of a field. */ /* True if POS counts as the end of a field. */
int at_field_end = 0; bool at_field_end = 0;
if (NILP (pos)) if (NILP (pos))
XSETFASTINT (pos, PT); XSETFASTINT (pos, PT);
...@@ -502,19 +502,19 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, ...@@ -502,19 +502,19 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
xxxx.yyyy xxxx.yyyy
In this situation, if merge_at_boundary is true, we consider the In this situation, if merge_at_boundary is non-nil, consider the
`x' and `y' fields as forming one big merged field, and so the end `x' and `y' fields as forming one big merged field, and so the end
of the field is the end of `y'. of the field is the end of `y'.
However, if `x' and `y' are separated by a special `boundary' field However, if `x' and `y' are separated by a special `boundary' field
(a field with a `field' char-property of 'boundary), then we ignore (a field with a `field' char-property of 'boundary), then ignore
this special field when merging adjacent fields. Here's the same this special field when merging adjacent fields. Here's the same
situation, but with a `boundary' field between the `x' and `y' fields: situation, but with a `boundary' field between the `x' and `y' fields:
xxx.BBBByyyy xxx.BBBByyyy
Here, if point is at the end of `x', the beginning of `y', or Here, if point is at the end of `x', the beginning of `y', or
anywhere in-between (within the `boundary' field), we merge all anywhere in-between (within the `boundary' field), merge all
three fields and consider the beginning as being the beginning of three fields and consider the beginning as being the beginning of
the `x' field, and the end as being the end of the `y' field. */ the `x' field, and the end as being the end of the `y' field. */
...@@ -658,7 +658,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) ...@@ -658,7 +658,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
{ {
/* If non-zero, then the original point, before re-positioning. */ /* If non-zero, then the original point, before re-positioning. */
ptrdiff_t orig_point = 0; ptrdiff_t orig_point = 0;
int fwd; bool fwd;
Lisp_Object prev_old, prev_new; Lisp_Object prev_old, prev_new;
if (NILP (new_pos)) if (NILP (new_pos))
...@@ -816,8 +816,8 @@ This function does not move point. */) ...@@ -816,8 +816,8 @@ This function does not move point. */)
Lisp_Object Lisp_Object
save_excursion_save (void) save_excursion_save (void)
{ {
int visible = (XBUFFER (XWINDOW (selected_window)->buffer) bool visible = (XBUFFER (XWINDOW (selected_window)->buffer)
== current_buffer); == current_buffer);
return Fcons (Fpoint_marker (), return Fcons (Fpoint_marker (),
Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil), Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil),
...@@ -831,7 +831,7 @@ save_excursion_restore (Lisp_Object info) ...@@ -831,7 +831,7 @@ save_excursion_restore (Lisp_Object info)
{ {
Lisp_Object tem, tem1, omark, nmark; Lisp_Object tem, tem1, omark, nmark;
struct gcpro gcpro1, gcpro2, gcpro3; struct gcpro gcpro1, gcpro2, gcpro3;
int visible_p; bool visible_p;
tem = Fmarker_buffer (XCAR (info)); tem = Fmarker_buffer (XCAR (info));
/* If buffer being returned to is now deleted, avoid error */ /* If buffer being returned to is now deleted, avoid error */
...@@ -1467,8 +1467,8 @@ make_lisp_time (EMACS_TIME t) ...@@ -1467,8 +1467,8 @@ make_lisp_time (EMACS_TIME t)
/* Decode a Lisp list SPECIFIED_TIME that represents a time. /* Decode a Lisp list SPECIFIED_TIME that represents a time.
Set *PHIGH, *PLOW, *PUSEC, *PPSEC to its parts; do not check their values. Set *PHIGH, *PLOW, *PUSEC, *PPSEC to its parts; do not check their values.
Return nonzero if successful. */ Return true if successful. */
static int static bool
disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh, disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh,
Lisp_Object *plow, Lisp_Object *pusec, Lisp_Object *plow, Lisp_Object *pusec,
Lisp_Object *ppsec) Lisp_Object *ppsec)
...@@ -1511,8 +1511,8 @@ disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh, ...@@ -1511,8 +1511,8 @@ disassemble_lisp_time (Lisp_Object specified_time, Lisp_Object *phigh,
If *DRESULT is not null, store into *DRESULT the number of If *DRESULT is not null, store into *DRESULT the number of
seconds since the start of the POSIX Epoch. seconds since the start of the POSIX Epoch.
Return nonzero if successful. */ Return true if successful. */
int bool
decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec, decode_time_components (Lisp_Object high, Lisp_Object low, Lisp_Object usec,
Lisp_Object psec, Lisp_Object psec,
EMACS_TIME *result, double *dresult) EMACS_TIME *result, double *dresult)
...@@ -1632,7 +1632,7 @@ or (if you need time as a string) `format-time-string'. */) ...@@ -1632,7 +1632,7 @@ or (if you need time as a string) `format-time-string'. */)
/* Write information into buffer S of size MAXSIZE, according to the /* Write information into buffer S of size MAXSIZE, according to the
FORMAT of length FORMAT_LEN, using time information taken from *TP. FORMAT of length FORMAT_LEN, using time information taken from *TP.
Default to Universal Time if UT is nonzero, local time otherwise. Default to Universal Time if UT, local time otherwise.
Use NS as the number of nanoseconds in the %N directive. Use NS as the number of nanoseconds in the %N directive.
Return the number of bytes written, not including the terminating Return the number of bytes written, not including the terminating
'\0'. If S is NULL, nothing will be written anywhere; so to '\0'. If S is NULL, nothing will be written anywhere; so to
...@@ -1643,7 +1643,7 @@ or (if you need time as a string) `format-time-string'. */) ...@@ -1643,7 +1643,7 @@ or (if you need time as a string) `format-time-string'. */)
bytes in FORMAT and it does not support nanoseconds. */ bytes in FORMAT and it does not support nanoseconds. */
static size_t static size_t
emacs_nmemftime (char *s, size_t maxsize, const char *format, emacs_nmemftime (char *s, size_t maxsize, const char *format,
size_t format_len, const struct tm *tp, int ut, int ns) size_t format_len, const struct tm *tp, bool ut, int ns)
{ {
size_t total = 0; size_t total = 0;
...@@ -1748,7 +1748,7 @@ usage: (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) */) ...@@ -1748,7 +1748,7 @@ usage: (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) */)
static Lisp_Object static Lisp_Object
format_time_string (char const *format, ptrdiff_t formatlen, format_time_string (char const *format, ptrdiff_t formatlen,
EMACS_TIME t, int ut, struct tm *tmp) EMACS_TIME t, bool ut, struct tm *tmp)
{ {
char buffer[4000]; char buffer[4000];
char *buf = buffer; char *buf = buffer;
...@@ -2228,11 +2228,11 @@ general_insert_function (void (*insert_func) ...@@ -2228,11 +2228,11 @@ general_insert_function (void (*insert_func)
(const char *, ptrdiff_t), (const char *, ptrdiff_t),
void (*insert_from_string_func) void (*insert_from_string_func)
(Lisp_Object, ptrdiff_t, ptrdiff_t, (Lisp_Object, ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, int), ptrdiff_t, ptrdiff_t, bool),
int inherit, ptrdiff_t nargs, Lisp_Object *args) bool inherit, ptrdiff_t nargs, Lisp_Object *args)
{ {
ptrdiff_t argnum; ptrdiff_t argnum;
register Lisp_Object val; Lisp_Object val;
for (argnum = 0; argnum < nargs; argnum++) for (argnum = 0; argnum < nargs; argnum++)
{ {
...@@ -2455,7 +2455,7 @@ from adjoining text, if those properties are sticky. */) ...@@ -2455,7 +2455,7 @@ from adjoining text, if those properties are sticky. */)
/* Return a Lisp_String containing the text of the current buffer from /* Return a Lisp_String containing the text of the current buffer from
START to END. If text properties are in use and the current buffer START to END. If text properties are in use and the current buffer
has properties in the range specified, the resulting string will also has properties in the range specified, the resulting string will also
have them, if PROPS is nonzero. have them, if PROPS is true.
We don't want to use plain old make_string here, because it calls We don't want to use plain old make_string here, because it calls
make_uninit_string, which can cause the buffer arena to be make_uninit_string, which can cause the buffer arena to be
...@@ -2466,7 +2466,7 @@ from adjoining text, if those properties are sticky. */) ...@@ -2466,7 +2466,7 @@ from adjoining text, if those properties are sticky. */)
buffer substrings. */ buffer substrings. */
Lisp_Object Lisp_Object
make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props) make_buffer_string (ptrdiff_t start, ptrdiff_t end, bool props)
{ {
ptrdiff_t start_byte = CHAR_TO_BYTE (start); ptrdiff_t start_byte = CHAR_TO_BYTE (start);
ptrdiff_t end_byte = CHAR_TO_BYTE (end); ptrdiff_t end_byte = CHAR_TO_BYTE (end);
...@@ -2479,7 +2479,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props) ...@@ -2479,7 +2479,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props)
If text properties are in use and the current buffer If text properties are in use and the current buffer
has properties in the range specified, the resulting string will also has properties in the range specified, the resulting string will also
have them, if PROPS is nonzero. have them, if PROPS is true.
We don't want to use plain old make_string here, because it calls We don't want to use plain old make_string here, because it calls
make_uninit_string, which can cause the buffer arena to be make_uninit_string, which can cause the buffer arena to be
...@@ -2491,7 +2491,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props) ...@@ -2491,7 +2491,7 @@ make_buffer_string (ptrdiff_t start, ptrdiff_t end, int props)
Lisp_Object Lisp_Object
make_buffer_string_both (ptrdiff_t start, ptrdiff_t start_byte, make_buffer_string_both (ptrdiff_t start, ptrdiff_t start_byte,
ptrdiff_t end, ptrdiff_t end_byte, int props) ptrdiff_t end, ptrdiff_t end_byte, bool props)
{ {
Lisp_Object result, tem, tem1; Lisp_Object result, tem, tem1;
...@@ -2842,7 +2842,8 @@ Both characters must have the same length of multi-byte form. */) ...@@ -2842,7 +2842,8 @@ Both characters must have the same length of multi-byte form. */)
#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) #define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER)
int maybe_byte_combining = COMBINING_NO; int maybe_byte_combining = COMBINING_NO;
ptrdiff_t last_changed = 0; ptrdiff_t last_changed = 0;
int multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters)); bool multibyte_p
= !NILP (BVAR (current_buffer, enable_multibyte_characters));
int fromc, toc; int fromc, toc;
restart: restart:
...@@ -3078,8 +3079,8 @@ It returns the number of characters changed. */) ...@@ -3078,8 +3079,8 @@ It returns the number of characters changed. */)
int cnt; /* Number of changes made. */ int cnt; /* Number of changes made. */
ptrdiff_t size; /* Size of translate table. */ ptrdiff_t size; /* Size of translate table. */
ptrdiff_t pos, pos_byte, end_pos; ptrdiff_t pos, pos_byte, end_pos;
int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
int string_multibyte IF_LINT (= 0); bool string_multibyte IF_LINT (= 0);
validate_region (&start, &end); validate_region (&start, &end);
if (CHAR_TABLE_P (table)) if (CHAR_TABLE_P (table))
...@@ -3650,9 +3651,9 @@ usage: (format STRING &rest OBJECTS) */) ...@@ -3650,9 +3651,9 @@ usage: (format STRING &rest OBJECTS) */)
byte combining problem, i.e., a byte may be combined with a byte combining problem, i.e., a byte may be combined with a
multibyte character of the previous string. This flag tells if we multibyte character of the previous string. This flag tells if we
must consider such a situation or not. */ must consider such a situation or not. */
int maybe_combine_byte; bool maybe_combine_byte;
Lisp_Object val; Lisp_Object val;
int arg_intervals = 0; bool arg_intervals = 0;
USE_SAFE_ALLOCA; USE_SAFE_ALLOCA;
/* discarded[I] is 1 if byte I of the format /* discarded[I] is 1 if byte I of the format
...@@ -3668,8 +3669,8 @@ usage: (format STRING &rest OBJECTS) */) ...@@ -3668,8 +3669,8 @@ usage: (format STRING &rest OBJECTS) */)
struct info struct info
{ {
ptrdiff_t start, end; ptrdiff_t start, end;
int converted_to_string; unsigned converted_to_string : 1;
int intervals; unsigned intervals : 1;
} *info = 0; } *info = 0;
/* It should not be necessary to GCPRO ARGS, because /* It should not be necessary to GCPRO ARGS, because
...@@ -3746,13 +3747,13 @@ usage: (format STRING &rest OBJECTS) */) ...@@ -3746,13 +3747,13 @@ usage: (format STRING &rest OBJECTS) */)
digits to print after the '.' for floats, or the max. digits to print after the '.' for floats, or the max.
number of chars to print from a string. */ number of chars to print from a string. */
int minus_flag = 0; bool minus_flag = 0;
int plus_flag = 0; bool plus_flag = 0;
int space_flag = 0; bool space_flag = 0;
int sharp_flag = 0; bool sharp_flag = 0;
int zero_flag = 0; bool zero_flag = 0;
ptrdiff_t field_width; ptrdiff_t field_width;
int precision_given; bool precision_given;
uintmax_t precision = UINTMAX_MAX; uintmax_t precision = UINTMAX_MAX;
char *num_end; char *num_end;
char conversion; char conversion;
...@@ -4132,7 +4133,7 @@ usage: (format STRING &rest OBJECTS) */) ...@@ -4132,7 +4133,7 @@ usage: (format STRING &rest OBJECTS) */)
char *src = sprintf_buf; char *src = sprintf_buf;
char src0 = src[0]; char src0 = src[0];
int exponent_bytes = 0; int exponent_bytes = 0;
int signedp = src0 == '-' || src0 == '+' || src0 == ' '; bool signedp = src0 == '-' || src0 == '+' || src0 == ' ';
int significand_bytes; int significand_bytes;
if (zero_flag if (zero_flag
&& ((src[signedp] >= '0' && src[signedp] <= '9') && ((src[signedp] >= '0' && src[signedp] <= '9')
......
...@@ -31,19 +31,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -31,19 +31,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "blockinput.h" #include "blockinput.h"
#include "region-cache.h" #include "region-cache.h"
static void insert_from_string_1 (Lisp_Object string, static void insert_from_string_1 (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t,
ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t, bool, bool);
ptrdiff_t nchars, ptrdiff_t nbytes, static void insert_from_buffer_1 (struct buffer *, ptrdiff_t, ptrdiff_t, bool);
int inherit, int before_markers); static void gap_left (ptrdiff_t, ptrdiff_t, bool);
static void insert_from_buffer_1 (struct buffer *buf, static void gap_right (ptrdiff_t, ptrdiff_t);
ptrdiff_t from, ptrdiff_t nchars,
int inherit);
static void gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, int newgap);
static void gap_right (ptrdiff_t charpos, ptrdiff_t bytepos);
/* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) /* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT)
describing changes which happened while combine_after_change_calls describing changes which happened while combine_after_change_calls
was nonzero. We use this to decide how to call them was non-nil. We use this to decide how to call them
once the deferral ends. once the deferral ends.
In each element. In each element.
...@@ -67,8 +63,8 @@ static void signal_before_change (ptrdiff_t, ptrdiff_t, ptrdiff_t *); ...@@ -67,8 +63,8 @@ static void signal_before_change (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
static void static void
check_markers (void) check_markers (void)
{ {
register struct Lisp_Marker *tail; struct Lisp_Marker *tail;
int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
{ {
...@@ -113,13 +109,13 @@ move_gap_both (ptrdiff_t charpos, ptrdiff_t bytepos) ...@@ -113,13 +109,13 @@ move_gap_both (ptrdiff_t charpos, ptrdiff_t bytepos)
/* Move the gap to a position less than the current GPT. /* Move the gap to a position less than the current GPT.
BYTEPOS describes the new position as a byte position, BYTEPOS describes the new position as a byte position,
and CHARPOS is the corresponding char position. and CHARPOS is the corresponding char position.
If NEWGAP is nonzero, then don't update beg_unchanged and end_unchanged. */ If NEWGAP, then don't update beg_unchanged and end_unchanged. */
static void static void
gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, int newgap) gap_left (ptrdiff_t charpos, ptrdiff_t bytepos, bool newgap)
{ {
register unsigned char *to, *from;