1. 23 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify and avoid signal-handling races. · 4d7e6e51
      Paul Eggert authored
      * nt/inc/ms-w32.h (emacs_raise): New macro.
      * src/alloc.c (die):
      * src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
      Avoid recursive loop if there's a fatal error in the function itself.
      * src/atimer.c (pending_atimers):
      * src/blockinput.h: Don't include "atimer.h"; no longer needed.
      (interrupt_input_pending): Remove.  All uses removed.
      pending_signals now counts both atimers and ordinary interrupts.
      This is less racy than having three separate pending-signal flags.
      (block_input, unblock_input, totally_unblock_input, unblock_input_to)
      (input_blocked_p):
      Rename from their upper-case counterparts BLOCK_INPUT,
      UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
      INPUT_BLOCKED_P, and turn into functions.  All uses changed.
      This makes it easier to access volatile variables more accurately.
      (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
      (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
      that's more reliable if the code is buggy and sets
      interrupt_input_blocked to a negative value.  All uses changed.
      * src/atimer.c (deliver_alarm_signal):
      Remove.  No need to deliver this to the parent; any thread can
      handle this signal now.  All uses replaced by underlying handler.
      * src/atimer.c (turn_on_atimers):
      * src/dispnew.c (handle_window_change_signal):
      * src/emacs.c (handle_danger_signal):
      * src/keyboard.c (kbd_buffer_get_event):
      Don't reestablish signal handler; not needed with sigaction.
      * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
      (UNBLOCK_INPUT_TO):
      Rework to avoid unnecessary accesses to volatile variables.
      (UNBLOCK_INPUT_TO): Now a function.
      (totally_unblock_input, unblock_input): New decls.
      * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
      (init_data): Remove.  Necessary stuff now done in init_signal.
      * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
      * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
      (fatal_error_code): Remove; no longer needed.
      (terminate_due_to_signal): Rename from fatal_error_backtrace, since
      it doesn't always backtrace.  All uses changed.  No need to reset
      signal to default, since sigaction and/or die does that for us now.
      Use emacs_raise (FOO), not kill (getpid (), FOO).
      (main): Check more-accurately whether we're dumping.
      Move fatal-error setup to sysdep.c
      * src/floatfns.c: Do not include "syssignal.h"; no longer needed.
      * src/gtkutil.c (xg_get_file_name, xg_get_font):
      Remove no-longer-needed signal-mask manipulation.
      * src/keyboard.c, src/process.c (POLL_FOR_INPUT):
      Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
      * src/keyboard.c (read_avail_input): Remove.
      All uses replaced by gobble_input.
      (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
      (kbd_buffer_store_event_hold, gobble_input):
      (record_asynch_buffer_change) [USABLE_SIGIO]:
      (store_user_signal_events):
      No need to mess with signal mask.
      (gobble_input): If blocking input and there are terminals, simply
      set pending_signals to 1 and return.  All hooks changed to not
      worry about whether input is blocked.
      (process_pending_signals): Clear pending_signals before processing
      them, in case a signal comes in while we're processing.
      By convention callers now test pending_signals before calling us.
      (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
      New functions, to support changes to blockinput.h.
      (handle_input_available_signal): Now extern.
      (reinvoke_input_signal): Remove.  All uses replaced by
      handle_async_input.
      (quit_count): Now volatile, since a signal handler uses it.
      (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.  All
      callers changed.  Block SIGINT only if not already blocked.
      Clear sigmask reliably, even if Fsignal returns, which it can.
      Omit unnecessary accesses to volatile var.
      (quit_throw_to_read_char): No need to restore sigmask.
      * src/keyboard.c (gobble_input, handle_user_signal):
      * src/process.c (wait_reading_process_output):
      Call signal-handling code rather than killing ourselves.
      * src/lisp.h: Include <float.h>, for...
      (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
      (pending_signals): Now volatile.
      (syms_of_data): Now const if IEEE floating point.
      (handle_input_available_signal) [USABLE_SIGIO]:
      (terminate_due_to_signal, record_child_status_change): New decls.
      * src/process.c (create_process): Avoid disaster if memory is exhausted
      while we're processing a vfork, by tightening the critical section
      around the vfork.
      (send_process_frame, process_sent_to, handle_pipe_signal)
      (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
      ignores SIGPIPE.
      (send_process): No need for setjmp/longjmp any more, since the
      SIGPIPE stuff is now gone.  Instead, report an error if errno
      is EPIPE.
      (record_child_status_change): Now extern.  PID and W are now args.
      Return void, not bool.  All callers changed.
      * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
      Remove.  All uses removed.  This bug should be fixed now in a
      different way.
      (wait_for_termination_1): Use waitpid rather than sigsuspend,
      and record the child status change directly.  This avoids the
      need to futz with the signal mask.
      (process_fatal_action): Move here from emacs.c.
      (emacs_sigaction_flags): New function, containing
      much of what used to be in emacs_sigaction_init.
      (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
      caught by emacs, to make races less likely.
      (deliver_process_signal): Rename from handle_on_main_thread.
      All uses changed.
      (BACKTRACE_LIMIT_MAX): Now at top level.
      (thread_backtrace_buffer, threadback_backtrace_pointers):
      New static vars.
      (deliver_thread_signal, deliver_fatal_thread_signal):
      New functions, for more-accurate delivery of thread-specific signals.
      (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
      (deliver_arith_signal): Handle in this thread, not
      in the main thread, since it's triggered by this thread.
      (maybe_fatal_sig): New function.
      (init_signals): New arg DUMPING so that we can be more accurate
      about whether we're dumping.  Caller changed.
      Treat thread-specific signals differently from process-general signals.
      Block all signals while handling fatal error; that's safer.
      xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
      on IEEE hosts.
      When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
      Ignore SIGPIPE unless batch.
      (emacs_backtrace): Output backtrace for the appropriate thread,
      which is not necessarily the main thread.
      * src/syssignal.h: Include <stdbool.h>.
      (emacs_raise): New macro.
      * src/xterm.c (x_connection_signal): Remove; no longer needed
      now that we use sigaction.
      (x_connection_closed): No need to mess with sigmask now.
      (x_initialize): No need to reset SIGPIPE handler here, since
      init_signals does this for us now.
      
      Fixes: debbugs:12471
      4d7e6e51
  2. 17 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Remove no-longer-needed Solaris 2.4 vfork bug workaround. · eeceac93
      Paul Eggert authored
      The workaround was for improving performance on Solaris 2.4, but
      is getting in the way now.  Emacs will still work if someone is
      still running Solaris 2.4 in a museum somewhere; Sun dropped
      support for Solaris 2.4 in 2003.
      * configure.ac (ac_cv_func_vfork_works): Default to 'no' on
      Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works.
      * src/callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
      * src/process.c (create_process) [HAVE_WORKING_VFORK]:
      Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
      since Emacs no longer uses vfork on that platform.
      eeceac93
  3. 16 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Remove configure's --without-sync-input option. · 0caaedb1
      Paul Eggert authored
      When auditing signal-handling in preparation for cleaning it up,
      I found that SYNC_INPUT has race conditions and would be a real
      pain to fix.  Since it's an undocumented and deprecated
      configure-time option, now seems like a good time to remove it.
      Also see <http://bugs.gnu.org/11080#16>.
      * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove.
      * admin/CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove.
      * etc/TODO (Make SYNC_INPUT the default): Remove, as the code now
      behaves as if SYNC_INPUT is always true.
      * src/alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
      (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
      (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
      (malloc_hysteresis):
      (check_depth) [XMALLOC_OVERRUN_CHECK]:
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
      (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
      (dont_register_blocks, bytes_used_when_reconsidered)
      (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
      (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
      [!SYSTEM_MALLOC && !SYNC_INPUT]:
      Remove. All uses removed.
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
      implementation, one that depends on whether the new macro
      XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
      is defined.
      * src/atimer.c (run_timers, handle_alarm_signal):
      * src/keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
      (handle_async_input, process_pending_signals)
      (handle_input_available_signal, init_keyboard):
      * src/nsterm.m (ns_read_socket):
      * src/process.c (wait_reading_process_output):
      * src/regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
      * src/sysdep.c (emacs_sigaction_init) [SA_RESTART]:
      (emacs_write):
      * src/xterm.c (XTread_socket):
      Assume SYNC_INPUT.
      * src/conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
      * src/eval.c (handling_signal): Remove.  All uses removed.
      * src/lisp.h (ELSE_PENDING_SIGNALS): Remove.
      All uses replaced with the SYNC_INPUT version.
      (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
      Remove decls.
      * src/sysdep.c, src/syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Now static.
      
      Fixes: debbugs:12450
      0caaedb1
  4. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  5. 13 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify SIGIO usage. · 4a4bbad2
      Paul Eggert authored
      The code that dealt with SIGIO was crufty and confusing, e.g., it
      played tricks like "#undef SIGIO" but these tricks were not used
      consistently.  Simplify mostly by not #undeffing standard symbols,
      e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
      or not as we please) rather than "defined SIGIO" (standard symbol
      that we probably shouldn't #undef).
      * configure.ac (NO_TERMIO, BROKEN_FIONREAD, BROKEN_SIGAIO)
      (BROKEN_SIGPOLL, BROKEN_SIGPTY): Remove.
      (USABLE_FIONREAD, USABLE_SIGIO): New symbols.  All uses of
      'defined SIGIO' replaced with 'defined USABLE_SIGIO', with no need
      to #undef SIGIO now (which was error-prone).  Likewise, all uses
      of 'defined FIONREAD' replaced with 'defined USABLE_FIONREAD'.
      * src/admin/CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL)
      (BROKEN_SIGPTY, NO_TERMIO): Remove.
      * src/conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
      Modules that need it can include it.
      [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
      * src/dispextern.h (ignore_sigio): New decl.
      * src/emacs.c (shut_down_emacs): Invoke unrequest_sigio
      unconditionally, since it's now a no-op if !USABLE_SIGIO.
      * src/emacs.c (shut_down_emacs):
      * src/keyboard.c (kbd_buffer_store_event_hold):
      Use ignore_sigio rather than invoking 'signal' directly.
      * src/keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
      for FIONREAD.
      (FIONREAD, SIGIO): Do not #undef.
      (tty_read_avail_input): Use #error rather than a syntax error.
      * src/process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
      for I_PIPE, used by SETUP_SLAVE_PTY.
      (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
      * src/sysdep.c (croak): Remove; no longer needed.  This bit of
      temporary code, with Fred N. Fish's comment that it's temporary,
      has been in Emacs since at least 1992!
      (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
      Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
      * src/syssignal.h (croak): Remove decl.
      (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
      * src/systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
      now that we're termios-only.
      (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
      * src/term.c (dissociate_if_controlling_tty): Use #error rather than
      a run-time error.
      
      Fixes: debbugs:12408
      4a4bbad2
  6. 11 Sep, 2012 2 commits
    • Paul Eggert's avatar
      Prefer assignment to memcpy when either will do. · ae1d87e2
      Paul Eggert authored
      * lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]:
      * src/bidi.c (bidi_push_it, bidi_pop_it):
      * src/fns.c (copy_hash_table):
      * src/image.c (define_image_type):
      * src/keyboard.c (kbd_buffer_store_event_hold):
      * src/process.c (Fprocess_send_eof):
      * src/xfaces.c (x_create_gc) [HAVE_NS]:
      * src/xgselect.c (xg_select):
      Use assignment, not memcpy, as either will do here, and assignment is
      more likely to catch type errors.
      ae1d87e2
    • Dmitry Antipov's avatar
      Convenient macro to check whether the buffer is live. · e578f381
      Dmitry Antipov authored
      * buffer.h (BUFFER_LIVE_P): New macro.
      * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
      * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
      e578f381
  7. 07 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Signal-handler cleanup. · 2fe28299
      Paul Eggert authored
      Emacs's signal handlers were written in the old 4.2BSD style with
      sigblock and sigmask and so forth, and this led to some
      inefficiencies and confusion.  Rewrite these to use
      pthread_sigmask etc. without copying signal sets around.  Also,
      get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
      'signal', and instead use functions that do not attempt to take
      over the system name space.  This patch causes Emacs's text
      segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
      * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
      Adjust to syssignal.h changes.
      (SIGNAL_H_AB): Remove; no longer needed.
      * src/alloc.c, src/emacsgtkfixed.c, src/nsfns.m, src/widget.c, src/xmenu.c:
      Do not include <signal.h> or "syssignal.h", as these
      modules do not use signals.
      * src/atimer.c, src/callproc.c, src/data.c, src/dispnew.c, src/emacs.c:
      * src/floatfns.c, src/gtkutil.c, src/keyboard.c, src/process.c, src/sound.c:
      * src/sysdep.c, src/term.c, src/xterm.c:
      Do not include <signal.h>, as "syssignal.h" does that for us now.
      * src/atimer.c (sigmask_atimers): New function.
      (block_atimers, unblock_atimers): New functions,
      replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
      All uses replaced.
      * src/conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
      no longer needed here.
      * src/emacs.c (main): Inspect existing signal handler with sigaction,
      so that there's	no need to block and unblock SIGHUP.
      * src/sysdep.c (struct save_signal): New member 'action', replacing
      old member 'handler'.
      (save_signal_handlers, restore_signal_handlers):
      Use sigaction instead of 'signal' to save and restore.
      (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
      New function.  All users of 'signal' modified to use set_sighandler
      if they're writeonly, and to use sys_signal if they're read+write.
      (emacs_sigaction_init, forwarded_signal): New functions.
      (sys_signal): Remove.  All uses replaced by calls to sigaction
      and emacs_sigaction_init, or by direct calls to 'signal'.
      (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
      (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
      all uses replaced by pthread_sigmask etc. calls.
      * src/syssignal.h: Include <signal.h>.
      (emacs_sigaction_init, forwarded_signal): New decls.
      (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
      (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
      (sigmask, sys_sigmask): Remove; no longer needed.
      (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
      (sigblock, sigunblock, sigfree):
      (sigsetmask) [!defined sigsetmask]:
      Remove.  All uses replaced by pthread_sigmask.
      (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
      no longer need to be replaced, and its typical old uses
      are now done via emacs_sigaction_init and sigaction.
      (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
      (sys_sigdel): Remove; unused.
      (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
      
      Fixes: debbugs:12327
      2fe28299
  8. 06 Sep, 2012 1 commit
  9. 05 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Fix race conditions with signal handlers and errno. · 20ef56db
      Paul Eggert authored
      Be more systematic about preserving errno whenever a signal
      handler returns, even if it's not in the main thread.  Do this by
      renaming signal handlers to distinguish between signal delivery
      and signal handling.  All uses changed.
      * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
      * data.c (deliver_arith_signal): Rename from arith_error.
      * dispnew.c (deliver_window_change_signal): Rename from
      window_change_signal.
      * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
      (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
      * keyboard.c (deliver_input_available_signal): Rename from
      input_available_signal.
      (deliver_user_signal): Rename from handle_user_signal.
      (deliver_interrupt_signal): Rename from interrupt_signal.
      * process.c (deliver_pipe_signal): Rename from send_process_trap.
      (deliver_child_signal): Rename from sigchld_handler.
      * atimer.c (handle_alarm_signal):
      * data.c (handle_arith_signal):
      * dispnew.c (handle_window_change_signal):
      * emacs.c (handle_fatal_signal, handle_danger_signal):
      * keyboard.c (handle_input_available_signal):
      * keyboard.c (handle_user_signal, handle_interrupt_signal):
      * process.c (handle_pipe_signal, handle_child_signal):
      New functions, with the actual signal-handling code taken from the
      original respective signal handlers, sans the sporadic attempts to
      preserve errno, since that's now done by handle_on_main_thread.
      * atimer.c (alarm_signal_handler): Remove unnecessary decl.
      * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
      * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Move to sysdep.c.
      (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Move initialization of main_thread to sysdep.c's init_signals.
      * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
      our usage, and simplifies the mainline code.
      (record_child_status_change): New static function, as a helper
      for handle_child_signal, and with most of the old child handler's
      contents.
      (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
      (handle_child_signal): Use the above.
      * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Moved here from emacs.c.
      (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
      code moved here from emacs.c's main function.
      * sysdep.c, syssignal.h (handle_on_main_thread): New function,
      replacing the old SIGNAL_THREAD_CHECK.  All uses changed.  This
      lets callers save and restore errno properly.
      20ef56db
  10. 04 Sep, 2012 2 commits
    • Paul Eggert's avatar
      Simplify redefinition of 'abort' (Bug#12316). · 1088b922
      Paul Eggert authored
      Do not try to redefine the 'abort' function.  Instead, redo
      the code so that it calls 'emacs_abort' rather than 'abort'.
      This removes the need for the NO_ABORT configure-time macro
      and makes it easier to change the abort code to do a backtrace.
      * configure.ac (NO_ABRT): Remove.
      * admin/CPP-DEFINES (NO_ABORT): Remove.
      * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
      * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
      * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
      Remove; sysdep.c's emacs_abort now takes its place.
      * src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
      'abort' changed to use 'emacs_abort'.
      * src/msdos.c (dos_abort) [defined abort]: Remove; not used.
      (abort) [!defined abort]: Rename to ...
      (emacs_abort): ... new name.
      * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
      the place of the old 'abort' in emacs.c.
      * src/w32.c, src/w32fns.c (abort): Do not #undef.
      * src/w32.c (emacs_abort): Rename from w32_abort.
      1088b922
    • Paul Eggert's avatar
      Be more systematic about _setjmp vs setjmp. · af26b72c
      Paul Eggert authored
      * alloc.c (test_setjmp, mark_stack):
      * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
      (png_load, my_error_exit, jpeg_load):
      * process.c (send_process_trap, send_process):
      Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
      The underscored versions are up to 30x faster on some hosts.
      Formerly, the code used setjmp+longjmp sometimes and
      _setjmp+_longjmp at other times, with no particular reason to
      prefer setjmp+longjmp.
      af26b72c
  11. 02 Sep, 2012 2 commits
    • Paul Eggert's avatar
      * emacs.c, eval.c: Use bool for boolean. · 1882aa38
      Paul Eggert authored
      * 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.
      1882aa38
    • Paul Eggert's avatar
      Clean up some extern decls. · a411ac43
      Paul Eggert authored
      Mostly, this hoists extern decls out of .c files and into .h files.
      That way, we're more likely to catch errors if the interfaces change.
      * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
      declare xg_mark_data.
      * dispextern.h (x_frame_parm_handlers):
      * font.h (Qxft):
      * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
      (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
      (Qultra_bold, Qoblique, Qitalic):
      Move extern decl here from .c file.
      * alloc.c (xg_mark_data) [USE_GTK]:
      * doc.c (Qclosure):
      * eval.c (Qlexical_binding):
      * fns.c (time) [!HAVE_UNISTD_H]:
      * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
      (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
      * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
      * lread.c (Qinternal_interpreter_environment):
      * minibuf.c (Qbuffer):
      * process.c (QCfamily, QCfilter):
      * widget.c (free_frame_faces):
      * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
      * xfont.c (x_clear_errors):
      * xterm.c (x_frame_parm_handlers):
      Remove now-redundant extern decls.
      * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
      * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
      Now static.
      * xfaces.c: Remove unnecessary static decls.
      * xterm.c (updating_frame): Remove decl of nonexistent object.
      a411ac43
  12. 01 Sep, 2012 1 commit
    • Daniel Colascione's avatar
      Refactor window-system configuration · 17a2cbbd
      Daniel Colascione authored
      This change streamlines the window system selection code in
      configure.in and moves many common function declarations from
      window-specific headers to frame.h.  It introduces a new TERM_HEADER
      macro in config.h: we set this macro to the right header to use for
      the window system for which we're compiling Emacs and have source
      files include it indirectly.  This way, we don't have to teach every
      file about every window system.
      17a2cbbd
  13. 28 Aug, 2012 1 commit
  14. 27 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans. · de1339b0
      Paul Eggert authored
      * composite.c (find_composition, composition_gstring_p)
      (composition_reseat_it, find_automatic_composition):
      * data.c (let_shadows_buffer_binding_p)
      (let_shadows_global_binding_p, set_internal, make_blv)
      (Fmake_variable_buffer_local, Fmake_local_variable)
      (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
      (cons_to_signed, arith_driver):
      * dbusbind.c (xd_in_read_queued_messages):
      * dired.c (directory_files_internal, file_name_completion):
      Use bool for booleans.
      * dired.c (file_name_completion):
      * process.h (fd_callback):
      Omit int (actually boolean) argument.  It wasn't being used.
      All uses changed.
      * composite.h, lisp.h: Reflect above API changes.
      de1339b0
  15. 19 Aug, 2012 1 commit
    • Paul Eggert's avatar
      Rely on <unistd.h> to declare 'environ', · b69a6d22
      Paul Eggert authored
      as gnulib does this if the system doesn't.
      * lib-src/emacsclient.c (environ): Remove decl.
      * src/callproc.c, src/editfns.c, src/process.c (environ) [!USE_CRT_DLL]:
      * src/emacs.c (environ) [DOUG_LEA_MALLOC]:
      * src/vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
      * src/vm-limit.c: Include <unistd.h>, for 'environ'.
      b69a6d22
  16. 18 Aug, 2012 2 commits
    • Paul Eggert's avatar
      * buffer.h (BSET): Remove. · 39eb03f1
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      (bset_bidi_paragraph_direction, bset_case_canon_table)
      (bset_case_eqv_table, bset_directory, bset_display_count)
      (bset_display_time, bset_downcase_table)
      (bset_enable_multibyte_characters, bset_filename, bset_keymap)
      (bset_last_selected_window, bset_local_var_alist)
      (bset_mark_active, bset_point_before_scroll, bset_read_only)
      (bset_truncate_lines, bset_undo_list, bset_upcase_table)
      (bset_width_table):
      * buffer.c (bset_abbrev_mode, bset_abbrev_table)
      (bset_auto_fill_function, bset_auto_save_file_format)
      (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
      (bset_bidi_display_reordering, bset_buffer_file_coding_system)
      (bset_cache_long_line_scans, bset_case_fold_search)
      (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
      (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
      (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
      (bset_fringe_indicator_alist, bset_fringes_outside_margins)
      (bset_header_line_format, bset_indicate_buffer_boundaries)
      (bset_indicate_empty_lines, bset_invisibility_spec)
      (bset_left_fringe_width, bset_major_mode, bset_mark)
      (bset_minor_modes, bset_mode_line_format, bset_mode_name)
      (bset_name, bset_overwrite_mode, bset_pt_marker)
      (bset_right_fringe_width, bset_save_length)
      (bset_scroll_bar_width, bset_scroll_down_aggressively)
      (bset_scroll_up_aggressively, bset_selective_display)
      (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
      (bset_word_wrap, bset_zv_marker):
      * category.c (bset_category_table):
      * syntax.c (bset_syntax_table):
      New setter functions.
      
      Fixes: debbugs:12215
      39eb03f1
    • Paul Eggert's avatar
      * process.h (PSET): Remove. · 6a09a33b
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (PROCESS_INLINE): New macro.
      (pset_childp): New setter function.
      (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
      * process.c (PROCESS_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (pset_buffer, pset_command, pset_decode_coding_system)
      (pset_decoding_buf, pset_encode_coding_system)
      (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
      (pset_plist, pset_sentinel, pset_status, pset_tty_name)
      (pset_type, pset_write_queue): New setter functions.
      
      Fixes: debbugs:12215
      6a09a33b
  17. 13 Aug, 2012 1 commit
  18. 07 Aug, 2012 1 commit
  19. 06 Aug, 2012 1 commit
  20. 02 Aug, 2012 1 commit
    • Paul Eggert's avatar
      Port to Solaris 8. · 13294f95
      Paul Eggert authored
      Without this change, 'configure' fails because the recently-added
      wait3 prototype in config.h messes up later 'configure' tests.
      Fix this problem by droping wait3 and WRETCODE, as they're
      no longer needed on hosts that are current porting targets.
      * configure.ac (wait3, WRETCODE): Remove, fixing a FIXME.
      All uses changed to waitpid and WEXITSTATUS.
      * src/syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
      13294f95
  21. 01 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Use INTERNAL_FIELD for processes. · 3193acd2
      Dmitry Antipov authored
      * src/process.h (PVAR): New macro.  Adjust style.
      (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
      * src/print.c, src/process.c, src/sysdep.c, src/w32.c:
      * src/xdisp.c: Users changed.
      * admin/coccinelle/process.cocci: Semantic patch to replace direct
      access to Lisp_Object members of struct Lisp_Process to PVAR.
      3193acd2
  22. 20 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Simple wrapper for make_unibyte_string, adjust font_open_by_name. · d7ea76b4
      Dmitry Antipov authored
      * src/lisp.h (build_unibyte_string): New function.
      * src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
      * src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
      * src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
      of type Lisp_Object to avoid redundant calls to make_unibyte_string.
      Adjust users accordingly.
      * src/font.h (font_open_by_name): Adjust prototype.
      * admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
      make_unibyte_string to build_unibyte_string where appropriate.
      d7ea76b4
  23. 13 Jul, 2012 1 commit
  24. 12 Jul, 2012 1 commit
    • Glenn Morris's avatar
      Rename init_process rather than working around it on Darwin · b82da769
      Glenn Morris authored
      The old name is also the name of a Mach system call.
      
      * src/process.c (init_process_emacs): Rename from init_process.
      
      * src/lisp.h, src/emacs.c: Update for this name change.
      
      * src/nsgui.h, src/sysselect.h, src/s/darwin.h:
      Remove workaround that is no longer needed.
      b82da769
  25. 10 Jul, 2012 2 commits
    • Paul Eggert's avatar
      EMACS_TIME simplification (Bug#11875). · e9a9ae03
      Paul Eggert authored
      This replaces macros (which typically do not work in GDB)
      with functions, typedefs and enums, making the code easier to debug.
      The functional style also makes code easier to read and maintain.
      * lib-src/profile.c (TV2): Remove no-longer-needed static var.
      * src/systime.h: Include <sys/time.h> on all hosts, not just if
      WINDOWSNT, since 'struct timeval' is needed in general.
      (EMACS_TIME): Now a typedef, not a macro.
      (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
      not macros.
      (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
      (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
      (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
      (EMACS_TIME_LE): Now functions, not macros.
      (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
      (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
      which are not functions.  All uses rewritten to use:
      (make_emacs_time): New function.
      (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
      (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
      not functions.  All uses rewritten to use the following, respectively:
      (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
      (add_emacs_time, sub_emacs_time): New functions.
      * src/atimer.c: Don't include <sys/time.h>,	as "systime.h" does this.
      * src/fileio.c (Fcopy_file):
      * src/xterm.c (XTflash): Get the current time closer to when it's used.
      * src/makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
      e9a9ae03
    • Paul Eggert's avatar
      e99a530f
  26. 09 Jul, 2012 2 commits
    • Paul Eggert's avatar
      * process.c (wait_reading_process_output): 'waitchannels' was unset · a0bee46f
      Paul Eggert authored
      when read_kbd || !NILP (wait_for_cell); fix this.
      a0bee46f
    • Dmitry Antipov's avatar
      Use make_formatted_string to avoid double length calculation. · a8290ec3
      Dmitry Antipov authored
      * lisp.h (make_formatted_string): New prototype.
      * alloc.c (make_formatted_string): New function.
      * buffer.c (Fgenerate_new_buffer_name): Use it.
      * dbus.c (syms_of_dbusbind): Likewise.
      * editfns.c (Fcurrent_time_zone): Likewise.
      * filelock.c (get_boot_time): Likewise.
      * frame.c (make_terminal_frame, set_term_frame_name)
      (x_report_frame_params): Likewise.
      * image.c (gs_load): Likewise.
      * minibuf.c (get_minibuffer): Likewise.
      * msdos.c (dos_set_window_size): Likewise.
      * process.c (make_process): Likewise.
      * xdisp.c (ensure_echo_area_buffers): Likewise.
      * xsettings.c (apply_xft_settings): Likewise.
      a8290ec3
  27. 06 Jul, 2012 1 commit
  28. 05 Jul, 2012 2 commits
    • Paul Eggert's avatar
      More xmalloc and related cleanup. · 38182d90
      Paul Eggert authored
      * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
      * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
      * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
      * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
      * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
      * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
      * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
      * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
      * xterm.c:
      Omit needless casts involving void * pointers and allocation.
      Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
      as the former is more robust if P's type is changed.
      Prefer xzalloc to xmalloc + memset 0.
      Simplify malloc-or-realloc to realloc.
      Don't worry about xmalloc returning a null pointer.
      Prefer xstrdup to xmalloc + strcpy.
      * editfns.c (Fmessage_box): Grow message_text by at least 80 when
      growing it.
      * keyboard.c (apply_modifiers_uncached): Prefer local array to
      alloca of a constant.
      38182d90
    • Dmitry Antipov's avatar
      Cleanup xmalloc. · 23f86fce
      Dmitry Antipov authored
      * admin/coccinelle/xzalloc.cocci: Semantic patch to convert
      calls to xmalloc with following memset to xzalloc.
      * src/lisp.h (xzalloc): New prototype.  Omit needless casts.
      * src/alloc.c (xzalloc): New function.  Omit needless casts.
      * src/charset.c: Omit needless casts.  Convert all calls to
      malloc with following memset to xzalloc.
      * src/dispnew.c: Likewise.
      * src/fringe.c: Likewise.
      * src/image.c: Likewise.
      * src/sound.c: Likewise.
      * src/term.c: Likewise.
      * src/w32fns.c: Likewise.
      * src/w32font.c: Likewise.
      * src/w32term.c: Likewise.
      * src/xfaces.c: Likewise.
      * src/xfns.c: Likewise.
      * src/xterm.c: Likewise.
      * src/atimer.c: Omit needless casts.
      * src/buffer.c: Likewise.
      * src/callproc.c: Likewise.
      * src/ccl.c: Likewise.
      * src/coding.c: Likewise.
      * src/composite.c: Likewise.
      * src/doc.c: Likewise.
      * src/doprnt.c: Likewise.
      * src/editfns.c: Likewise.
      * src/emacs.c: Likewise.
      * src/eval.c: Likewise.
      * src/filelock.c: Likewise.
      * src/fns.c: Likewise.
      * src/gtkutil.c: Likewise.
      * src/keyboard.c: Likewise.
      * src/lisp.h: Likewise.
      * src/lread.c: Likewise.
      * src/minibuf.c: Likewise.
      * src/msdos.c: Likewise.
      * src/print.c: Likewise.
      * src/process.c: Likewise.
      * src/region-cache.c: Likewise.
      * src/search.c: Likewise.
      * src/sysdep.c: Likewise.
      * src/termcap.c: Likewise.
      * src/terminal.c: Likewise.
      * src/tparam.c: Likewise.
      * src/w16select.c: Likewise.
      * src/w32.c: Likewise.
      * src/w32reg.c: Likewise.
      * src/w32select.c: Likewise.
      * src/w32uniscribe.c: Likewise.
      * src/widget.c: Likewise.
      * src/xdisp.c: Likewise.
      * src/xmenu.c: Likewise.
      * src/xrdb.c: Likewise.
      * src/xselect.c: Likewise.
      23f86fce
  29. 03 Jul, 2012 1 commit
    • Tom Tromey's avatar
      Auto-generate EXFUN using make-docfile · 404dbd37
      Tom Tromey authored
      src
      	* window.c (Fset_window_margins, Fset_window_fringes)
      	(Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
      	* textprop.c (Fprevious_property_change): No longer static.
      	* syntax.c (Fsyntax_table_p): No longer static.
      	* process.c (Fget_process, Fprocess_datagram_address): No longer
      	static.
      	* keymap.c (Flookup_key, Fcopy_keymap): No longer static.
      	* keyboard.c (Fcommand_execute): No longer static.
      	Remove EXFUN.
      	* insdel.c (Fcombine_after_change_execute): No longer static.
      	* image.c (Finit_image_library): No longer static.
      	* fileio.c (Fmake_symbolic_link): No longer static.
      	* eval.c (Ffetch_bytecode): No longer static.
      	* editfns.c (Fuser_full_name): No longer static.
      	* doc.c: (Fdocumentation_property, Fsnarf_documentation): No
      	longer static.
      	* buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
      	static.
      	* dired.c (Ffile_attributes): No longer static.
      	* composite.c (Fcomposition_get_gstring): No longer static.
      	* callproc.c (Fgetenv_internal): No longer static.
      
      	* ccl.h: Remove EXFUNs.
      	* buffer.h: Remove EXFUNs.
      	* dispextern.h: Remove EXFUNs.
      	* intervals.h: Remove EXFUNs.
      	* fontset.h: Remove EXFUN.
      	* font.h: Remove EXFUNs.
      	* dosfns.c (system_process_attributes): Remove EXFUN.
      	* keymap.h: Remove EXFUNs.
      	* lisp.h: Remove EXFUNs.
      	* w32term.h: Remove EXFUNs.
      	* window.h: Remove EXFUNs.
      	* xsettings.h: Remove EXFUN.
      	* xterm.h: Remove EXFUN.
      
      lib-src
      	* make-docfile.c (enum global_type) <FUNCTION>: New constant.
      	(struct global) <value>: New field.
      	(add_global): Add 'value' argument.
      	(compare_globals): Sort functions at the end.
      	(close_emacs_globals): New function.
      	(write_globals): Handle functions.
      	(scan_c_file): Call add_global for DEFUN.
      404dbd37
  30. 30 Jun, 2012 2 commits
    • Eli Zaretskii's avatar
      Adapt the MS-DOS build to the latest changes. · 0d23c240
      Eli Zaretskii authored
       msdos/mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not
       bootstrap-clean (which doesn't exist).
       msdos/inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu".
       msdos/sedleim.inp (MKDIR_P): Edit to DOS "md" command.
       msdos/sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty.
       Remove lines that invoke PAXCTL.
       (clean): Fix recipe not to run Unixy shell commands.
       msdos/sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'.
       (HAVE_STRNCASECMP): Edit to 1.
       msdos/sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty.
       (C_SWITCH_SYSTEM): Add "-I../msdos".
       msdos/sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT)
       (GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H)
       (HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H)
       (NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H)
       (NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT)
       (REPLACE_STRUCT_TIMEVAL): Edit to appropriate values.
       (BUILT_SOURCES): Edit out sys/select.h and sys/time.h.
       (mostlyclean-local, distclean-generic): Fix recipe not to run
       Unixy shell commands.
      
       src/sysselect.h [DOS_NT]: Don't include sys/select.h.
       src/s/ms-w32.h (select, pselect): Don't define here, they are
       defined in sysselect.h
       src/sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
       src/sysdep.c: Don't include dos.h and dosfns.h.
       src/process.c (sys_select):
       src/msdos.c (sys_select): Accept one more argument and ignore it.
       src/msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
       adapt data types and code to that.
       src/dosfns.c:
       src/msdos.c (gettime, settime): Define away the prototypes in dos.h,
       which clashes with the gnulib function of the same name.
      
       lisp/emacs-lisp/timer.el (timer-until): Subtract results of
       float-time, instead of taking float-time of the result of
       time-subtract, since float-time signals an error for negative time
       arguments.
      0d23c240
    • Andreas Schwab's avatar
      * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first · af5a5a98
      Andreas Schwab authored
      argument.
      * character.c, charset.c, menu.c, process.c, window.c: Adjust all
      uses.
      af5a5a98
  31. 28 Jun, 2012 1 commit
    • Dmitry Antipov's avatar
      Generalize run-time debugging checks. · a54e2c05
      Dmitry Antipov authored
      * configure.in (ENABLE_CHECKING): Update comment.
      * src/dispextern.h (XASSERTS): Remove.
      * src/fontset.c (xassert): Remove.
      Convert from xassert to eassert.
      * src/alloc.c: Convert from xassert to eassert.
      * src/bidi.c: Likewise.
      * src/dispnew.c: Likewise.
      * src/fns.c: Likewise.
      * src/fringe.c: Likewise.
      * src/ftfont.c: Likewise.
      * src/gtkutil.c: Likewise.
      * src/image.c: Likewise.
      * src/keyboard.c: Likewise.
      * src/menu.c: Likewise.
      * src/process.c: Likewise.
      * src/scroll.c: Likewise.
      * src/sound.c: Likewise.
      * src/term.c: Likewise.
      * src/w32console.c: Likewise.
      * src/w32fns.c: Likewise.
      * src/w32term.c: Likewise.
      * src/window.c: Likewise.
      * src/xdisp.c: Likewise.
      * src/xfaces.c: Likewise.
      * src/xfns.c: Likewise.
      * src/xselect.c: Likewise.
      * src/xterm.c: Likewise.
      a54e2c05
  32. 26 Jun, 2012 1 commit
    • Dmitry Antipov's avatar
      * alloc.c (allocate_window): Zero out non-Lisp part of newly · 62efea5e
      Dmitry Antipov authored
      allocated window.
      (allocate_process): Likewise for new process.
      (allocate_terminal): Changed to use offsetof.
      (allocate_frame): Likewise.
      * frame.c (make_frame): Omit redundant initialization.
      * window.c (make_parent_window): Use memset.
      (make_window): Omit redundant initialization.
      * process.c (make_process): Omit redundant initialization.
      * terminal.c (create_terminal): Likewise.
      62efea5e