diff options
author | Tom Tromey <tom@tromey.com> | 2018-07-06 21:56:17 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-12 22:12:27 -0600 |
commit | 42fe787b0f26c2df682b2797407a669ef8522ccb (patch) | |
tree | e944fe465e2b65703a8361bc82647faf4f7907f1 /src/fileio.c | |
parent | 01dbf2a347944497fdcf2ec156f4605020d7ba2a (diff) | |
download | emacs-42fe787b0f26c2df682b2797407a669ef8522ccb.tar.gz |
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/fileio.c')
-rw-r--r-- | src/fileio.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/fileio.c b/src/fileio.c index 5a1c7ae10e5..b8809853e00 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -683,7 +683,7 @@ This function does not grok magic file names. */) memset (data + prefix_len, 'X', nX); memcpy (data + prefix_len + nX, SSDATA (encoded_suffix), suffix_len); int kind = (NILP (dir_flag) ? GT_FILE - : EQ (dir_flag, make_number (0)) ? GT_NOCREATE + : EQ (dir_flag, make_fixnum (0)) ? GT_NOCREATE : GT_DIR); int fd = gen_tempname (data, suffix_len, O_BINARY | O_CLOEXEC, kind); bool failed = fd < 0; @@ -724,7 +724,7 @@ later creating the file, which opens all kinds of security holes. For that reason, you should normally use `make-temp-file' instead. */) (Lisp_Object prefix) { - return Fmake_temp_file_internal (prefix, make_number (0), + return Fmake_temp_file_internal (prefix, make_fixnum (0), empty_unibyte_string, Qnil); } @@ -1937,9 +1937,9 @@ permissions. */) #ifdef WINDOWSNT if (NILP (ok_if_already_exists) - || INTEGERP (ok_if_already_exists)) + || FIXNUMP (ok_if_already_exists)) barf_or_query_if_file_exists (newname, false, "copy to it", - INTEGERP (ok_if_already_exists), false); + FIXNUMP (ok_if_already_exists), false); result = w32_copy_file (SSDATA (encoded_file), SSDATA (encoded_newname), !NILP (keep_time), !NILP (preserve_uid_gid), @@ -1994,9 +1994,9 @@ permissions. */) new_mask); if (ofd < 0 && errno == EEXIST) { - if (NILP (ok_if_already_exists) || INTEGERP (ok_if_already_exists)) + if (NILP (ok_if_already_exists) || FIXNUMP (ok_if_already_exists)) barf_or_query_if_file_exists (newname, true, "copy to it", - INTEGERP (ok_if_already_exists), false); + FIXNUMP (ok_if_already_exists), false); already_exists = true; ofd = emacs_open (SSDATA (encoded_newname), O_WRONLY, 0); } @@ -2342,7 +2342,7 @@ This is what happens in interactive use with M-x. */) bool plain_rename = (case_only_rename || (!NILP (ok_if_already_exists) - && !INTEGERP (ok_if_already_exists))); + && !FIXNUMP (ok_if_already_exists))); int rename_errno UNINIT; if (!plain_rename) { @@ -2360,7 +2360,7 @@ This is what happens in interactive use with M-x. */) #endif barf_or_query_if_file_exists (newname, rename_errno == EEXIST, "rename to it", - INTEGERP (ok_if_already_exists), + FIXNUMP (ok_if_already_exists), false); plain_rename = true; break; @@ -2453,9 +2453,9 @@ This is what happens in interactive use with M-x. */) if (errno == EEXIST) { if (NILP (ok_if_already_exists) - || INTEGERP (ok_if_already_exists)) + || FIXNUMP (ok_if_already_exists)) barf_or_query_if_file_exists (newname, true, "make it a new name", - INTEGERP (ok_if_already_exists), false); + FIXNUMP (ok_if_already_exists), false); unlink (SSDATA (newname)); if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) == 0) return Qnil; @@ -2481,12 +2481,12 @@ This happens for interactive use with M-x. */) Lisp_Object encoded_target, encoded_linkname; CHECK_STRING (target); - if (INTEGERP (ok_if_already_exists)) + if (FIXNUMP (ok_if_already_exists)) { if (SREF (target, 0) == '~') target = Fexpand_file_name (target, Qnil); else if (SREF (target, 0) == '/' && SREF (target, 1) == ':') - target = Fsubstring_no_properties (target, make_number (2), Qnil); + target = Fsubstring_no_properties (target, make_fixnum (2), Qnil); } linkname = expand_cp_target (target, linkname); @@ -2510,9 +2510,9 @@ This happens for interactive use with M-x. */) if (errno == EEXIST) { if (NILP (ok_if_already_exists) - || INTEGERP (ok_if_already_exists)) + || FIXNUMP (ok_if_already_exists)) barf_or_query_if_file_exists (linkname, true, "make it a link", - INTEGERP (ok_if_already_exists), false); + FIXNUMP (ok_if_already_exists), false); unlink (SSDATA (encoded_linkname)); if (symlink (SSDATA (encoded_target), SSDATA (encoded_linkname)) == 0) return Qnil; @@ -3168,7 +3168,7 @@ Return nil, if file does not exist or is not accessible. */) if (stat (SSDATA (absname), &st) < 0) return Qnil; - return make_number (st.st_mode & 07777); + return make_fixnum (st.st_mode & 07777); } DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, @@ -3185,7 +3185,7 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */) Lisp_Object handler; absname = Fexpand_file_name (filename, BVAR (current_buffer, directory)); - CHECK_NUMBER (mode); + CHECK_FIXNUM (mode); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -3216,7 +3216,7 @@ by having the corresponding bit in the mask reset. */) (Lisp_Object mode) { mode_t oldrealmask, oldumask, newumask; - CHECK_NUMBER (mode); + CHECK_FIXNUM (mode); oldrealmask = realmask; newumask = ~ XINT (mode) & 0777; @@ -3383,7 +3383,7 @@ read_non_regular (Lisp_Object state) ((char *) BEG_ADDR + PT_BYTE - BEG_BYTE + data->s.inserted), data->s.trytry); - return make_number (nbytes); + return make_fixnum (nbytes); } @@ -3401,7 +3401,7 @@ read_non_regular_quit (Lisp_Object ignore) static off_t file_offset (Lisp_Object val) { - if (RANGED_INTEGERP (0, val, TYPE_MAXIMUM (off_t))) + if (RANGED_FIXNUMP (0, val, TYPE_MAXIMUM (off_t))) return XINT (val); if (FLOATP (val)) @@ -3461,7 +3461,7 @@ restore_window_points (Lisp_Object window_markers, ptrdiff_t inserted, Lisp_Object car = XCAR (window_markers); Lisp_Object marker = XCAR (car); Lisp_Object oldpos = XCDR (car); - if (MARKERP (marker) && INTEGERP (oldpos) + if (MARKERP (marker) && FIXNUMP (oldpos) && XINT (oldpos) > same_at_start && XINT (oldpos) < same_at_end) { @@ -3470,7 +3470,7 @@ restore_window_points (Lisp_Object window_markers, ptrdiff_t inserted, double growth = newsize / (double)oldsize; ptrdiff_t newpos = same_at_start + growth * (XINT (oldpos) - same_at_start); - Fset_marker (marker, make_number (newpos), Qnil); + Fset_marker (marker, make_fixnum (newpos), Qnil); } } } @@ -3583,7 +3583,7 @@ by calling `format-decode', which see. */) val = call6 (handler, Qinsert_file_contents, filename, visit, beg, end, replace); if (CONSP (val) && CONSP (XCDR (val)) - && RANGED_INTEGERP (0, XCAR (XCDR (val)), ZV - PT)) + && RANGED_FIXNUMP (0, XCAR (XCDR (val)), ZV - PT)) inserted = XINT (XCAR (XCDR (val))); goto handled; } @@ -3769,7 +3769,7 @@ by calling `format-decode', which see. */) insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0); TEMP_SET_PT_BOTH (BEG, BEG_BYTE); coding_system = call2 (Vset_auto_coding_function, - filename, make_number (nread)); + filename, make_fixnum (nread)); set_buffer_internal (prev); /* Discard the unwind protect for recovering the @@ -4344,7 +4344,7 @@ by calling `format-decode', which see. */) if (inserted > 0 && ! NILP (Vset_auto_coding_function)) { coding_system = call2 (Vset_auto_coding_function, - filename, make_number (inserted)); + filename, make_fixnum (inserted)); } if (NILP (coding_system)) @@ -4463,11 +4463,11 @@ by calling `format-decode', which see. */) if (! NILP (Ffboundp (Qafter_insert_file_set_coding))) { - insval = call2 (Qafter_insert_file_set_coding, make_number (inserted), + insval = call2 (Qafter_insert_file_set_coding, make_fixnum (inserted), visit); if (! NILP (insval)) { - if (! RANGED_INTEGERP (0, insval, ZV - PT)) + if (! RANGED_FIXNUMP (0, insval, ZV - PT)) wrong_type_argument (intern ("inserted-chars"), insval); inserted = XFASTINT (insval); } @@ -4489,8 +4489,8 @@ by calling `format-decode', which see. */) if (NILP (replace)) { insval = call3 (Qformat_decode, - Qnil, make_number (inserted), visit); - if (! RANGED_INTEGERP (0, insval, ZV - PT)) + Qnil, make_fixnum (inserted), visit); + if (! RANGED_FIXNUMP (0, insval, ZV - PT)) wrong_type_argument (intern ("inserted-chars"), insval); inserted = XFASTINT (insval); } @@ -4512,8 +4512,8 @@ by calling `format-decode', which see. */) TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); insval = call3 (Qformat_decode, - Qnil, make_number (oinserted), visit); - if (! RANGED_INTEGERP (0, insval, ZV - PT)) + Qnil, make_fixnum (oinserted), visit); + if (! RANGED_FIXNUMP (0, insval, ZV - PT)) wrong_type_argument (intern ("inserted-chars"), insval); if (ochars_modiff == CHARS_MODIFF) /* format_decode didn't modify buffer's characters => move @@ -4533,10 +4533,10 @@ by calling `format-decode', which see. */) { if (NILP (replace)) { - insval = call1 (XCAR (p), make_number (inserted)); + insval = call1 (XCAR (p), make_fixnum (inserted)); if (!NILP (insval)) { - if (! RANGED_INTEGERP (0, insval, ZV - PT)) + if (! RANGED_FIXNUMP (0, insval, ZV - PT)) wrong_type_argument (intern ("inserted-chars"), insval); inserted = XFASTINT (insval); } @@ -4551,10 +4551,10 @@ by calling `format-decode', which see. */) EMACS_INT ochars_modiff = CHARS_MODIFF; TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); - insval = call1 (XCAR (p), make_number (oinserted)); + insval = call1 (XCAR (p), make_fixnum (oinserted)); if (!NILP (insval)) { - if (! RANGED_INTEGERP (0, insval, ZV - PT)) + if (! RANGED_FIXNUMP (0, insval, ZV - PT)) wrong_type_argument (intern ("inserted-chars"), insval); if (ochars_modiff == CHARS_MODIFF) /* after_insert_file_functions didn't modify @@ -4582,10 +4582,10 @@ by calling `format-decode', which see. */) /* Adjust the last undo record for the size change during the format conversion. */ Lisp_Object tem = XCAR (old_undo); - if (CONSP (tem) && INTEGERP (XCAR (tem)) - && INTEGERP (XCDR (tem)) + if (CONSP (tem) && FIXNUMP (XCAR (tem)) + && FIXNUMP (XCDR (tem)) && XFASTINT (XCDR (tem)) == PT + old_inserted) - XSETCDR (tem, make_number (PT + inserted)); + XSETCDR (tem, make_fixnum (PT + inserted)); } } else @@ -4620,7 +4620,7 @@ by calling `format-decode', which see. */) /* Retval needs to be dealt with in all cases consistently. */ if (NILP (val)) - val = list2 (orig_filename, make_number (inserted)); + val = list2 (orig_filename, make_fixnum (inserted)); return unbind_to (count, val); } @@ -4923,7 +4923,7 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, fn = SSDATA (encoded_filename); open_flags = O_WRONLY | O_CREAT; open_flags |= EQ (mustbenew, Qexcl) ? O_EXCL : !NILP (append) ? 0 : O_TRUNC; - if (NUMBERP (append)) + if (FIXED_OR_FLOATP (append)) offset = file_offset (append); else if (!NILP (append)) open_flags |= O_APPEND; @@ -4948,7 +4948,7 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, record_unwind_protect_int (close_file_unwind, desc); } - if (NUMBERP (append)) + if (FIXED_OR_FLOATP (append)) { off_t ret = lseek (desc, offset, SEEK_SET); if (ret < 0) @@ -5131,7 +5131,7 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, } if (!auto_saving && !noninteractive) - message_with_string ((NUMBERP (append) + message_with_string ((FIXED_OR_FLOATP (append) ? "Updated %s" : ! NILP (append) ? "Added to %s" @@ -5216,7 +5216,7 @@ build_annotations (Lisp_Object start, Lisp_Object end) has written annotations to a temporary buffer, which is now current. */ res = call5 (Qformat_annotate_function, XCAR (p), start, end, - original_buffer, make_number (i)); + original_buffer, make_fixnum (i)); if (current_buffer != given_buffer) { XSETFASTINT (start, BEGV); @@ -5255,7 +5255,7 @@ a_write (int desc, Lisp_Object string, ptrdiff_t pos, { tem = Fcar_safe (Fcar (*annot)); nextpos = pos - 1; - if (INTEGERP (tem)) + if (FIXNUMP (tem)) nextpos = XFASTINT (tem); /* If there are no more annotations in this range, @@ -5437,7 +5437,7 @@ See Info node `(elisp)Modification Time' for more details. */) { int ns = current_buffer->modtime.tv_nsec; if (ns < 0) - return make_number (UNKNOWN_MODTIME_NSECS - ns); + return make_fixnum (UNKNOWN_MODTIME_NSECS - ns); return make_lisp_time (current_buffer->modtime); } @@ -5455,7 +5455,7 @@ An argument specifies the modification time value to use if (!NILP (time_flag)) { struct timespec mtime; - if (INTEGERP (time_flag)) + if (FIXNUMP (time_flag)) { CHECK_RANGED_INTEGER (time_flag, -1, 0); mtime = make_timespec (0, UNKNOWN_MODTIME_NSECS - XINT (time_flag)); @@ -5524,7 +5524,7 @@ auto_save_1 (void) /* But make sure we can overwrite it later! */ auto_save_mode_bits = (st.st_mode | 0600) & 0777; else if (modes = Ffile_modes (BVAR (current_buffer, filename)), - INTEGERP (modes)) + FIXNUMP (modes)) /* Remote files don't cooperate with stat. */ auto_save_mode_bits = (XINT (modes) | 0600) & 0777; } @@ -5725,7 +5725,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) /* Turn off auto-saving until there's a real save, and prevent any more warnings. */ XSETINT (BVAR (b, save_length), -1); - Fsleep_for (make_number (1), Qnil); + Fsleep_for (make_fixnum (1), Qnil); continue; } if (!auto_saved && NILP (no_message)) @@ -5754,7 +5754,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) { /* If we are going to restore an old message, give time to read ours. */ - sit_for (make_number (1), 0, 0); + sit_for (make_fixnum (1), 0, 0); restore_message (); } else if (!auto_save_error_occurred) |