diff options
| author | Tom Tromey | 2018-07-06 21:56:17 -0600 |
|---|---|---|
| committer | Tom Tromey | 2018-07-12 22:12:27 -0600 |
| commit | 42fe787b0f26c2df682b2797407a669ef8522ccb (patch) | |
| tree | e944fe465e2b65703a8361bc82647faf4f7907f1 /src/search.c | |
| parent | 01dbf2a347944497fdcf2ec156f4605020d7ba2a (diff) | |
| download | emacs-42fe787b0f26c2df682b2797407a669ef8522ccb.tar.gz emacs-42fe787b0f26c2df682b2797407a669ef8522ccb.zip | |
Rename integerp->fixnum, etc, in preparation for bignums
* src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
src/process.c, src/profiler.c, src/search.c, src/sound.c,
src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
Diffstat (limited to 'src/search.c')
| -rw-r--r-- | src/search.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/search.c b/src/search.c index ccdb659776d..72374c8b9b4 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -132,7 +132,7 @@ compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, | |||
| 132 | 132 | ||
| 133 | eassert (!cp->busy); | 133 | eassert (!cp->busy); |
| 134 | cp->regexp = Qnil; | 134 | cp->regexp = Qnil; |
| 135 | cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); | 135 | cp->buf.translate = (! NILP (translate) ? translate : make_fixnum (0)); |
| 136 | cp->posix = posix; | 136 | cp->posix = posix; |
| 137 | cp->buf.multibyte = STRING_MULTIBYTE (pattern); | 137 | cp->buf.multibyte = STRING_MULTIBYTE (pattern); |
| 138 | cp->buf.charset_unibyte = charset_unibyte; | 138 | cp->buf.charset_unibyte = charset_unibyte; |
| @@ -238,7 +238,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, | |||
| 238 | && !cp->busy | 238 | && !cp->busy |
| 239 | && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) | 239 | && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) |
| 240 | && !NILP (Fstring_equal (cp->regexp, pattern)) | 240 | && !NILP (Fstring_equal (cp->regexp, pattern)) |
| 241 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) | 241 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_fixnum (0))) |
| 242 | && cp->posix == posix | 242 | && cp->posix == posix |
| 243 | && (EQ (cp->syntax_table, Qt) | 243 | && (EQ (cp->syntax_table, Qt) |
| 244 | || EQ (cp->syntax_table, BVAR (current_buffer, syntax_table))) | 244 | || EQ (cp->syntax_table, BVAR (current_buffer, syntax_table))) |
| @@ -401,7 +401,7 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, | |||
| 401 | { | 401 | { |
| 402 | ptrdiff_t len = SCHARS (string); | 402 | ptrdiff_t len = SCHARS (string); |
| 403 | 403 | ||
| 404 | CHECK_NUMBER (start); | 404 | CHECK_FIXNUM (start); |
| 405 | pos = XINT (start); | 405 | pos = XINT (start); |
| 406 | if (pos < 0 && -pos <= len) | 406 | if (pos < 0 && -pos <= len) |
| 407 | pos = len + pos; | 407 | pos = len + pos; |
| @@ -446,7 +446,7 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, | |||
| 446 | = string_byte_to_char (string, search_regs.end[i]); | 446 | = string_byte_to_char (string, search_regs.end[i]); |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | return make_number (string_byte_to_char (string, val)); | 449 | return make_fixnum (string_byte_to_char (string, val)); |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | DEFUN ("string-match", Fstring_match, Sstring_match, 2, 3, 0, | 452 | DEFUN ("string-match", Fstring_match, Sstring_match, 2, 3, 0, |
| @@ -1036,7 +1036,7 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, | |||
| 1036 | 1036 | ||
| 1037 | if (!NILP (count)) | 1037 | if (!NILP (count)) |
| 1038 | { | 1038 | { |
| 1039 | CHECK_NUMBER (count); | 1039 | CHECK_FIXNUM (count); |
| 1040 | n *= XINT (count); | 1040 | n *= XINT (count); |
| 1041 | } | 1041 | } |
| 1042 | 1042 | ||
| @@ -1050,7 +1050,7 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, | |||
| 1050 | } | 1050 | } |
| 1051 | else | 1051 | else |
| 1052 | { | 1052 | { |
| 1053 | CHECK_NUMBER_COERCE_MARKER (bound); | 1053 | CHECK_FIXNUM_COERCE_MARKER (bound); |
| 1054 | lim = XINT (bound); | 1054 | lim = XINT (bound); |
| 1055 | if (n > 0 ? lim < PT : lim > PT) | 1055 | if (n > 0 ? lim < PT : lim > PT) |
| 1056 | error ("Invalid search bound (wrong side of point)"); | 1056 | error ("Invalid search bound (wrong side of point)"); |
| @@ -1096,7 +1096,7 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, | |||
| 1096 | eassert (BEGV <= np && np <= ZV); | 1096 | eassert (BEGV <= np && np <= ZV); |
| 1097 | SET_PT (np); | 1097 | SET_PT (np); |
| 1098 | 1098 | ||
| 1099 | return make_number (np); | 1099 | return make_fixnum (np); |
| 1100 | } | 1100 | } |
| 1101 | 1101 | ||
| 1102 | /* Return true if REGEXP it matches just one constant string. */ | 1102 | /* Return true if REGEXP it matches just one constant string. */ |
| @@ -1151,8 +1151,8 @@ do \ | |||
| 1151 | if (! NILP (trt)) \ | 1151 | if (! NILP (trt)) \ |
| 1152 | { \ | 1152 | { \ |
| 1153 | Lisp_Object temp; \ | 1153 | Lisp_Object temp; \ |
| 1154 | temp = Faref (trt, make_number (d)); \ | 1154 | temp = Faref (trt, make_fixnum (d)); \ |
| 1155 | if (INTEGERP (temp)) \ | 1155 | if (FIXNUMP (temp)) \ |
| 1156 | out = XINT (temp); \ | 1156 | out = XINT (temp); \ |
| 1157 | else \ | 1157 | else \ |
| 1158 | out = d; \ | 1158 | out = d; \ |
| @@ -2420,9 +2420,9 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2420 | sub = 0; | 2420 | sub = 0; |
| 2421 | else | 2421 | else |
| 2422 | { | 2422 | { |
| 2423 | CHECK_NUMBER (subexp); | 2423 | CHECK_FIXNUM (subexp); |
| 2424 | if (! (0 <= XINT (subexp) && XINT (subexp) < search_regs.num_regs)) | 2424 | if (! (0 <= XINT (subexp) && XINT (subexp) < search_regs.num_regs)) |
| 2425 | args_out_of_range (subexp, make_number (search_regs.num_regs)); | 2425 | args_out_of_range (subexp, make_fixnum (search_regs.num_regs)); |
| 2426 | sub = XINT (subexp); | 2426 | sub = XINT (subexp); |
| 2427 | } | 2427 | } |
| 2428 | 2428 | ||
| @@ -2431,16 +2431,16 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2431 | if (search_regs.start[sub] < BEGV | 2431 | if (search_regs.start[sub] < BEGV |
| 2432 | || search_regs.start[sub] > search_regs.end[sub] | 2432 | || search_regs.start[sub] > search_regs.end[sub] |
| 2433 | || search_regs.end[sub] > ZV) | 2433 | || search_regs.end[sub] > ZV) |
| 2434 | args_out_of_range (make_number (search_regs.start[sub]), | 2434 | args_out_of_range (make_fixnum (search_regs.start[sub]), |
| 2435 | make_number (search_regs.end[sub])); | 2435 | make_fixnum (search_regs.end[sub])); |
| 2436 | } | 2436 | } |
| 2437 | else | 2437 | else |
| 2438 | { | 2438 | { |
| 2439 | if (search_regs.start[sub] < 0 | 2439 | if (search_regs.start[sub] < 0 |
| 2440 | || search_regs.start[sub] > search_regs.end[sub] | 2440 | || search_regs.start[sub] > search_regs.end[sub] |
| 2441 | || search_regs.end[sub] > SCHARS (string)) | 2441 | || search_regs.end[sub] > SCHARS (string)) |
| 2442 | args_out_of_range (make_number (search_regs.start[sub]), | 2442 | args_out_of_range (make_fixnum (search_regs.start[sub]), |
| 2443 | make_number (search_regs.end[sub])); | 2443 | make_fixnum (search_regs.end[sub])); |
| 2444 | } | 2444 | } |
| 2445 | 2445 | ||
| 2446 | if (NILP (fixedcase)) | 2446 | if (NILP (fixedcase)) |
| @@ -2525,9 +2525,9 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2525 | { | 2525 | { |
| 2526 | Lisp_Object before, after; | 2526 | Lisp_Object before, after; |
| 2527 | 2527 | ||
| 2528 | before = Fsubstring (string, make_number (0), | 2528 | before = Fsubstring (string, make_fixnum (0), |
| 2529 | make_number (search_regs.start[sub])); | 2529 | make_fixnum (search_regs.start[sub])); |
| 2530 | after = Fsubstring (string, make_number (search_regs.end[sub]), Qnil); | 2530 | after = Fsubstring (string, make_fixnum (search_regs.end[sub]), Qnil); |
| 2531 | 2531 | ||
| 2532 | /* Substitute parts of the match into NEWTEXT | 2532 | /* Substitute parts of the match into NEWTEXT |
| 2533 | if desired. */ | 2533 | if desired. */ |
| @@ -2590,8 +2590,8 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2590 | middle = Qnil; | 2590 | middle = Qnil; |
| 2591 | accum = concat3 (accum, middle, | 2591 | accum = concat3 (accum, middle, |
| 2592 | Fsubstring (string, | 2592 | Fsubstring (string, |
| 2593 | make_number (substart), | 2593 | make_fixnum (substart), |
| 2594 | make_number (subend))); | 2594 | make_fixnum (subend))); |
| 2595 | lastpos = pos; | 2595 | lastpos = pos; |
| 2596 | lastpos_byte = pos_byte; | 2596 | lastpos_byte = pos_byte; |
| 2597 | } | 2597 | } |
| @@ -2780,12 +2780,12 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2780 | } | 2780 | } |
| 2781 | 2781 | ||
| 2782 | if (case_action == all_caps) | 2782 | if (case_action == all_caps) |
| 2783 | Fupcase_region (make_number (search_regs.start[sub]), | 2783 | Fupcase_region (make_fixnum (search_regs.start[sub]), |
| 2784 | make_number (newpoint), | 2784 | make_fixnum (newpoint), |
| 2785 | Qnil); | 2785 | Qnil); |
| 2786 | else if (case_action == cap_initial) | 2786 | else if (case_action == cap_initial) |
| 2787 | Fupcase_initials_region (make_number (search_regs.start[sub]), | 2787 | Fupcase_initials_region (make_fixnum (search_regs.start[sub]), |
| 2788 | make_number (newpoint)); | 2788 | make_fixnum (newpoint)); |
| 2789 | 2789 | ||
| 2790 | if (search_regs.start[sub] != sub_start | 2790 | if (search_regs.start[sub] != sub_start |
| 2791 | || search_regs.end[sub] != sub_end | 2791 | || search_regs.end[sub] != sub_end |
| @@ -2809,16 +2809,16 @@ match_limit (Lisp_Object num, bool beginningp) | |||
| 2809 | { | 2809 | { |
| 2810 | EMACS_INT n; | 2810 | EMACS_INT n; |
| 2811 | 2811 | ||
| 2812 | CHECK_NUMBER (num); | 2812 | CHECK_FIXNUM (num); |
| 2813 | n = XINT (num); | 2813 | n = XINT (num); |
| 2814 | if (n < 0) | 2814 | if (n < 0) |
| 2815 | args_out_of_range (num, make_number (0)); | 2815 | args_out_of_range (num, make_fixnum (0)); |
| 2816 | if (search_regs.num_regs <= 0) | 2816 | if (search_regs.num_regs <= 0) |
| 2817 | error ("No match data, because no search succeeded"); | 2817 | error ("No match data, because no search succeeded"); |
| 2818 | if (n >= search_regs.num_regs | 2818 | if (n >= search_regs.num_regs |
| 2819 | || search_regs.start[n] < 0) | 2819 | || search_regs.start[n] < 0) |
| 2820 | return Qnil; | 2820 | return Qnil; |
| 2821 | return (make_number ((beginningp) ? search_regs.start[n] | 2821 | return (make_fixnum ((beginningp) ? search_regs.start[n] |
| 2822 | : search_regs.end[n])); | 2822 | : search_regs.end[n])); |
| 2823 | } | 2823 | } |
| 2824 | 2824 | ||
| @@ -2908,11 +2908,11 @@ Return value is undefined if the last search failed. */) | |||
| 2908 | { | 2908 | { |
| 2909 | data[2 * i] = Fmake_marker (); | 2909 | data[2 * i] = Fmake_marker (); |
| 2910 | Fset_marker (data[2 * i], | 2910 | Fset_marker (data[2 * i], |
| 2911 | make_number (start), | 2911 | make_fixnum (start), |
| 2912 | last_thing_searched); | 2912 | last_thing_searched); |
| 2913 | data[2 * i + 1] = Fmake_marker (); | 2913 | data[2 * i + 1] = Fmake_marker (); |
| 2914 | Fset_marker (data[2 * i + 1], | 2914 | Fset_marker (data[2 * i + 1], |
| 2915 | make_number (search_regs.end[i]), | 2915 | make_fixnum (search_regs.end[i]), |
| 2916 | last_thing_searched); | 2916 | last_thing_searched); |
| 2917 | } | 2917 | } |
| 2918 | else | 2918 | else |
| @@ -3037,7 +3037,7 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */) | |||
| 3037 | XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer); | 3037 | XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer); |
| 3038 | } | 3038 | } |
| 3039 | 3039 | ||
| 3040 | CHECK_NUMBER_COERCE_MARKER (marker); | 3040 | CHECK_FIXNUM_COERCE_MARKER (marker); |
| 3041 | from = marker; | 3041 | from = marker; |
| 3042 | 3042 | ||
| 3043 | if (!NILP (reseat) && MARKERP (m)) | 3043 | if (!NILP (reseat) && MARKERP (m)) |
| @@ -3054,7 +3054,7 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */) | |||
| 3054 | if (MARKERP (marker) && XMARKER (marker)->buffer == 0) | 3054 | if (MARKERP (marker) && XMARKER (marker)->buffer == 0) |
| 3055 | XSETFASTINT (marker, 0); | 3055 | XSETFASTINT (marker, 0); |
| 3056 | 3056 | ||
| 3057 | CHECK_NUMBER_COERCE_MARKER (marker); | 3057 | CHECK_FIXNUM_COERCE_MARKER (marker); |
| 3058 | if ((XINT (from) < 0 | 3058 | if ((XINT (from) < 0 |
| 3059 | ? TYPE_MINIMUM (regoff_t) <= XINT (from) | 3059 | ? TYPE_MINIMUM (regoff_t) <= XINT (from) |
| 3060 | : XINT (from) <= TYPE_MAXIMUM (regoff_t)) | 3060 | : XINT (from) <= TYPE_MAXIMUM (regoff_t)) |
| @@ -3349,11 +3349,11 @@ the buffer. If the buffer doesn't have a cache, the value is nil. */) | |||
| 3349 | NULL, true); | 3349 | NULL, true); |
| 3350 | if (shortage != 0 || i >= nl_count_cache) | 3350 | if (shortage != 0 || i >= nl_count_cache) |
| 3351 | break; | 3351 | break; |
| 3352 | ASET (cache_newlines, i, make_number (found - 1)); | 3352 | ASET (cache_newlines, i, make_fixnum (found - 1)); |
| 3353 | } | 3353 | } |
| 3354 | /* Fill the rest of slots with an invalid position. */ | 3354 | /* Fill the rest of slots with an invalid position. */ |
| 3355 | for ( ; i < nl_count_cache; i++) | 3355 | for ( ; i < nl_count_cache; i++) |
| 3356 | ASET (cache_newlines, i, make_number (-1)); | 3356 | ASET (cache_newlines, i, make_fixnum (-1)); |
| 3357 | } | 3357 | } |
| 3358 | 3358 | ||
| 3359 | /* Now do the same, but without using the cache. */ | 3359 | /* Now do the same, but without using the cache. */ |
| @@ -3371,10 +3371,10 @@ the buffer. If the buffer doesn't have a cache, the value is nil. */) | |||
| 3371 | NULL, true); | 3371 | NULL, true); |
| 3372 | if (shortage != 0 || i >= nl_count_buf) | 3372 | if (shortage != 0 || i >= nl_count_buf) |
| 3373 | break; | 3373 | break; |
| 3374 | ASET (buf_newlines, i, make_number (found - 1)); | 3374 | ASET (buf_newlines, i, make_fixnum (found - 1)); |
| 3375 | } | 3375 | } |
| 3376 | for ( ; i < nl_count_buf; i++) | 3376 | for ( ; i < nl_count_buf; i++) |
| 3377 | ASET (buf_newlines, i, make_number (-1)); | 3377 | ASET (buf_newlines, i, make_fixnum (-1)); |
| 3378 | } | 3378 | } |
| 3379 | 3379 | ||
| 3380 | /* Construct the value and return it. */ | 3380 | /* Construct the value and return it. */ |