diff options
| author | Stefan Monnier | 2001-11-02 16:06:54 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-11-02 16:06:54 +0000 |
| commit | ada30c0eaba7812610aa4c3f504aef127ba8f4f5 (patch) | |
| tree | 1599b663d6fc1140e682af2616075ce10b98d9b5 /src | |
| parent | e6bff1824f24555fe98036afab85d642b6d91a8e (diff) | |
| download | emacs-ada30c0eaba7812610aa4c3f504aef127ba8f4f5.tar.gz emacs-ada30c0eaba7812610aa4c3f504aef127ba8f4f5.zip | |
(re_wctype): Try to fix some warnings.
(regcomp, regexec): Don't forget the __restrict.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/regex.c b/src/regex.c index 38fc80437fd..37436fffba0 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -1327,7 +1327,8 @@ static const char *re_error_msgid[] = | |||
| 1327 | /* Roughly the maximum number of failure points on the stack. Would be | 1327 | /* Roughly the maximum number of failure points on the stack. Would be |
| 1328 | exactly that if always used TYPICAL_FAILURE_SIZE items each time we failed. | 1328 | exactly that if always used TYPICAL_FAILURE_SIZE items each time we failed. |
| 1329 | This is a variable only so users of regex can assign to it; we never | 1329 | This is a variable only so users of regex can assign to it; we never |
| 1330 | change it ourselves. */ | 1330 | change it ourselves. We always multiply it by TYPICAL_FAILURE_SIZE |
| 1331 | before using it, so it should probably be a byte-count instead. */ | ||
| 1331 | # if defined MATCH_MAY_ALLOCATE | 1332 | # if defined MATCH_MAY_ALLOCATE |
| 1332 | /* Note that 4400 was enough to cause a crash on Alpha OSF/1, | 1333 | /* Note that 4400 was enough to cause a crash on Alpha OSF/1, |
| 1333 | whose default stack limit is 2mb. In order for a larger | 1334 | whose default stack limit is 2mb. In order for a larger |
| @@ -1579,7 +1580,7 @@ do { \ | |||
| 1579 | /* Estimate the size of data pushed by a typical failure stack entry. | 1580 | /* Estimate the size of data pushed by a typical failure stack entry. |
| 1580 | An estimate is all we need, because all we use this for | 1581 | An estimate is all we need, because all we use this for |
| 1581 | is to choose a limit for how big to make the failure stack. */ | 1582 | is to choose a limit for how big to make the failure stack. */ |
| 1582 | 1583 | /* BEWARE, the value `20' is hard-coded in emacs.c:main(). */ | |
| 1583 | #define TYPICAL_FAILURE_SIZE 20 | 1584 | #define TYPICAL_FAILURE_SIZE 20 |
| 1584 | 1585 | ||
| 1585 | /* How many items can still be added to the stack without overflowing it. */ | 1586 | /* How many items can still be added to the stack without overflowing it. */ |
| @@ -1966,9 +1967,10 @@ typedef int re_wchar_t; | |||
| 1966 | 1967 | ||
| 1967 | /* Map a string to the char class it names (if any). */ | 1968 | /* Map a string to the char class it names (if any). */ |
| 1968 | static re_wctype_t | 1969 | static re_wctype_t |
| 1969 | re_wctype (string) | 1970 | re_wctype (str) |
| 1970 | re_char *string; | 1971 | re_char *str; |
| 1971 | { | 1972 | { |
| 1973 | const char *string = str; | ||
| 1972 | if (STREQ (string, "alnum")) return RECC_ALNUM; | 1974 | if (STREQ (string, "alnum")) return RECC_ALNUM; |
| 1973 | else if (STREQ (string, "alpha")) return RECC_ALPHA; | 1975 | else if (STREQ (string, "alpha")) return RECC_ALPHA; |
| 1974 | else if (STREQ (string, "word")) return RECC_WORD; | 1976 | else if (STREQ (string, "word")) return RECC_WORD; |
| @@ -5837,8 +5839,8 @@ re_exec (s) | |||
| 5837 | 5839 | ||
| 5838 | int | 5840 | int |
| 5839 | regcomp (preg, pattern, cflags) | 5841 | regcomp (preg, pattern, cflags) |
| 5840 | regex_t *preg; | 5842 | regex_t *__restrict preg; |
| 5841 | const char *pattern; | 5843 | const char *__restrict pattern; |
| 5842 | int cflags; | 5844 | int cflags; |
| 5843 | { | 5845 | { |
| 5844 | reg_errcode_t ret; | 5846 | reg_errcode_t ret; |
| @@ -5922,8 +5924,8 @@ WEAK_ALIAS (__regcomp, regcomp) | |||
| 5922 | 5924 | ||
| 5923 | int | 5925 | int |
| 5924 | regexec (preg, string, nmatch, pmatch, eflags) | 5926 | regexec (preg, string, nmatch, pmatch, eflags) |
| 5925 | const regex_t *preg; | 5927 | const regex_t *__restrict preg; |
| 5926 | const char *string; | 5928 | const char *__restrict string; |
| 5927 | size_t nmatch; | 5929 | size_t nmatch; |
| 5928 | regmatch_t pmatch[]; | 5930 | regmatch_t pmatch[]; |
| 5929 | int eflags; | 5931 | int eflags; |