Commit f10fe38f authored by Paul Eggert's avatar Paul Eggert

* cmds.c, coding.c: Use bool for booleans.

* cmds.c (move_point, Fself_insert_command):
* coding.h (struct composition status, struct coding_system):
* coding.c (detect_coding_utf_8, encode_coding_utf_8)
(detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
(emacs_mule_char, decode_coding_emacs_mule)
(encode_coding_emacs_mule, detect_coding_iso_2022)
(decode_coding_iso_2022, encode_invocation_designation)
(encode_designation_at_bol, encode_coding_iso_2022)
(detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
(decode_coding_big5, encode_coding_sjis, encode_coding_big5)
(detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
(encode_coding_raw_text, detect_coding_charset)
(decode_coding_charset, encode_coding_charset, detect_eol)
(detect_coding, get_translation_table, produce_chars)
(consume_chars, reused_workbuf_in_use)
(make_conversion_work_buffer, code_conversion_save)
(decode_coding_object, encode_coding_object)
(detect_coding_system, char_encodable_p)
(Funencodable_char_position, code_convert_region)
(code_convert_string, code_convert_string_norecord)
(Fset_coding_system_priority):
* fileio.c (Finsert_file_contents):
Use bool for booleans.
* coding.h, lisp.h: Reflect above API changes.
* coding.c: Remove unnecessary static function decls.
(detect_coding): Use unsigned, not signed, to copy an unsigned field.
(decode_coding, encode_coding, decode_coding_gap): Return 'void',
not a boolean 'int', since callers never look at the return value.
(ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
* coding.h (decoding_buffer_size, encoding_buffer_size)
(emacs_mule_string_char): Remove unused extern decls.
(struct iso_2022_spec, struct coding_system):
Use 'unsigned int : 1' for boolean fields, since there's more than one.
(struct emacs_mule_spec): Remove unused field 'full_support'.
All initializations removed.
* cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
parent 5474c384
2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
* cmds.c, coding.c: Use bool for booleans.
* cmds.c (move_point, Fself_insert_command):
* coding.h (struct composition status, struct coding_system):
* coding.c (detect_coding_utf_8, encode_coding_utf_8)
(detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
(emacs_mule_char, decode_coding_emacs_mule)
(encode_coding_emacs_mule, detect_coding_iso_2022)
(decode_coding_iso_2022, encode_invocation_designation)
(encode_designation_at_bol, encode_coding_iso_2022)
(detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
(decode_coding_big5, encode_coding_sjis, encode_coding_big5)
(detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
(encode_coding_raw_text, detect_coding_charset)
(decode_coding_charset, encode_coding_charset, detect_eol)
(detect_coding, get_translation_table, produce_chars)
(consume_chars, reused_workbuf_in_use)
(make_conversion_work_buffer, code_conversion_save)
(decode_coding_object, encode_coding_object)
(detect_coding_system, char_encodable_p)
(Funencodable_char_position, code_convert_region)
(code_convert_string, code_convert_string_norecord)
(Fset_coding_system_priority):
* fileio.c (Finsert_file_contents):
Use bool for booleans.
* coding.h, lisp.h: Reflect above API changes.
* coding.c: Remove unnecessary static function decls.
(detect_coding): Use unsigned, not signed, to copy an unsigned field.
(decode_coding, encode_coding, decode_coding_gap): Return 'void',
not a boolean 'int', since callers never look at the return value.
(ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
* coding.h (decoding_buffer_size, encoding_buffer_size)
(emacs_mule_string_char): Remove unused extern decls.
(struct iso_2022_spec, struct coding_system):
Use 'unsigned int : 1' for boolean fields, since there's more than one.
(struct emacs_mule_spec): Remove unused field 'full_support'.
All initializations removed.
* cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
Fix spare memory change.
Fix spare memory change (Bug#12286).
* alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
(valid_lisp_object_p): Likewise.
......
......@@ -496,7 +496,7 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
/* 1 if CHARSET may contain the character C. */
/* True if CHARSET may contain the character C. */
#define CHAR_CHARSET_P(c, charset) \
((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p) \
|| ((CHARSET_UNIFIED_P (charset) \
......
......@@ -47,10 +47,10 @@ DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
return make_number (PT + XINT (n));
}
/* Add N to point; or subtract N if FORWARD is zero. N defaults to 1.
/* Add N to point; or subtract N if FORWARD is false. N defaults to 1.
Validate the new location. Return nil. */
static Lisp_Object
move_point (Lisp_Object n, int forward)
move_point (Lisp_Object n, bool forward)
{
/* This used to just set point to point + XINT (n), and then check
to see if it was within boundaries. But now that SET_PT can
......@@ -277,7 +277,7 @@ After insertion, the value of `auto-fill-function' is called if the
At the end, it runs `post-self-insert-hook'. */)
(Lisp_Object n)
{
int remove_boundary = 1;
bool remove_boundary = 1;
CHECK_NATNUM (n);
if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
......@@ -438,7 +438,7 @@ internal_self_insert (int c, EMACS_INT n)
: UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
== Sword))
{
int modiff = MODIFF;
EMACS_INT modiff = MODIFF;
Lisp_Object sym;
sym = call0 (Qexpand_abbrev);
......
This diff is collapsed.
......@@ -321,7 +321,7 @@ struct composition_status
{
enum composition_state state;
enum composition_method method;
int old_form; /* 0:pre-21 form, 1:post-21 form */
bool old_form; /* true if pre-21 form */
int length; /* number of elements produced in charbuf */
int nchars; /* number of characters composed */
int ncomps; /* number of composition components */
......@@ -350,18 +350,18 @@ struct iso_2022_spec
there was an invalid designation previously. */
int current_designation[4];
/* Set to 1 temporarily only when graphic register 2 or 3 is invoked
by single-shift while encoding. */
int single_shifting;
/* Set to 1 temporarily only when processing at beginning of line. */
int bol;
/* If positive, we are now scanning CTEXT extended segment. */
int ctext_extended_segment_len;
/* If nonzero, we are now scanning embedded UTF-8 sequence. */
int embedded_utf_8;
/* True temporarily only when graphic register 2 or 3 is invoked by
single-shift while encoding. */
unsigned single_shifting : 1;
/* True temporarily only when processing at beginning of line. */
unsigned bol : 1;
/* If true, we are now scanning embedded UTF-8 sequence. */
unsigned embedded_utf_8 : 1;
/* The current composition. */
struct composition_status cmp_status;
......@@ -369,7 +369,6 @@ struct iso_2022_spec
struct emacs_mule_spec
{
int full_support;
struct composition_status cmp_status;
};
......@@ -470,10 +469,6 @@ struct coding_system
Lisp_Object dst_object;
unsigned char *destination;
/* Set to 1 if the source of conversion is not in the member
`charbuf', but at `src_object'. */
int chars_at_source;
/* If an element is non-negative, it is a character code.
If it is in the range -128..-1, it is a 8-bit character code
......@@ -489,18 +484,21 @@ struct coding_system
int *charbuf;
int charbuf_size, charbuf_used;
/* True if the source of conversion is not in the member
`charbuf', but at `src_object'. */
unsigned chars_at_source : 1;
/* Set to 1 if charbuf contains an annotation. */
int annotated;
unsigned annotated : 1;
unsigned char carryover[64];
int carryover_bytes;
int default_char;
int (*detector) (struct coding_system *,
struct coding_detection_info *);
bool (*detector) (struct coding_system *, struct coding_detection_info *);
void (*decoder) (struct coding_system *);
int (*encoder) (struct coding_system *);
bool (*encoder) (struct coding_system *);
};
/* Meanings of bits in the member `common_flags' of the structure
......@@ -688,22 +686,20 @@ struct coding_system
#define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1)
/* Extern declarations. */
extern Lisp_Object code_conversion_save (int, int);
extern int decoding_buffer_size (struct coding_system *, int);
extern int encoding_buffer_size (struct coding_system *, int);
extern Lisp_Object code_conversion_save (bool, bool);
extern void setup_coding_system (Lisp_Object, struct coding_system *);
extern Lisp_Object coding_charset_list (struct coding_system *);
extern Lisp_Object coding_system_charset_list (Lisp_Object);
extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object,
Lisp_Object, int, int, int);
Lisp_Object, bool, bool, bool);
extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
int);
bool);
extern Lisp_Object raw_text_coding_system (Lisp_Object);
extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object);
extern Lisp_Object complement_process_encoding_system (Lisp_Object);
extern int decode_coding_gap (struct coding_system *,
ptrdiff_t, ptrdiff_t);
extern void decode_coding_gap (struct coding_system *,
ptrdiff_t, ptrdiff_t);
extern void decode_coding_object (struct coding_system *,
Lisp_Object, ptrdiff_t, ptrdiff_t,
ptrdiff_t, ptrdiff_t, Lisp_Object);
......@@ -778,6 +774,5 @@ extern struct coding_system safe_terminal_coding;
extern Lisp_Object Qcoding_system_error;
extern char emacs_mule_bytes[256];
extern int emacs_mule_string_char (unsigned char *);
#endif /* EMACS_CODING_H */
......@@ -3760,7 +3760,8 @@ variable `last-coding-system-used' to the coding system actually used. */)
ptrdiff_t temp;
ptrdiff_t this = 0;
ptrdiff_t this_count = SPECPDL_INDEX ();
int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
bool multibyte
= ! NILP (BVAR (current_buffer, enable_multibyte_characters));
Lisp_Object conversion_buffer;
struct gcpro gcpro1;
......
......@@ -2632,7 +2632,7 @@ extern void keys_of_cmds (void);
/* Defined in coding.c */
extern Lisp_Object Qcharset;
extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t,
ptrdiff_t, int, int, Lisp_Object);
ptrdiff_t, bool, bool, Lisp_Object);
extern void init_coding (void);
extern void init_coding_once (void);
extern void syms_of_coding (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment