diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2017-01-25 21:13:19 -0800 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-01-25 21:25:37 -0800 |
| commit | b3a3ed526d2c490c9c5605707f0cd7bff3c88693 (patch) | |
| tree | 096de6603250aafcab11c31876d39faecf1b2db4 /src/fileio.c | |
| parent | 1392ec7420ee23238a1588b759c631d87a677483 (diff) | |
| download | emacs-b3a3ed526d2c490c9c5605707f0cd7bff3c88693.tar.gz | |
Replace QUIT with maybe_quit
There’s no longer need to have QUIT stand for a slug of C statements.
Use the more-obvious function-call syntax instead.
Also, use true and false when setting immediate_quit.
These changes should not affect the generated machine code.
* src/lisp.h (QUIT): Remove. All uses replaced by maybe_quit.
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/fileio.c b/src/fileio.c index 8c8cba9e49c..ac6d7819411 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -316,7 +316,7 @@ use the standard functions without calling themselves recursively. */) } } - QUIT; + maybe_quit (); } return result; } @@ -1960,9 +1960,9 @@ permissions. */) report_file_error ("Copying permissions to", newname); } #else /* not WINDOWSNT */ - immediate_quit = 1; + immediate_quit = true; ifd = emacs_open (SSDATA (encoded_file), O_RDONLY, 0); - immediate_quit = 0; + immediate_quit = false; if (ifd < 0) report_file_error ("Opening input file", file); @@ -2024,8 +2024,8 @@ permissions. */) oldsize = out_st.st_size; } - immediate_quit = 1; - QUIT; + immediate_quit = true; + maybe_quit (); if (clone_file (ofd, ifd)) newsize = st.st_size; @@ -2047,7 +2047,7 @@ permissions. */) if (newsize < oldsize && ftruncate (ofd, newsize) != 0) report_file_error ("Truncating output file", newname); - immediate_quit = 0; + immediate_quit = false; #ifndef MSDOS /* Preserve the original file permissions, and if requested, also its @@ -3393,13 +3393,13 @@ read_non_regular (Lisp_Object state) { int nbytes; - immediate_quit = 1; - QUIT; + immediate_quit = true; + maybe_quit (); nbytes = emacs_read (XSAVE_INTEGER (state, 0), ((char *) BEG_ADDR + PT_BYTE - BEG_BYTE + XSAVE_INTEGER (state, 1)), XSAVE_INTEGER (state, 2)); - immediate_quit = 0; + immediate_quit = false; /* Fast recycle this object for the likely next call. */ free_misc (state); return make_number (nbytes); @@ -3858,8 +3858,8 @@ by calling `format-decode', which see. */) report_file_error ("Setting file position", orig_filename); } - immediate_quit = 1; - QUIT; + immediate_quit = true; + maybe_quit (); /* Count how many chars at the start of the file match the text at the beginning of the buffer. */ while (1) @@ -3910,7 +3910,7 @@ by calling `format-decode', which see. */) goto handled; } immediate_quit = true; - QUIT; + maybe_quit (); /* Count how many chars at the end of the file match the text at the end of the buffer. But, if we have already found that decoding is necessary, don't waste time. */ @@ -3967,7 +3967,7 @@ by calling `format-decode', which see. */) if (nread == 0) break; } - immediate_quit = 0; + immediate_quit = false; if (! giveup_match_end) { @@ -4065,11 +4065,11 @@ by calling `format-decode', which see. */) quitting while reading a huge file. */ /* Allow quitting out of the actual I/O. */ - immediate_quit = 1; - QUIT; + immediate_quit = true; + maybe_quit (); this = emacs_read (fd, read_buf + unprocessed, READ_BUF_SIZE - unprocessed); - immediate_quit = 0; + immediate_quit = false; if (this <= 0) break; @@ -4284,13 +4284,13 @@ by calling `format-decode', which see. */) /* Allow quitting out of the actual I/O. We don't make text part of the buffer until all the reading is done, so a C-g here doesn't do any harm. */ - immediate_quit = 1; - QUIT; + immediate_quit = true; + maybe_quit (); this = emacs_read (fd, ((char *) BEG_ADDR + PT_BYTE - BEG_BYTE + inserted), trytry); - immediate_quit = 0; + immediate_quit = false; } if (this <= 0) @@ -4602,7 +4602,7 @@ by calling `format-decode', which see. */) } } - QUIT; + maybe_quit (); p = XCDR (p); } @@ -4992,7 +4992,7 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, } } - immediate_quit = 1; + immediate_quit = true; if (STRINGP (start)) ok = a_write (desc, start, 0, SCHARS (start), &annotations, &coding); @@ -5016,7 +5016,7 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, save_errno = errno; } - immediate_quit = 0; + immediate_quit = false; /* fsync is not crucial for temporary files. Nor for auto-save files, since they might lose some work anyway. */ |
