PATCH: regex.c cleanup
Greg McGary
greg@mcgary.org
Thu Aug 3 12:51:00 GMT 2000
No binary change for non-BP.
Tighter code for BP.
OK?
2000-08-03 Greg McGary <greg@mcgary.org>
* posix/regex.c (EXTEND_BUFFER_HIGH_BOUND): Remove macro.
(MOVE_BUFFER_POINTER): Handle high_bound properly.
(EXTEND_BUFFER): Don't call EXTEND_BUFFER_HIGH_BOUND.
Index: posix/regex.c
===================================================================
RCS file: /cvs/glibc/libc/posix/regex.c,v
retrieving revision 1.78
diff -u -p -r1.78 regex.c
--- regex.c 2000/08/02 21:18:58 1.78
+++ regex.c 2000/08/03 19:48:28
@@ -1749,22 +1749,10 @@ static reg_errcode_t compile_range _RE_A
being larger than MAX_BUF_SIZE, then flag memory exhausted. */
#if __BOUNDED_POINTERS__
# define MOVE_BUFFER_POINTER(P) \
- (__ptrlow (P) += incr, __ptrhigh (P) += incr, __ptrvalue (P) += incr)
-# define EXTEND_BUFFER_HIGH_BOUND \
- do { \
- int incr = bufp->allocated >> 1; \
- __ptrhigh b += incr; \
- __ptrhigh begalt += incr; \
- if (fixup_alt_jump) \
- __ptrhigh fixup_alt_jump += incr; \
- if (laststart) \
- __ptrhigh laststart += incr; \
- if (pending_exact) \
- __ptrhigh pending_exact += incr; \
- } while (0)
+ (__ptrhigh (P) = (__ptrlow (P) += incr) + bufp->allocated, \
+ __ptrvalue (P) += incr)
#else
# define MOVE_BUFFER_POINTER(P) (P) += incr
-# define EXTEND_BUFFER_HIGH_BOUND
#endif
#define EXTEND_BUFFER() \
do { \
@@ -1790,7 +1778,6 @@ static reg_errcode_t compile_range _RE_A
if (pending_exact) \
MOVE_BUFFER_POINTER (pending_exact); \
} \
- EXTEND_BUFFER_HIGH_BOUND; \
} while (0)
More information about the Libc-hacker
mailing list