From: Juanma Barranquero Date: Thu, 3 Jun 2010 19:02:32 +0000 (+0200) Subject: Remove obsolete pre-unicode2 macros. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~129 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aa3830c49727fa443a11eaab9dedb404349c95e1;p=emacs.git 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 49fb791c6dd..bb430266367 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2010-06-03 Juanma Barranquero + + 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 * buffer.c (Fother_buffer): Add CHECK_FRAME. diff --git a/src/character.h b/src/character.h index 41f47e4b179..d5404a576ad 100644 --- a/src/character.h +++ b/src/character.h @@ -235,23 +235,6 @@ along with GNU Emacs. If not, see . */ : 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. */ diff --git a/src/composite.c b/src/composite.c index 8a549f4796d..cab57e824a9 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1266,7 +1266,7 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string) { 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 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string) || ! 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 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string) if (NILP (string)) INC_POS (bytepos); else - bytepos += MULTIBYTE_FORM_LENGTH (SDATA (string) + bytepos, 0); + bytepos += BYTES_BY_CHAR_HEAD (*(SDATA (string) + bytepos)); } else { diff --git a/src/data.c b/src/data.c index 2d71434cc76..93cc57e9f2c 100644 --- a/src/data.c +++ b/src/data.c @@ -959,14 +959,14 @@ store_symval_forwarding (/* symbol, */ valcontents, newval, buf) 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 @@ store_symval_forwarding (/* symbol, */ valcontents, newval, buf) 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 @@ BUFFER defaults to the current buffer. */) 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 @@ bool-vector. IDX starts at 0. */) 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) { diff --git a/src/fns.c b/src/fns.c index b4d132ea0c1..89033309c8c 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2280,7 +2280,7 @@ ARRAY is a vector, string, char-table, or bool-vector. */) 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; diff --git a/src/regex.c b/src/regex.c index e59c48aad74..5981d5b3de4 100644 --- a/src/regex.c +++ b/src/regex.c @@ -300,7 +300,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; # 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_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop) { 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)