aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2010-06-03 21:02:32 +0200
committerJuanma Barranquero2010-06-03 21:02:32 +0200
commitaa3830c49727fa443a11eaab9dedb404349c95e1 (patch)
tree3d33a06047a7f692aca841dd279a41890c8824df /src
parentd234d13e4bc3748665e8592fb13c6ee29671f709 (diff)
downloademacs-aa3830c49727fa443a11eaab9dedb404349c95e1.tar.gz
emacs-aa3830c49727fa443a11eaab9dedb404349c95e1.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/character.h17
-rw-r--r--src/composite.c6
-rw-r--r--src/data.c16
-rw-r--r--src/fns.c2
-rw-r--r--src/regex.c4
6 files changed, 24 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 49fb791c6dd..bb430266367 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12010-06-03 Juanma Barranquero <lekktu@gmail.com>
2
3 Remove obsolete pre-unicode2 macros.
4 * character.h (MULTIBYTE_FORM_LENGTH, PARSE_MULTIBYTE_SEQ): Remove.
5 * composite.c (composition_reseat_it):
6 * data.c (Faset):
7 * fns.c (Ffillarray):
8 * regex.c (re_search_2): Use BYTES_BY_CHAR_HEAD.
9 [!emacs] (BYTES_BY_CHAR_HEAD): Define instead of MULTIBYTE_FORM_LENGTH.
10
12010-06-03 Juri Linkov <juri@jurta.org> 112010-06-03 Juri Linkov <juri@jurta.org>
2 12
3 * buffer.c (Fother_buffer): Add CHECK_FRAME. 13 * 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 <http://www.gnu.org/licenses/>. */
235 : 5) 235 : 5)
236 236
237 237
238/* Return the length of the multi-byte form at string STR of length
239 LEN while assuming that STR points a valid multi-byte form. As
240 this macro isn't necessary anymore, all callers will be changed to
241 use BYTES_BY_CHAR_HEAD directly in the future. */
242
243#define MULTIBYTE_FORM_LENGTH(str, len) \
244 BYTES_BY_CHAR_HEAD (*(str))
245
246/* Parse multibyte string STR of length LENGTH and set BYTES to the
247 byte length of a character at STR while assuming that STR points a
248 valid multibyte form. As this macro isn't necessary anymore, all
249 callers will be changed to use BYTES_BY_CHAR_HEAD directly in the
250 future. */
251
252#define PARSE_MULTIBYTE_SEQ(str, length, bytes) \
253 (bytes) = BYTES_BY_CHAR_HEAD (*(str))
254
255/* The byte length of multibyte form at unibyte string P ending at 238/* The byte length of multibyte form at unibyte string P ending at
256 PEND. If STR doesn't point to a valid multibyte form, return 0. */ 239 PEND. If STR doesn't point to a valid multibyte form, return 0. */
257 240
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)
1266 { 1266 {
1267 if (endpos < 0) 1267 if (endpos < 0)
1268 endpos = BEGV; 1268 endpos = BEGV;
1269 if (endpos < PT && PT < charpos) 1269 if (endpos < PT && PT < charpos)
1270 endpos = PT; 1270 endpos = PT;
1271 } 1271 }
1272 else if (endpos < 0) 1272 else if (endpos < 0)
@@ -1317,7 +1317,7 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
1317 || ! INTEGERP (AREF (elt, 1))) 1317 || ! INTEGERP (AREF (elt, 1)))
1318 continue; 1318 continue;
1319 if (XFASTINT (AREF (elt, 1)) != cmp_it->lookback) 1319 if (XFASTINT (AREF (elt, 1)) != cmp_it->lookback)
1320 goto no_composition; 1320 goto no_composition;
1321 lgstring = autocmp_chars (elt, charpos, bytepos, endpos, 1321 lgstring = autocmp_chars (elt, charpos, bytepos, endpos,
1322 w, face, string); 1322 w, face, string);
1323 if (composition_gstring_p (lgstring)) 1323 if (composition_gstring_p (lgstring))
@@ -1389,7 +1389,7 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
1389 if (NILP (string)) 1389 if (NILP (string))
1390 INC_POS (bytepos); 1390 INC_POS (bytepos);
1391 else 1391 else
1392 bytepos += MULTIBYTE_FORM_LENGTH (SDATA (string) + bytepos, 0); 1392 bytepos += BYTES_BY_CHAR_HEAD (*(SDATA (string) + bytepos));
1393 } 1393 }
1394 else 1394 else
1395 { 1395 {
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)
959 CHECK_NUMBER (newval); 959 CHECK_NUMBER (newval);
960 *XINTFWD (valcontents)->intvar = XINT (newval); 960 *XINTFWD (valcontents)->intvar = XINT (newval);
961 break; 961 break;
962 962
963 case Lisp_Fwd_Bool: 963 case Lisp_Fwd_Bool:
964 *XBOOLFWD (valcontents)->boolvar = !NILP (newval); 964 *XBOOLFWD (valcontents)->boolvar = !NILP (newval);
965 break; 965 break;
966 966
967 case Lisp_Fwd_Obj: 967 case Lisp_Fwd_Obj:
968 *XOBJFWD (valcontents)->objvar = newval; 968 *XOBJFWD (valcontents)->objvar = newval;
969 969
970 /* If this variable is a default for something stored 970 /* If this variable is a default for something stored
971 in the buffer itself, such as default-fill-column, 971 in the buffer itself, such as default-fill-column,
972 find the buffers that don't have local values for it 972 find the buffers that don't have local values for it
@@ -977,12 +977,12 @@ store_symval_forwarding (/* symbol, */ valcontents, newval, buf)
977 int offset = ((char *) XOBJFWD (valcontents)->objvar 977 int offset = ((char *) XOBJFWD (valcontents)->objvar
978 - (char *) &buffer_defaults); 978 - (char *) &buffer_defaults);
979 int idx = PER_BUFFER_IDX (offset); 979 int idx = PER_BUFFER_IDX (offset);
980 980
981 Lisp_Object tail; 981 Lisp_Object tail;
982 982
983 if (idx <= 0) 983 if (idx <= 0)
984 break; 984 break;
985 985
986 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) 986 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
987 { 987 {
988 Lisp_Object buf; 988 Lisp_Object buf;
@@ -1943,7 +1943,7 @@ BUFFER defaults to the current buffer. */)
1943 Lisp_Object tail, elt, tmp; 1943 Lisp_Object tail, elt, tmp;
1944 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); 1944 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
1945 XSETBUFFER (tmp, buf); 1945 XSETBUFFER (tmp, buf);
1946 1946
1947 for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) 1947 for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
1948 { 1948 {
1949 elt = XCAR (tail); 1949 elt = XCAR (tail);
@@ -2274,7 +2274,7 @@ bool-vector. IDX starts at 0. */)
2274 2274
2275 idxval_byte = string_char_to_byte (array, idxval); 2275 idxval_byte = string_char_to_byte (array, idxval);
2276 p1 = SDATA (array) + idxval_byte; 2276 p1 = SDATA (array) + idxval_byte;
2277 PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes); 2277 prev_bytes = BYTES_BY_CHAR_HEAD (*p1);
2278 new_bytes = CHAR_STRING (XINT (newelt), p0); 2278 new_bytes = CHAR_STRING (XINT (newelt), p0);
2279 if (prev_bytes != new_bytes) 2279 if (prev_bytes != new_bytes)
2280 { 2280 {
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. */)
2280 if (size != size_byte) 2280 if (size != size_byte)
2281 while (p1 < endp) 2281 while (p1 < endp)
2282 { 2282 {
2283 int this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1); 2283 int this_len = BYTES_BY_CHAR_HEAD (*p1);
2284 if (len != this_len) 2284 if (len != this_len)
2285 error ("Attempt to change byte length of a string"); 2285 error ("Attempt to change byte length of a string");
2286 p1 += this_len; 2286 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 };
300# define CHAR_HEAD_P(p) (1) 300# define CHAR_HEAD_P(p) (1)
301# define SINGLE_BYTE_CHAR_P(c) (1) 301# define SINGLE_BYTE_CHAR_P(c) (1)
302# define SAME_CHARSET_P(c1, c2) (1) 302# define SAME_CHARSET_P(c1, c2) (1)
303# define MULTIBYTE_FORM_LENGTH(p, s) (1) 303# define BYTES_BY_CHAR_HEAD(p) (1)
304# define PREV_CHAR_BOUNDARY(p, limit) ((p)--) 304# define PREV_CHAR_BOUNDARY(p, limit) ((p)--)
305# define STRING_CHAR(p) (*(p)) 305# define STRING_CHAR(p) (*(p))
306# define RE_STRING_CHAR(p, multibyte) STRING_CHAR (p) 306# 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)
4643 { 4643 {
4644 re_char *p = POS_ADDR_VSTRING (startpos); 4644 re_char *p = POS_ADDR_VSTRING (startpos);
4645 re_char *pend = STOP_ADDR_VSTRING (startpos); 4645 re_char *pend = STOP_ADDR_VSTRING (startpos);
4646 int len = MULTIBYTE_FORM_LENGTH (p, pend - p); 4646 int len = BYTES_BY_CHAR_HEAD (*p);
4647 4647
4648 range -= len; 4648 range -= len;
4649 if (range < 0) 4649 if (range < 0)