aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab2013-08-28 15:50:55 +0200
committerAndreas Schwab2013-08-28 15:50:55 +0200
commit78779650d6a97c785a5ad7be1826648cfb76275c (patch)
treeb75dcf08771923addbf1f8df2beedce05f6b4a14 /src
parentc3c4768d2becd1f84c598e1463d089c224e83ea2 (diff)
downloademacs-78779650d6a97c785a5ad7be1826648cfb76275c.tar.gz
emacs-78779650d6a97c785a5ad7be1826648cfb76275c.zip
* regex.c (CHAR_CHARSET, CHARSET_LEADING_CODE_BASE, CHAR_HEAD_P)
(SINGLE_BYTE_CHAR_P, SAME_CHARSET_P, MAKE_CHAR, BYTE8_TO_CHAR): Remove unused macro definitions. (CHARSET_RANGE_TABLE_BITS, EXTEND_RANGE_TABLE) (SET_RANGE_TABLE_WORK_AREA_BIT, SET_RANGE_TABLE_WORK_AREA): Only define if emacs.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/regex.c31
2 files changed, 24 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 830de80faaa..e543c982ae1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12013-08-28 Andreas Schwab <schwab@suse.de>
2
3 * regex.c (CHAR_CHARSET, CHARSET_LEADING_CODE_BASE, CHAR_HEAD_P)
4 (SINGLE_BYTE_CHAR_P, SAME_CHARSET_P, MAKE_CHAR, BYTE8_TO_CHAR):
5 Remove unused macro definitions.
6 (CHARSET_RANGE_TABLE_BITS, EXTEND_RANGE_TABLE)
7 (SET_RANGE_TABLE_WORK_AREA_BIT, SET_RANGE_TABLE_WORK_AREA): Only
8 define if emacs.
9
12013-08-28 Dmitry Antipov <dmantipov@yandex.ru> 102013-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2 11
3 Prefer enum glyph_row_area to int where appropriate. 12 Prefer enum glyph_row_area to int where appropriate.
diff --git a/src/regex.c b/src/regex.c
index 2363fe2a290..1befececd22 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -257,15 +257,10 @@ xrealloc (void *block, size_t size)
257enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; 257enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
258 258
259/* Dummy macros for non-Emacs environments. */ 259/* Dummy macros for non-Emacs environments. */
260# define CHAR_CHARSET(c) 0
261# define CHARSET_LEADING_CODE_BASE(c) 0
262# define MAX_MULTIBYTE_LENGTH 1 260# define MAX_MULTIBYTE_LENGTH 1
263# define RE_MULTIBYTE_P(x) 0 261# define RE_MULTIBYTE_P(x) 0
264# define RE_TARGET_MULTIBYTE_P(x) 0 262# define RE_TARGET_MULTIBYTE_P(x) 0
265# define WORD_BOUNDARY_P(c1, c2) (0) 263# define WORD_BOUNDARY_P(c1, c2) (0)
266# define CHAR_HEAD_P(p) (1)
267# define SINGLE_BYTE_CHAR_P(c) (1)
268# define SAME_CHARSET_P(c1, c2) (1)
269# define BYTES_BY_CHAR_HEAD(p) (1) 264# define BYTES_BY_CHAR_HEAD(p) (1)
270# define PREV_CHAR_BOUNDARY(p, limit) ((p)--) 265# define PREV_CHAR_BOUNDARY(p, limit) ((p)--)
271# define STRING_CHAR(p) (*(p)) 266# define STRING_CHAR(p) (*(p))
@@ -279,8 +274,6 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
279 (c = ((p) == (str2) ? *((end1) - 1) : *((p) - 1))) 274 (c = ((p) == (str2) ? *((end1) - 1) : *((p) - 1)))
280# define GET_CHAR_AFTER(c, p, len) \ 275# define GET_CHAR_AFTER(c, p, len) \
281 (c = *p, len = 1) 276 (c = *p, len = 1)
282# define MAKE_CHAR(charset, c1, c2) (c1)
283# define BYTE8_TO_CHAR(c) (c)
284# define CHAR_BYTE8_P(c) (0) 277# define CHAR_BYTE8_P(c) (0)
285# define CHAR_LEADING_CODE(c) (c) 278# define CHAR_LEADING_CODE(c) (c)
286 279
@@ -775,10 +768,12 @@ extract_number_and_incr (re_char **source)
775 and the 2 bytes of flags at the start of the range table. */ 768 and the 2 bytes of flags at the start of the range table. */
776#define CHARSET_RANGE_TABLE(p) (&(p)[4 + CHARSET_BITMAP_SIZE (p)]) 769#define CHARSET_RANGE_TABLE(p) (&(p)[4 + CHARSET_BITMAP_SIZE (p)])
777 770
771#ifdef emacs
778/* Extract the bit flags that start a range table. */ 772/* Extract the bit flags that start a range table. */
779#define CHARSET_RANGE_TABLE_BITS(p) \ 773#define CHARSET_RANGE_TABLE_BITS(p) \
780 ((p)[2 + CHARSET_BITMAP_SIZE (p)] \ 774 ((p)[2 + CHARSET_BITMAP_SIZE (p)] \
781 + (p)[3 + CHARSET_BITMAP_SIZE (p)] * 0x100) 775 + (p)[3 + CHARSET_BITMAP_SIZE (p)] * 0x100)
776#endif
782 777
783/* Return the address of end of RANGE_TABLE. COUNT is number of 778/* Return the address of end of RANGE_TABLE. COUNT is number of
784 ranges (which is a pair of (start, end)) in the RANGE_TABLE. `* 2' 779 ranges (which is a pair of (start, end)) in the RANGE_TABLE. `* 2'
@@ -1830,6 +1825,8 @@ struct range_table_work_area
1830 int bits; /* flag to record character classes */ 1825 int bits; /* flag to record character classes */
1831}; 1826};
1832 1827
1828#ifdef emacs
1829
1833/* Make sure that WORK_AREA can hold more N multibyte characters. 1830/* Make sure that WORK_AREA can hold more N multibyte characters.
1834 This is used only in set_image_of_range and set_image_of_range_1. 1831 This is used only in set_image_of_range and set_image_of_range_1.
1835 It expects WORK_AREA to be a pointer. 1832 It expects WORK_AREA to be a pointer.
@@ -1848,15 +1845,6 @@ struct range_table_work_area
1848#define SET_RANGE_TABLE_WORK_AREA_BIT(work_area, bit) \ 1845#define SET_RANGE_TABLE_WORK_AREA_BIT(work_area, bit) \
1849 (work_area).bits |= (bit) 1846 (work_area).bits |= (bit)
1850 1847
1851/* Bits used to implement the multibyte-part of the various character classes
1852 such as [:alnum:] in a charset's range table. */
1853#define BIT_WORD 0x1
1854#define BIT_LOWER 0x2
1855#define BIT_PUNCT 0x4
1856#define BIT_SPACE 0x8
1857#define BIT_UPPER 0x10
1858#define BIT_MULTIBYTE 0x20
1859
1860/* Set a range (RANGE_START, RANGE_END) to WORK_AREA. */ 1848/* Set a range (RANGE_START, RANGE_END) to WORK_AREA. */
1861#define SET_RANGE_TABLE_WORK_AREA(work_area, range_start, range_end) \ 1849#define SET_RANGE_TABLE_WORK_AREA(work_area, range_start, range_end) \
1862 do { \ 1850 do { \
@@ -1865,6 +1853,8 @@ struct range_table_work_area
1865 (work_area).table[(work_area).used++] = (range_end); \ 1853 (work_area).table[(work_area).used++] = (range_end); \
1866 } while (0) 1854 } while (0)
1867 1855
1856#endif /* emacs */
1857
1868/* Free allocated memory for WORK_AREA. */ 1858/* Free allocated memory for WORK_AREA. */
1869#define FREE_RANGE_TABLE_WORK_AREA(work_area) \ 1859#define FREE_RANGE_TABLE_WORK_AREA(work_area) \
1870 do { \ 1860 do { \
@@ -1876,6 +1866,15 @@ struct range_table_work_area
1876#define RANGE_TABLE_WORK_USED(work_area) ((work_area).used) 1866#define RANGE_TABLE_WORK_USED(work_area) ((work_area).used)
1877#define RANGE_TABLE_WORK_BITS(work_area) ((work_area).bits) 1867#define RANGE_TABLE_WORK_BITS(work_area) ((work_area).bits)
1878#define RANGE_TABLE_WORK_ELT(work_area, i) ((work_area).table[i]) 1868#define RANGE_TABLE_WORK_ELT(work_area, i) ((work_area).table[i])
1869
1870/* Bits used to implement the multibyte-part of the various character classes
1871 such as [:alnum:] in a charset's range table. */
1872#define BIT_WORD 0x1
1873#define BIT_LOWER 0x2
1874#define BIT_PUNCT 0x4
1875#define BIT_SPACE 0x8
1876#define BIT_UPPER 0x10
1877#define BIT_MULTIBYTE 0x20
1879 1878
1880 1879
1881/* Set the bit for character C in a list. */ 1880/* Set the bit for character C in a list. */