Mercurial > emacs
changeset 108881:5582106cddf0
Remove obsolete pre-unicode2 macros.
* character.h (MULTIBYTE_FORM_LENGTH, PARSE_MULTIBYTE_SEQ): Remove.
* composite.c (composition_reseat_it):
* data.c (Faset):
* fns.c (Ffillarray):
* regex.c (re_search_2): Use BYTES_BY_CHAR_HEAD.
[!emacs] (BYTES_BY_CHAR_HEAD): Define instead of MULTIBYTE_FORM_LENGTH.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 03 Jun 2010 21:02:32 +0200 |
parents | f4a583b69ffa |
children | 3ff97bad1c47 |
files | src/ChangeLog src/character.h src/composite.c src/data.c src/fns.c src/regex.c |
diffstat | 6 files changed, 24 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Thu Jun 03 21:50:00 2010 +0300 +++ b/src/ChangeLog Thu Jun 03 21:02:32 2010 +0200 @@ -1,3 +1,13 @@ +2010-06-03 Juanma Barranquero <lekktu@gmail.com> + + Remove obsolete pre-unicode2 macros. + * character.h (MULTIBYTE_FORM_LENGTH, PARSE_MULTIBYTE_SEQ): Remove. + * composite.c (composition_reseat_it): + * data.c (Faset): + * fns.c (Ffillarray): + * regex.c (re_search_2): Use BYTES_BY_CHAR_HEAD. + [!emacs] (BYTES_BY_CHAR_HEAD): Define instead of MULTIBYTE_FORM_LENGTH. + 2010-06-03 Juri Linkov <juri@jurta.org> * buffer.c (Fother_buffer): Add CHECK_FRAME.
--- a/src/character.h Thu Jun 03 21:50:00 2010 +0300 +++ b/src/character.h Thu Jun 03 21:02:32 2010 +0200 @@ -235,23 +235,6 @@ : 5) -/* Return the length of the multi-byte form at string STR of length - LEN while assuming that STR points a valid multi-byte form. As - this macro isn't necessary anymore, all callers will be changed to - use BYTES_BY_CHAR_HEAD directly in the future. */ - -#define MULTIBYTE_FORM_LENGTH(str, len) \ - BYTES_BY_CHAR_HEAD (*(str)) - -/* Parse multibyte string STR of length LENGTH and set BYTES to the - byte length of a character at STR while assuming that STR points a - valid multibyte form. As this macro isn't necessary anymore, all - callers will be changed to use BYTES_BY_CHAR_HEAD directly in the - future. */ - -#define PARSE_MULTIBYTE_SEQ(str, length, bytes) \ - (bytes) = BYTES_BY_CHAR_HEAD (*(str)) - /* The byte length of multibyte form at unibyte string P ending at PEND. If STR doesn't point to a valid multibyte form, return 0. */
--- a/src/composite.c Thu Jun 03 21:50:00 2010 +0300 +++ b/src/composite.c Thu Jun 03 21:02:32 2010 +0200 @@ -1266,7 +1266,7 @@ { if (endpos < 0) endpos = BEGV; - if (endpos < PT && PT < charpos) + if (endpos < PT && PT < charpos) endpos = PT; } else if (endpos < 0) @@ -1317,7 +1317,7 @@ || ! INTEGERP (AREF (elt, 1))) continue; if (XFASTINT (AREF (elt, 1)) != cmp_it->lookback) - goto no_composition; + goto no_composition; lgstring = autocmp_chars (elt, charpos, bytepos, endpos, w, face, string); if (composition_gstring_p (lgstring)) @@ -1389,7 +1389,7 @@ if (NILP (string)) INC_POS (bytepos); else - bytepos += MULTIBYTE_FORM_LENGTH (SDATA (string) + bytepos, 0); + bytepos += BYTES_BY_CHAR_HEAD (*(SDATA (string) + bytepos)); } else {
--- a/src/data.c Thu Jun 03 21:50:00 2010 +0300 +++ b/src/data.c Thu Jun 03 21:02:32 2010 +0200 @@ -959,14 +959,14 @@ CHECK_NUMBER (newval); *XINTFWD (valcontents)->intvar = XINT (newval); break; - + case Lisp_Fwd_Bool: *XBOOLFWD (valcontents)->boolvar = !NILP (newval); break; - + case Lisp_Fwd_Obj: *XOBJFWD (valcontents)->objvar = newval; - + /* If this variable is a default for something stored in the buffer itself, such as default-fill-column, find the buffers that don't have local values for it @@ -977,12 +977,12 @@ int offset = ((char *) XOBJFWD (valcontents)->objvar - (char *) &buffer_defaults); int idx = PER_BUFFER_IDX (offset); - + Lisp_Object tail; - + if (idx <= 0) break; - + for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { Lisp_Object buf; @@ -1943,7 +1943,7 @@ Lisp_Object tail, elt, tmp; struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); XSETBUFFER (tmp, buf); - + for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) { elt = XCAR (tail); @@ -2274,7 +2274,7 @@ idxval_byte = string_char_to_byte (array, idxval); p1 = SDATA (array) + idxval_byte; - PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes); + prev_bytes = BYTES_BY_CHAR_HEAD (*p1); new_bytes = CHAR_STRING (XINT (newelt), p0); if (prev_bytes != new_bytes) {
--- a/src/fns.c Thu Jun 03 21:50:00 2010 +0300 +++ b/src/fns.c Thu Jun 03 21:02:32 2010 +0200 @@ -2280,7 +2280,7 @@ if (size != size_byte) while (p1 < endp) { - int this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1); + int this_len = BYTES_BY_CHAR_HEAD (*p1); if (len != this_len) error ("Attempt to change byte length of a string"); p1 += this_len;
--- a/src/regex.c Thu Jun 03 21:50:00 2010 +0300 +++ b/src/regex.c Thu Jun 03 21:02:32 2010 +0200 @@ -300,7 +300,7 @@ # define CHAR_HEAD_P(p) (1) # define SINGLE_BYTE_CHAR_P(c) (1) # define SAME_CHARSET_P(c1, c2) (1) -# define MULTIBYTE_FORM_LENGTH(p, s) (1) +# define BYTES_BY_CHAR_HEAD(p) (1) # define PREV_CHAR_BOUNDARY(p, limit) ((p)--) # define STRING_CHAR(p) (*(p)) # define RE_STRING_CHAR(p, multibyte) STRING_CHAR (p) @@ -4643,7 +4643,7 @@ { re_char *p = POS_ADDR_VSTRING (startpos); re_char *pend = STOP_ADDR_VSTRING (startpos); - int len = MULTIBYTE_FORM_LENGTH (p, pend - p); + int len = BYTES_BY_CHAR_HEAD (*p); range -= len; if (range < 0)