aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-10-27 13:29:36 +0000
committerStefan Monnier2000-10-27 13:29:36 +0000
commit6dcf2d0e0c4a30805e7a45de465a565893f9a2be (patch)
tree9f127781225883eb85a3a6337493a8d944a4fe25
parent48b15d3f46cce9a5806e1c44c1634257112794fa (diff)
downloademacs-6dcf2d0e0c4a30805e7a45de465a565893f9a2be.tar.gz
emacs-6dcf2d0e0c4a30805e7a45de465a565893f9a2be.zip
(POP_FAILURE_REG_OR_COUNT, re_match_2_internal)
(re_match_2_internal, re_match_2_internal, re_match_2_internal): Giving in to popular pressure to shut up the compiler with casts.
-rw-r--r--src/regex.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/regex.c b/src/regex.c
index e10a3565f2f..f3e382915ca 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -23,7 +23,9 @@
23 - structure the opcode space into opcode+flag. 23 - structure the opcode space into opcode+flag.
24 - merge with glibc's regex.[ch]. 24 - merge with glibc's regex.[ch].
25 - replace (succeed_n + jump_n + set_number_at) with something that doesn't 25 - replace (succeed_n + jump_n + set_number_at) with something that doesn't
26 need to modify the compiled regexp. 26 need to modify the compiled regexp so that re_match can be reentrant.
27 - get rid of on_failure_jump_smart by doing the optimization in re_comp
28 rather than at run-time, so that re_match can be reentrant.
27*/ 29*/
28 30
29/* AIX requires this to be the first thing in the file. */ 31/* AIX requires this to be the first thing in the file. */
@@ -1487,9 +1489,8 @@ do { \
1487 if (reg == -1) \ 1489 if (reg == -1) \
1488 { \ 1490 { \
1489 /* It's a counter. */ \ 1491 /* It's a counter. */ \
1490 /* Here, we discard `const', which makes re_match non-reentrant. \ 1492 /* Here, we discard `const', making re_match non-reentrant. */ \
1491 Gcc gives a warning for it, which is good. */ \ 1493 unsigned char *ptr = (unsigned char*) POP_FAILURE_POINTER (); \
1492 unsigned char *ptr = POP_FAILURE_POINTER (); \
1493 reg = POP_FAILURE_INT (); \ 1494 reg = POP_FAILURE_INT (); \
1494 STORE_NUMBER (ptr, reg); \ 1495 STORE_NUMBER (ptr, reg); \
1495 DEBUG_PRINT3 (" Pop counter %p = %d\n", ptr, reg); \ 1496 DEBUG_PRINT3 (" Pop counter %p = %d\n", ptr, reg); \
@@ -5276,9 +5277,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
5276 mcnt, p + mcnt); 5277 mcnt, p + mcnt);
5277 { 5278 {
5278 re_char *p1 = p; /* Next operation. */ 5279 re_char *p1 = p; /* Next operation. */
5279 /* Please don't add casts to try and shut up GCC. */ 5280 /* Here, we discard `const', making re_match non-reentrant. */
5280 unsigned char *p2 = p + mcnt; /* Destination of the jump. */ 5281 unsigned char *p2 = (unsigned char*) p + mcnt; /* Jump dest. */
5281 unsigned char *p3 = p - 3; /* Location of the opcode. */ 5282 unsigned char *p3 = (unsigned char*) p - 3; /* opcode location. */
5282 5283
5283 p -= 3; /* Reset so that we will re-execute the 5284 p -= 3; /* Reset so that we will re-execute the
5284 instruction once it's been changed. */ 5285 instruction once it's been changed. */
@@ -5328,8 +5329,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
5328 /* Originally, mcnt is how many times we HAVE to succeed. */ 5329 /* Originally, mcnt is how many times we HAVE to succeed. */
5329 if (mcnt != 0) 5330 if (mcnt != 0)
5330 { 5331 {
5331 /* Please don't add a cast to try and shut up GCC. */ 5332 /* Here, we discard `const', making re_match non-reentrant. */
5332 unsigned char *p2 = p + 2; /* Location of the counter. */ 5333 unsigned char *p2 = (unsigned char*) p + 2; /* counter loc. */
5333 mcnt--; 5334 mcnt--;
5334 p += 4; 5335 p += 4;
5335 PUSH_NUMBER (p2, mcnt); 5336 PUSH_NUMBER (p2, mcnt);
@@ -5347,8 +5348,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
5347 /* Originally, this is how many times we CAN jump. */ 5348 /* Originally, this is how many times we CAN jump. */
5348 if (mcnt != 0) 5349 if (mcnt != 0)
5349 { 5350 {
5350 /* Please don't add a cast to try and shut up GCC. */ 5351 /* Here, we discard `const', making re_match non-reentrant. */
5351 unsigned char *p2 = p + 2; /* Location of the counter. */ 5352 unsigned char *p2 = (unsigned char*) p + 2; /* counter loc. */
5352 mcnt--; 5353 mcnt--;
5353 PUSH_NUMBER (p2, mcnt); 5354 PUSH_NUMBER (p2, mcnt);
5354 goto unconditional_jump; 5355 goto unconditional_jump;
@@ -5364,8 +5365,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
5364 DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); 5365 DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
5365 5366
5366 EXTRACT_NUMBER_AND_INCR (mcnt, p); 5367 EXTRACT_NUMBER_AND_INCR (mcnt, p);
5367 /* Please don't add a cast to try and shut up GCC. */ 5368 /* Here, we discard `const', making re_match non-reentrant. */
5368 p2 = p + mcnt; 5369 p2 = (unsigned char*) p + mcnt;
5369 /* Signedness doesn't matter since we only copy MCNT's bits . */ 5370 /* Signedness doesn't matter since we only copy MCNT's bits . */
5370 EXTRACT_NUMBER_AND_INCR (mcnt, p); 5371 EXTRACT_NUMBER_AND_INCR (mcnt, p);
5371 DEBUG_PRINT3 (" Setting %p to %d.\n", p2, mcnt); 5372 DEBUG_PRINT3 (" Setting %p to %d.\n", p2, mcnt);