* 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 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.
: 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. */
{
if (endpos < 0)
endpos = BEGV;
- if (endpos < PT && PT < charpos)
+ if (endpos < PT && PT < charpos)
endpos = PT;
}
else if (endpos < 0)
|| ! 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))
if (NILP (string))
INC_POS (bytepos);
else
- bytepos += MULTIBYTE_FORM_LENGTH (SDATA (string) + bytepos, 0);
+ bytepos += BYTES_BY_CHAR_HEAD (*(SDATA (string) + bytepos));
}
else
{
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
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;
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);
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)
{
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;
# 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)
{
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)