diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-02 10:10:35 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-02 10:10:35 -0700 |
commit | 1882aa387874f0ac0965fa7bec1c5760dc37e48f (patch) | |
tree | 27cfcfb9f16c55a0bf84a5c91a5efd20f495ef55 /src/emacs.c | |
parent | a411ac43d3667d042fa36361275eccbe9aca80af (diff) | |
download | emacs-1882aa387874f0ac0965fa7bec1c5760dc37e48f.tar.gz emacs-1882aa387874f0ac0965fa7bec1c5760dc37e48f.tar.bz2 emacs-1882aa387874f0ac0965fa7bec1c5760dc37e48f.zip |
* emacs.c, eval.c: Use bool for boolean.
* emacs.c (initialized, inhibit_window_system, running_asynch_code):
(malloc_using_checking) [DOUG_LEA_MALLOC]:
(display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
(noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
(main, decode_env_path, Fdaemon_initialized):
* eval.c (call_debugger, Finteractive_p, interactive_p):
(unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
(maybe_call_debugger, Fbacktrace):
* process.c (read_process_output, exec_sentinel):
Use bool for booleans.
* emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
All callers changed.
* eval.c (interactive_p): Omit always-true boolean argument
EXCLUDE_SUBRS_P. All callers changed.
* dispextern.h, lisp.h: Reflect above API changes.
* firstfile.c (dummy): Use the address of 'main', whose signature
won't change, instead of the address of 'initialize', whose
signature just changed from int to bool.
* lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
* msdos.c (fatal_error_in_progress): ... from here.
* xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
of incrementing it.
(redisplay_internal, unwind_redisplay): Simply clear
REDISPLAYING_P when unwinding, instead of saving its previous,
always-false value and then restoring it.
Diffstat (limited to 'src/emacs.c')
-rw-r--r-- | src/emacs.c | 63 |
1 files changed, 26 insertions, 37 deletions
diff --git a/src/emacs.c b/src/emacs.c index adfff6ff3ed..dac5edd544f 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -95,10 +95,10 @@ static const char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundati /* Empty lisp strings. To avoid having to build any others. */ Lisp_Object empty_unibyte_string, empty_multibyte_string; -/* Set nonzero after Emacs has started up the first time. - Prevents reinitialization of the Lisp world and keymaps - on subsequent starts. */ -int initialized; +/* Set after Emacs has started up the first time. + Prevents reinitialization of the Lisp world and keymaps + on subsequent starts. */ +bool initialized; #ifdef DARWIN_OS extern void unexec_init_emacs_zone (void); @@ -112,9 +112,9 @@ static void *malloc_state_ptr; extern void *malloc_get_state (void); /* From glibc, a routine that overwrites the malloc internal state. */ extern int malloc_set_state (void*); -/* Non-zero if the MALLOC_CHECK_ environment variable was set while +/* True if the MALLOC_CHECK_ environment variable was set while dumping. Used to work around a bug in glibc's malloc. */ -static int malloc_using_checking; +static bool malloc_using_checking; #endif Lisp_Object Qfile_name_handler_alist; @@ -123,17 +123,17 @@ Lisp_Object Qrisky_local_variable; Lisp_Object Qkill_emacs; -/* If non-zero, Emacs should not attempt to use a window-specific code, +/* If true, Emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ -int inhibit_window_system; +bool inhibit_window_system; -/* If non-zero, a filter or a sentinel is running. Tested to save the match +/* If true, a filter or a sentinel is running. Tested to save the match data on the first attempt to change it inside asynchronous code. */ -int running_asynch_code; +bool running_asynch_code; #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) -/* If non-zero, -d was specified, meaning we're using some window system. */ -int display_arg; +/* If true, -d was specified, meaning we're using some window system. */ +bool display_arg; #endif /* An address near the bottom of the stack. @@ -150,11 +150,11 @@ static void *my_heap_start; static uprintmax_t heap_bss_diff; #endif -/* Nonzero means running Emacs without interactive terminal. */ -int noninteractive; +/* True means running Emacs without interactive terminal. */ +bool noninteractive; -/* Nonzero means remove site-lisp directories from load-path. */ -int no_site_lisp; +/* True means remove site-lisp directories from load-path. */ +bool no_site_lisp; /* Name for the server started by the daemon.*/ static char *daemon_name; @@ -272,8 +272,8 @@ section of the Emacs manual or the file BUGS.\n" /* Signal code for the fatal signal that was received. */ static int fatal_error_code; -/* Nonzero if handling a fatal error already. */ -int fatal_error_in_progress; +/* True if handling a fatal error already. */ +bool fatal_error_in_progress; #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD /* When compiled with GTK and running under Gnome, @@ -311,7 +311,7 @@ fatal_error_signal (int sig) if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) Fkill_emacs (make_number (sig)); - shut_down_emacs (sig, 0, Qnil); + shut_down_emacs (sig, Qnil); } /* Signal the same code; this time it will really be fatal. @@ -568,7 +568,7 @@ DEFINE_DUMMY_FUNCTION (__main) Too bad we can't just use getopt for all of this, but we don't have enough information to do it right. */ -static int +static bool argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr) { @@ -675,12 +675,12 @@ main (int argc, char **argv) Lisp_Object dummy; #endif char stack_bottom_variable; - int do_initial_setlocale; + bool do_initial_setlocale; int skip_args = 0; #ifdef HAVE_SETRLIMIT struct rlimit rlim; #endif - int no_loadup = 0; + bool no_loadup = 0; char *junk = 0; char *dname_arg = 0; #ifdef NS_IMPL_COCOA @@ -1955,7 +1955,7 @@ all of which are called before Emacs is actually killed. */) x_clipboard_manager_save_all (); #endif - shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); + shut_down_emacs (0, STRINGP (arg) ? arg : Qnil); #ifdef HAVE_NS ns_release_autorelease_pool (ns_pool); @@ -1991,7 +1991,7 @@ all of which are called before Emacs is actually killed. */) and Fkill_emacs. */ void -shut_down_emacs (int sig, int no_x, Lisp_Object stuff) +shut_down_emacs (int sig, Lisp_Object stuff) { /* Prevent running of hooks from now on. */ Vrun_hooks = Qnil; @@ -2026,17 +2026,6 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff) unlock_all_files (); #endif -#if 0 /* This triggers a bug in XCloseDisplay and is not needed. */ -#ifdef HAVE_X_WINDOWS - /* It's not safe to call intern here. Maybe we are crashing. */ - if (!noninteractive && SYMBOLP (Vinitial_window_system) - && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1 - && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x' - && ! no_x) - Fx_close_current_connection (); -#endif /* HAVE_X_WINDOWS */ -#endif - #ifdef SIGIO /* There is a tendency for a SIGIO signal to arrive within exit, and cause a SIGHUP because the input descriptor is already closed. */ @@ -2228,7 +2217,7 @@ decode_env_path (const char *evarname, const char *defalt) const char *path, *p; Lisp_Object lpath, element, tem; #ifdef WINDOWSNT - int defaulted = 0; + bool defaulted = 0; const char *emacs_dir = egetenv ("emacs_dir"); static const char *emacs_dir_env = "%emacs_dir%/"; const size_t emacs_dir_len = strlen (emacs_dir_env); @@ -2324,7 +2313,7 @@ from the parent process and its tty file descriptors. */) (void) { int nfd; - int err = 0; + bool err = 0; if (!IS_DAEMON) error ("This function can only be called if emacs is run as a daemon"); |