aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-15 07:48:35 +0000
committerRichard M. Stallman1994-07-15 07:48:35 +0000
commit5330e99c716e17b584dd5f09c3ed1cd6807393a1 (patch)
tree5a683fa633e7a0d3517465ca59509e4ad454e6be /src
parent47c5e807f2ce02d0c29a56a3c28e8605d64b6eec (diff)
downloademacs-5330e99c716e17b584dd5f09c3ed1cd6807393a1.tar.gz
emacs-5330e99c716e17b584dd5f09c3ed1cd6807393a1.zip
(re_match_2_internal): Add casts to shut up some compilers.
(FREE_STACK_RETURN): Nest the free inside the return.
Diffstat (limited to 'src')
-rw-r--r--src/regex.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/regex.c b/src/regex.c
index 0cfd4969982..88ccc69a208 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1493,12 +1493,7 @@ typedef struct
1493 1493
1494/* Return, freeing storage we allocated. */ 1494/* Return, freeing storage we allocated. */
1495#define FREE_STACK_RETURN(value) \ 1495#define FREE_STACK_RETURN(value) \
1496do \ 1496 return (free (compile_stack.stack), value)
1497{ \
1498 free (compile_stack.stack); \
1499 return value; \
1500} \
1501while (1)
1502 1497
1503static reg_errcode_t 1498static reg_errcode_t
1504regex_compile (pattern, size, syntax, bufp) 1499regex_compile (pattern, size, syntax, bufp)
@@ -4298,7 +4293,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
4298#endif 4293#endif
4299 4294
4300 if ((re_opcode_t) p1[3] == exactn 4295 if ((re_opcode_t) p1[3] == exactn
4301 && ! (p2[1] * BYTEWIDTH > p1[4] 4296 && ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
4302 && (p2[1 + p1[4] / BYTEWIDTH] 4297 && (p2[1 + p1[4] / BYTEWIDTH]
4303 & (1 << (p1[4] % BYTEWIDTH))))) 4298 & (1 << (p1[4] % BYTEWIDTH)))))
4304 { 4299 {
@@ -4312,9 +4307,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
4312 int idx; 4307 int idx;
4313 /* We win if the charset_not inside the loop 4308 /* We win if the charset_not inside the loop
4314 lists every character listed in the charset after. */ 4309 lists every character listed in the charset after. */
4315 for (idx = 0; idx < p2[1]; idx++) 4310 for (idx = 0; idx < (int) p2[1]; idx++)
4316 if (! (p2[2 + idx] == 0 4311 if (! (p2[2 + idx] == 0
4317 || (idx < p1[4] 4312 || (idx < (int) p1[4]
4318 && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) 4313 && ((p2[2 + idx] & ~ p1[5 + idx]) == 0))))
4319 break; 4314 break;
4320 4315
@@ -4329,7 +4324,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
4329 int idx; 4324 int idx;
4330 /* We win if the charset inside the loop 4325 /* We win if the charset inside the loop
4331 has no overlap with the one after the loop. */ 4326 has no overlap with the one after the loop. */
4332 for (idx = 0; idx < p2[1] && idx < p1[4]; idx++) 4327 for (idx = 0;
4328 idx < (int) p2[1] && idx < (int) p1[4];
4329 idx++)
4333 if ((p2[2 + idx] & p1[5 + idx]) != 0) 4330 if ((p2[2 + idx] & p1[5 + idx]) != 0)
4334 break; 4331 break;
4335 4332