Commit aa3830c4 authored by Juanma Barranquero's avatar 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.
parent d234d13e
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.
......
......@@ -235,23 +235,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
: 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. */
......
......@@ -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
{
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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)
......
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