Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b2c71fb4
Commit
b2c71fb4
authored
Mar 14, 1994
by
Karl Heuer
Browse files
(search_buffer): Avoid boolean/integer mixing that confuses some compilers.
parent
484ab76a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/search.c
src/search.c
+4
-1
No files found.
src/search.c
View file @
b2c71fb4
...
...
@@ -822,7 +822,10 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt)
of pattern would align in a possible match. */
while (n != 0)
{
if
((
lim
-
pos
-
(
direction
>
0
))
*
direction
<
0
)
/* It's been reported that some (broken) compiler thinks that
Boolean expressions in an arithmetic context are unsigned.
Using an explicit ?1:0 prevents this. */
if ((lim - pos - ((direction > 0) ? 1 : 0)) * direction < 0)
return (n * (0 - direction));
/* First we do the part we can by pointers (maybe nothing) */
QUIT;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment