aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-04-07 18:46:21 +0000
committerRichard M. Stallman1995-04-07 18:46:21 +0000
commit8d50503997ebc7e55d098e85ad1a77e4cce61f05 (patch)
tree128ac14337f8821350ec2c595a3548325e86ff98 /src
parente841a430cd22d224e97f5b7e386037c8688124aa (diff)
downloademacs-8d50503997ebc7e55d098e85ad1a77e4cce61f05.tar.gz
emacs-8d50503997ebc7e55d098e85ad1a77e4cce61f05.zip
(search_buffer): Avoid casting trt to int.
Use EMACS_INT for comparing pointers.
Diffstat (limited to 'src')
-rw-r--r--src/search.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/search.c b/src/search.c
index 9703e320ab3..82d9d812bc9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1113,7 +1113,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt, posix)
1113 { 1113 {
1114 j = pat[i]; i += direction; 1114 j = pat[i]; i += direction;
1115 if (i == dirlen) i = infinity; 1115 if (i == dirlen) i = infinity;
1116 if ((int) trt) 1116 if (trt != 0)
1117 { 1117 {
1118 k = (j = trt[j]); 1118 k = (j = trt[j]);
1119 if (i == infinity) 1119 if (i == infinity)
@@ -1175,20 +1175,20 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt, posix)
1175 either kind of comparison will work as long 1175 either kind of comparison will work as long
1176 as we don't step by infinity. So pick the kind 1176 as we don't step by infinity. So pick the kind
1177 that works when we do step by infinity. */ 1177 that works when we do step by infinity. */
1178 if ((int) (p_limit + infinity) > (int) p_limit) 1178 if ((EMACS_INT) (p_limit + infinity) > (EMACS_INT) p_limit)
1179 while ((int) cursor <= (int) p_limit) 1179 while ((EMACS_INT) cursor <= (int) p_limit)
1180 cursor += BM_tab[*cursor]; 1180 cursor += BM_tab[*cursor];
1181 else 1181 else
1182 while ((unsigned int) cursor <= (unsigned int) p_limit) 1182 while ((unsigned EMACS_INT) cursor <= (unsigned EMACS_INT) p_limit)
1183 cursor += BM_tab[*cursor]; 1183 cursor += BM_tab[*cursor];
1184 } 1184 }
1185 else 1185 else
1186 { 1186 {
1187 if ((int) (p_limit + infinity) < (int) p_limit) 1187 if ((EMACS_INT) (p_limit + infinity) < (EMACS_INT) p_limit)
1188 while ((int) cursor >= (int) p_limit) 1188 while ((EMACS_INT) cursor >= (EMACS_INT) p_limit)
1189 cursor += BM_tab[*cursor]; 1189 cursor += BM_tab[*cursor];
1190 else 1190 else
1191 while ((unsigned int) cursor >= (unsigned int) p_limit) 1191 while ((unsigned EMACS_INT) cursor >= (unsigned EMACS_INT) p_limit)
1192 cursor += BM_tab[*cursor]; 1192 cursor += BM_tab[*cursor];
1193 } 1193 }
1194/* If you are here, cursor is beyond the end of the searched region. */ 1194/* If you are here, cursor is beyond the end of the searched region. */
@@ -1201,7 +1201,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt, posix)
1201 break; /* a small overrun is genuine */ 1201 break; /* a small overrun is genuine */
1202 cursor -= infinity; /* large overrun = hit */ 1202 cursor -= infinity; /* large overrun = hit */
1203 i = dirlen - direction; 1203 i = dirlen - direction;
1204 if ((int) trt) 1204 if (trt != 0)
1205 { 1205 {
1206 while ((i -= direction) + direction != 0) 1206 while ((i -= direction) + direction != 0)
1207 if (pat[i] != trt[*(cursor -= direction)]) 1207 if (pat[i] != trt[*(cursor -= direction)])
@@ -1264,7 +1264,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt, posix)
1264 while ((i -= direction) + direction != 0) 1264 while ((i -= direction) + direction != 0)
1265 { 1265 {
1266 pos -= direction; 1266 pos -= direction;
1267 if (pat[i] != (((int) trt) 1267 if (pat[i] != (trt != 0
1268 ? trt[FETCH_CHAR(pos)] 1268 ? trt[FETCH_CHAR(pos)]
1269 : FETCH_CHAR (pos))) 1269 : FETCH_CHAR (pos)))
1270 break; 1270 break;