summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-09-21 13:22:09 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-09-21 13:22:09 -0700
commit0b1fccc479923e2a78dc6398a009d9b8a037080d (patch)
tree554d84cd00249076785a121d23788ebf82847513 /src/search.c
parentc5c18a57577d2f70199e3ce9b2c29fc03cd82e89 (diff)
downloademacs-0b1fccc479923e2a78dc6398a009d9b8a037080d.tar.gz
* search.c (wordify, Fset_match_data): Revamp to pacify GCC 4.6.1.
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/search.c b/src/search.c
index dc76998d000..df53dbf8d89 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2126,7 +2126,7 @@ wordify (Lisp_Object string, int lax)
}
adjust = word_count - 1;
- if (INT_MULTIPLY_OVERFLOW (5, adjust))
+ if (TYPE_MAXIMUM (EMACS_INT) / 5 < adjust)
memory_full (SIZE_MAX);
adjust = - punct_count + 5 * adjust
+ ((lax && !whitespace_at_end) ? 2 : 4);
@@ -3065,10 +3065,12 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */)
XSETFASTINT (marker, 0);
CHECK_NUMBER_COERCE_MARKER (marker);
- if (TYPE_MINIMUM (regoff_t) <= XINT (from)
- && XINT (from) <= TYPE_MAXIMUM (regoff_t)
- && TYPE_MINIMUM (regoff_t) <= XINT (marker)
- && XINT (marker) <= TYPE_MAXIMUM (regoff_t))
+ if ((XINT (from) < 0
+ ? TYPE_MINIMUM (regoff_t) <= XINT (from)
+ : XINT (from) <= TYPE_MAXIMUM (regoff_t))
+ && (XINT (marker) < 0
+ ? TYPE_MINIMUM (regoff_t) <= XINT (marker)
+ : XINT (marker) <= TYPE_MAXIMUM (regoff_t)))
{
search_regs.start[i] = XINT (from);
search_regs.end[i] = XINT (marker);