1. 01 Jan, 2015 1 commit
  2. 01 Jan, 2014 1 commit
  3. 22 Sep, 2013 1 commit
    • Daniel Colascione's avatar
      Add set operations for bool-vector. · 3e0b94e7
      Daniel Colascione authored
      http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00404.html
      
      * data.c (Qbool_vector_p): New symbol.
      (bool_vector_spare_mask,popcount_size_t_generic)
      (popcount_size_t_msc,popcount_size_t_gcc)
      (popcount_size_t)
      (bool_vector_binop_driver)
      (count_trailing_zero_bits,size_t_to_host_endian)
      (Fbool_vector_exclusive_or)
      (Fbool_vector_union)
      (Fbool_vector_intersection,Fbool_vector_set_difference)
      (Fbool_vector_subsetp,Fbool_vector_not)
      (Fbool_vector_count_matches)
      (Fbool_vector_count_matches_at): New functions.
      (syms_of_data): Intern new symbol, functions.
      * alloc.c (bool_vector_payload_bytes): New function.
      (Fmake_bool_vector): Instead of calling Fmake_vector,
      which performs redundant initialization and argument checking,
      just call allocate_vector ourselves.  Make sure we clear any
      terminating padding to zero.
      (vector_nbytes,sweep_vectors): Use bool_vector_payload_bytes
      instead of open-coding the size calculation.
      (vroundup_ct): New macro.
      (vroundup): Assume argument >= 0; invoke vroundup_ct.
      * casetab.c (shuffle,set_identity): Change lint_assume to assume.
      * composite.c (composition_gstring_put_cache): Change
      lint_assume to assume.
      * conf_post.h (assume): New macro.
      (lint_assume): Remove.
      * dispnew.c (update_frame_1): Change lint_assume to assume.
      * ftfont.c (ftfont_shape_by_flt): Change lint_assume
      to assume.
      * image.c (gif_load): Change lint_assume to assume.
      * lisp.h (eassert_and_assume): New macro.
      (Qbool_vector_p): Declare.
      (CHECK_BOOL_VECTOR,ROUNDUP,BITS_PER_SIZE_T): New macros.
      (swap16,swap32,swap64): New inline functions.
      * macfont.c (macfont_shape): Change lint_assume to assume.
      * ralloc.c: Rename ROUNDUP to PAGE_ROUNDUP throughout.
      * xsettings.c (parse_settings): Use new swap16 and
      swap32 from lisp.h instead of file-specific macros.
      3e0b94e7
  4. 05 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Remove duplicate #include directives. · 47ba6d43
      Paul Eggert authored
      * alloc.c [GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES]:
      * xfaces.c:
      Don't include stdio.h twice.
      * buffer.c [USE_MMAP_FOR_BUFFERS]:
      Don't include sys/types.h or stdio.h twice.
      * fileio.c [WINDOWSNT | MSDOS]: Don't include fcntl.h twice.
      * lread.c: Don't include coding.h twice.
      * nsfont.m: Don't include frame.h twice.
      * process.c [HAVE_RES_INIT]: Don't include <netinet/in.h> twice.
      * ralloc.c: Don't include <unistd.h> twice.
      * xdisp.c: Don't include font.h twice.
      * xterm.c: Don't include fontset.h twice.
      * xterm.h [USE_X_TOOLKIT]: Don't include X11/StringDefs.h twice.
      47ba6d43
  5. 22 Feb, 2013 1 commit
    • Paul Eggert's avatar
      Assume C89 or better. · fcee5028
      Paul Eggert authored
      * ralloc.c (SIZE, POINTER, NIL):
      * vm-limit.c (POINTER):
      Remove, replacing all uses with C89 equivalents.  These old
      symbols were present only for porting to pre-C89 platforms.
      fcee5028
  6. 01 Jan, 2013 1 commit
  7. 05 Nov, 2012 1 commit
  8. 07 Oct, 2012 1 commit
  9. 01 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Clean up the Windows x64 changes. · 2d7d1608
      Eli Zaretskii authored
       nt/preprep.c (RVA_TO_PTR): Use 'unsigned char *' instead of
       'void *', for pointer arithmetics.
       (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET): Enclose all
       macro arguments in parentheses.
      
       src/unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
       (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
       (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
       as the previous version used 'void *'.
       src/ralloc.c (ROUNDUP): Fix last change.
       (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
       'size_t'.
      
      Fixes: debbugs:12544
      2d7d1608
  10. 30 Sep, 2012 1 commit
    • Fabrice Popineau's avatar
      Support x64 build on MS-Windows with MSVC. · 62aba0d4
      Fabrice Popineau authored
       src/w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
       (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
       compatibility with x64.
       src/w32term.c (w32_draw_underwave): Don't use GCC extensions for
       defining an XRectangle structure.
       src/w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
       arithmetics for compatibility with x64.
       src/w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
       compatibility with x64.
       src/w32heap.h: Adjust prototypes and declarations.
       src/w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
       (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
       DWORD, long, and unsigned long, for compatibility with x64.
       (allocate_heap) [_WIN64]: Reserve 32GB of memory.
       (sbrk): Argument is now of type ptrdiff_t.
       src/w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
       less than 0x0500.
       (w32_msg_pump): Use WPARAM type for 'result'.
       src/w32.c (init_environment, get_emacs_configuration): Support AMD64
       architecture.
       (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
       compatibility with x64.
       src/vm-limit.c (lim_data): Now size_t.
       (check_memory_limits): Adjust prototypes of real_morecore and
       __morecore to receive argument of type ptrdiff_t.  Use size_t for
       five_percent and data_size.
       src/unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
       variables, for compatibility with x64.
       (rva_to_section, offset_to_section, relocate_offset)
       (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
       (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
       (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
       for compatibility with x64.
       src/sysdep.c (STDERR_FILENO): Define if not already defined.
       src/ralloc.c (real_morecore): Argument type is now ptrdiff_t.
       (__morecore): Argument type is now ptrdiff_t.
       (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
       (relinquish): Use ptrdiff_t type for 'excess'.
       (r_alloc_sbrk): Argument type is now ptrdiff_t.
       src/makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
       (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
       instead of a literal number.
       src/gmalloc.c [WINDOWSNT]: Include w32heap.h.
       (min): Define only if not already defined.
       src/frame.c (x_report_frame_params): Use EMACS_UINT for the return
       value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
       hosts.
       src/image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
       'bitmaps' is a pointer.
       src/dispextern.h (x_bitmap_pixmap): Adjust prototype.
       src/alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
      
       nt/makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST).
       nt/inc/sys/socket.h: Don't map Winsock error codes to standard ones
       that are already defined.
       nt/inc/ms-w32.h (EMACS_INT, EMACS_UINT, EMACS_INT_MAX, PRIuMAX)
       (pI, _INTPTR) [_MSC_VER]: Fix definitions for MSVC.
       [_MSC_VER]: Add pragmas to suppress some MSVC warnings.
       nt/preprep.c (pfnCheckSumMappedFile, rva_to_section)
       (offset_to_section, relocate_offset, OFFSET_TO_RVA)
       (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA)
       (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN)
       (copy_executable_and_move_sections, ADJUST_IMPORT_RVA, main): Use
       DWORD_PTR instead of DWORD for compatibility with x64.
       nt/nmake.defs: Support AMD64.
       (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros.
       nt/gmake.defs: (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST):
       New macros.
       nt/addsection.c (pfnCheckSumMappedFile, rva_to_section)
       (offset_to_section, relocate_offset, OFFSET_TO_RVA)
       (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA)
       (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN)
       (copy_executable_and_add_section, main): Use DWORD_PTR instead of
       DWORD, for compatibility with x64.
       nt/emacs-x64.manifest: New file.
       nt/emacs-x86.manifest: Renamed from emacs.manifest.
      
       lib-src/ntlib.c (gettimeofday): Copy from src/w32.c.  lib/gettime. 
       needs this function.
      62aba0d4
  11. 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
  12. 17 Sep, 2012 2 commits
  13. 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
  14. 04 Sep, 2012 1 commit
    • 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
  15. 24 Aug, 2012 1 commit
  16. 05 Jul, 2012 1 commit
    • 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
  17. 23 Jun, 2012 2 commits
  18. 28 May, 2012 1 commit
    • Eli Zaretskii's avatar
      Avoid buffer text relocations in calls to STRING_CHAR_* macros. · 291d430f
      Eli Zaretskii authored
       src/charset.c (maybe_unify_char): Inhibit relocation of buffer text
       for the duration of call to load_charset, to avoid problems with
       callers of maybe_unify_char that access buffer text through C
       pointers.
       src/ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
       decrement the inhibition flag, instead of just setting or
       resetting it.
      
      Fixes: debbugs:11519
      291d430f
  19. 23 May, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #11519 with relocation of buffer text during regex search. · 52c55cc7
      Eli Zaretskii authored
       src/lisp.h [REL_ALLOC]: Add prototypes for external functions
       defined on ralloc.c.
       src/buffer.c [REL_ALLOC]: Remove prototypes of
       r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
       they are now on lisp.h.
       src/ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
       src/search.c (search_buffer): Use it to inhibit relocation of buffer
       text while re_search_2 is doing its job, because re_search_2 is
       passed C pointers to buffer text.
      52c55cc7
  20. 21 May, 2012 1 commit
    • Paul Eggert's avatar
      Assume C89 or later. · 261cb4bb
      Paul Eggert authored
      * configure.in (AC_C_PROTOTYPES, AC_C_VOLATILE, AC_C_CONST)
      (POINTER_TYPE, PROTOTYPES): Remove.
      * admin/CPP-DEFINES: Remove NULL, const.
      * lib-src/etags.c (static, const): Remove macros.
      (PTR): Remove; all uses replaced with void *.  Omit needless casts.
      * src/alloc.c, src/buffer.c, lisp.h: Replace POINTER_TYPE with void.
      * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
      (xrealloc):
      * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
      * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
      * textprop.c, tparam.c (NULL): Remove.
      * ralloc.c, vm-limit.c (POINTER): Assume void * works.
      * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
      * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
      * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
      * xterm.c (input_signal_count): Assume volatile works.
      261cb4bb
  21. 16 Apr, 2012 1 commit
  22. 01 Feb, 2012 1 commit
    • Eli Zaretskii's avatar
      Speed up insertion of subprocess output on MS-Windows. · 78cef877
      Eli Zaretskii authored
       src/ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
       first 2 arguments are identical.  This makes inserting large
       output from a subprocess an order of magnitude faster on
       MS-Windows, where all sbrk'ed memory is always contiguous.
      78cef877
  23. 11 Jan, 2012 1 commit
  24. 05 Jan, 2012 1 commit
  25. 15 Nov, 2011 1 commit
  26. 09 Sep, 2011 1 commit
  27. 10 Jul, 2011 1 commit
    • Andreas Schwab's avatar
      Protoize · 268c2c36
      Andreas Schwab authored
      * src/alloc.c (reset_malloc_hooks): Protoize.
      * src/cm.c (losecursor): Likewise.
      * src/ralloc.c (r_alloc_check): Likewise.
      268c2c36
  28. 07 Feb, 2011 1 commit
  29. 25 Jan, 2011 1 commit
  30. 15 Jan, 2011 1 commit
  31. 09 Jan, 2011 1 commit
  32. 02 Jan, 2011 1 commit
  33. 25 Jul, 2010 1 commit
    • Juanma Barranquero's avatar
      Make building under stricter warning flags somewhat cleaner. · 361358ea
      Juanma Barranquero authored
      Flags used: -Wold-style-declaration -Wunused-function -Wstrict-prototypes
      
      * lib-src/emacsclient.c (getcwd, w32_getenv):
      * lib-src/ntlib.h (getlogin, getuid, getegid, getgid): Fix prototypes.
      
      * nt/runemacs.c (set_user_model_id): Fix prototype.
      
      * src/callproc.c (relocate_fd): Set inside #ifndef WINDOWSNT.
      * src/dired.c (opendir, readdir): Fix prototypes.
      * src/editfns.c (w32_get_internal_run_time): Fix prototypes.
      * src/keyboard.c (input_available_signal): Declare inside #ifdef SIGIO.
      * src/ndir.h (opendir, readdir, seekdir, closedir): Fix prototypes.
        (telldir): Remove declaration.
      * src/ralloc.c (real_morecore, __morecore): Fix prototypes.
      * src/sound.c (alsa_sound_perror): Declare inside #ifdef HAVE_ALSA.
      * src/syssignal.h (strsignal): Fix prototype.
      * src/term.c (tparam): Fix prototype.
        (term_get_fkeys_address, term_get_fkeys_kboard, term_get_fkeys_1)
        (term_get_fkeys): Set inside "#ifndef DOS_NT".
      * src/vm-limit.c (check_memory_limits): Fix prototypes of real_morecore
        and __morecore.
      * src/w32gui.h (XParseGeometry): Fix prototype.
      * src/w32heap.h (get_data_start, get_data_end, init_heap): Fix prototypes.
      * src/w32term.c (my_set_focus): Declare inside #if 0.
      * src/w32term.h (x_window_to_frame, x_display_info_for_name, w32_term_init)
        (w32_fill_rect, w32_clear_window, init_crit, delete_crit, signal_quit)
        (drain_message_queue, get_next_msg, post_msg, parse_button)
        (ClipboardSequence_Proc): Fix prototypes.
        (wait_for_sync): Remove declaration.
      361358ea
  34. 23 Jul, 2010 1 commit
    • Juanma Barranquero's avatar
      Remove unused static functions. · 33ac0414
      Juanma Barranquero authored
      * alloc.c (free_float)
      * font.c [ENABLE_CHECKING] (font_match_xlfd, font_check_xlfd_parse)
      * frame.c (delete_frame_handler)
      * ralloc.c (reorder_bloc)
      * w32menu.c (menubar_id_to_frame, add_left_right_boundary)
      33ac0414
  35. 07 Jul, 2010 1 commit
    • Andreas Schwab's avatar
      Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp · 72af86bd
      Andreas Schwab authored
      * alloc.c (overrun_check_malloc, overrun_check_realloc)
      (overrun_check_free, xstrdup, allocate_string)
      (allocate_string_data, compact_small_strings, Fmake_string)
      (make_unibyte_string, make_multibyte_string)
      (make_string_from_bytes, make_specified_string, make_float)
      (Fcons, allocate_terminal, allocate_frame, make_pure_string)
      (Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by
      memcpy, memmove, memset, memcmp.
      * atimer.c (start_atimer, set_alarm): Likewise.
      * buffer.c (clone_per_buffer_values, report_overlay_modification)
      (mmap_realloc, init_buffer_once): Likewise.
      * callint.c (Fcall_interactively): Likewise.
      * callproc.c (Fcall_process, Fcall_process_region, child_setup)
      (getenv_internal_1): Likewise.
      * casefiddle.c (casify_object): Likewise.
      * ccl.c (ccl_driver): Likewise.
      * character.c (str_as_multibyte, str_to_multibyte): Likewise.
      * charset.c (load_charset_map_from_file)
      (load_charset_map_from_file, load_charset_map_from_vector)
      (Fdefine_charset_internal): Likewise.
      * cm.c (Wcm_clear): Likewise.
      * coding.c (decode_eol, decode_coding_object)
      (Fset_coding_system_priority, make_subsidiaries): Likewise.
      * data.c (Faset): Likewise.
      * dired.c (directory_files_internal, file_name_completion_stat):
      Likewise.
      * dispnew.c (new_glyph_matrix, adjust_glyph_matrix)
      (clear_glyph_row, copy_row_except_pointers)
      (copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool)
      (save_current_matrix, restore_current_matrix)
      (build_frame_matrix_from_leaf_window, mirrored_line_dance)
      (mirror_line_dance, scrolling_window): Likewise.
      * doc.c (Fsnarf_documentation, Fsubstitute_command_keys):
      Likewise.
      * doprnt.c (doprnt): Likewise.
      * editfns.c (Fuser_full_name, make_buffer_string_both)
      (Fmessage_box, Fformat, Ftranspose_regions): Likewise.
      * emacs.c (sort_args): Likewise.
      * eval.c (Fapply, Ffuncall): Likewise.
      * fileio.c (Ffile_name_directory, make_temp_name)
      (Fexpand_file_name, search_embedded_absfilename)
      (Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents)
      (auto_save_error): Likewise.
      * fns.c (Fstring_equal, Fcopy_sequence, concat)
      (string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte)
      (internal_equal, Fclear_string, larger_vector, copy_hash_table)
      (Fmake_hash_table): Likewise.
      * fringe.c (Fdefine_fringe_bitmap): Likewise.
      * ftfont.c (ftfont_text_extents): Likewise.
      * getloadavg.c (getloadavg): Likewise.
      * image.c (define_image_type, make_image, make_image_cache)
      (x_create_x_image_and_pixmap, xbm_image_p)
      (w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color)
      (xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load)
      (init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load)
      (png_image_p, png_read_from_memory, png_load, jpeg_image_p)
      (tiff_image_p, tiff_read_from_memory, gif_image_p)
      (gif_read_from_memory, gif_load, svg_image_p, gs_image_p):
      Likewise.
      * indent.c (scan_for_column, compute_motion): Likewise.
      * insdel.c (gap_left, gap_right, make_gap_smaller, copy_text)
      (insert_1_both, insert_from_gap, replace_range_2): Likewise.
      * intervals.c (reproduce_tree, reproduce_tree_obj): Likewise.
      * keyboard.c (echo_char, save_getcjmp, restore_getcjmp)
      (kbd_buffer_store_event_hold, apply_modifiers_uncached)
      (store_user_signal_events, menu_bar_items, tool_bar_items)
      (process_tool_bar_item, append_tool_bar_item)
      (read_char_minibuf_menu_prompt, read_key_sequence)
      (Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys):
      Likewise.
      * keymap.c (current_minor_maps, Fdescribe_buffer_bindings):
      Likewise.
      * lisp.h (STRING_COPYIN): Likewise.
      * lread.c (Fload, read1, oblookup): Likewise.
      * msdos.c (Frecent_doskeys): Likewise.
      * nsfns.m (Fx_create_frame): Likewise.
      * nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics):
      Likewise.
      * nsimage.m (EmacsImage-initFromSkipXBM:width:height:)
      (EmacsImage-initForXPMWithDepth:width:height:flip:length:):
      Likewise.
      * nsmenu.m (ns_update_menubar): Likewise.
      * nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise.
      * print.c (print_unwind, printchar, strout, print_string)
      (print_error_message): Likewise.
      * process.c (conv_lisp_to_sockaddr, set_socket_option)
      (Fmake_network_process, Fnetwork_interface_list)
      (Fnetwork_interface_info, read_process_output, Fprocess_send_eof)
      (init_process): Likewise.
      * ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise.
      * regex.c (init_syntax_once, regex_compile, re_compile_fastmap):
      Likewise.
      * scroll.c (do_scrolling, do_direct_scrolling)
      (scrolling_max_lines_saved): Likewise.
      * search.c (search_buffer, wordify, Freplace_match): Likewise.
      * sound.c (wav_init, au_init, Fplay_sound_internal): Likewise.
      * syntax.c (skip_chars, skip_syntaxes): Likewise.
      * sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty)
      (emacs_set_tty): Likewise.
      * term.c (encode_terminal_code, calculate_costs)
      (produce_special_glyphs, create_tty_output, init_tty, delete_tty):
      Likewise.
      * termcap.c (tgetst1, gobble_line): Likewise.
      * termhooks.h (EVENT_INIT): Likewise.
      * tparam.c (tparam1): Likewise.
      * unexalpha.c (unexec): Likewise.
      * unexec.c (write_segment): Likewise.
      * unexmacosx.c (unexec_write_zero): Likewise.
      * w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame)
      (Fx_file_dialog, Fsystem_move_file_to_trash): Likewise.
      * w32font.c (w32font_list_family, w32font_text_extents)
      (w32font_list_internal, w32font_match_internal)
      (w32font_open_internal, compute_metrics, Fx_select_font):
      Likewise.
      * w32menu.c (set_frame_menubar, add_menu_item)
      (w32_menu_display_help, w32_free_submenu_strings): Likewise.
      * w32term.c (XCreateGC, w32_initialize_display_info): Likewise.
      * w32uniscribe.c (uniscribe_list_family): Likewise.
      * w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise.
      * window.c (make_window, replace_window, set_window_buffer)
      (Fsplit_window): Likewise.
      * xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string)
      (add_to_log, message3, x_consider_frame_title)
      (append_space_for_newline, extend_face_to_end_of_line)
      (decode_mode_spec_coding, init_glyph_string): Likewise.
      * xfaces.c (x_create_gc, get_lface_attributes_no_remap)
      (Finternal_copy_lisp_face, Finternal_merge_in_global_face)
      (face_attr_equal_p, make_realized_face, make_face_cache)
      (free_realized_faces, lookup_named_face, smaller_face)
      (face_with_height, lookup_derived_face)
      (x_supports_face_attributes_p, Finternal_set_font_selection_order)
      (Finternal_set_font_selection_order, realize_default_face)
      (compute_char_face, face_at_buffer_position)
      (face_for_overlay_string, face_at_string_position, merge_faces):
      Likewise.
      * xfns.c (xic_create_fontsetname, Fx_create_frame)
      (Fx_window_property, x_create_tip_frame)
      (Fx_backspace_delete_keys_p): Likewise.
      * xfont.c (xfont_list, xfont_match, xfont_list_family)
      (xfont_text_extents): Likewise.
      * xmenu.c (set_frame_menubar, xmenu_show): Likewise.
      * xrdb.c (magic_file_p, x_get_resource): Likewise.
      * xselect.c (x_queue_event, x_get_window_property)
      (receive_incremental_selection): Likewise.
      * xsmfns.c (x_session_check_input): Likewise.
      * xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT)
      (handle_one_xevent, x_check_errors, xim_initialize, x_term_init):
      Likewise.
      * character.h (BCOPY_SHORT): Removed.
      * config.in: Regenerate.
      * dispnew.c (safe_bcopy): Only define as dummy if PROFILING.
      * emacs.c (main) [PROFILING]: Don't declare
      dump_opcode_frequencies.
      * lisp.h (safe_bcopy): Remove declaration.
      (memset) [!HAVE_MEMSET]: Declare.
      (memcpy) [!HAVE_MEMCPY]: Likewise.
      (memmove) [!HAVE_MEMMOVE]: Likewise.
      (memcmp) [!HAVE_MEMCMP]: Likewise.
      * s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY)
      (BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP):
      Don't define.
      (HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define.
      * s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE)
      (BCOPY_DOWNWARD_SAFE): Don't define.
      * sysdep.c (memset) [!HAVE_MEMSET]: Define.
      (memcpy) [!HAVE_MEMCPY]: Define.
      (memmove) [!HAVE_MEMMOVE]: Define.
      (memcmp) [!HAVE_MEMCMP]: Define.
      
      * config.nt (HAVE_BCOPY, HAVE_BCMP): Remove undefs.
      (HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_MEMCMP): Add undefs.
      
      * sed2v2.inp (HAVE_MEMCPY, HAVE_MEMSET): Edit to 1.
      (HAVE_BZERO): Don't edit.
      
      * lwlib.c (lwlib_memset, lwlib_bcopy): Remove.
      (malloc_widget_value, free_widget_info, allocate_widget_instance)
      (lw_separator_p): Replace lwlib_memset, lwlib_bcopy, bzero, bcmp by
      memset, memcpy, memcmp.
      * lwlib-utils.c (XtApplyToWidgets): Likewise.
      * xlwmenu.c (XlwMenuInitialize): Likewise.
      * lwlib.h (lwlib_bcopy): Remove declaration.
      
      * ebrowse.c (add_sym, make_namespace): Replace bcopy, bzero by
      memcpy, memmove, memset.
      * pop.c (pop_retrieve, socket_connection, pop_getline): Likewise.
      
      * CPP-DEFINES (BCOPY_DOWNWARD_SAFE, BCOPY_UPWARD_SAFE)
      (GAP_USE_BCOPY, HAVE_BCMP, HAVE_BCOPY, bcmp, bcopy, bzero):
      Remove.
      
      * configure.in: Don't check for bcopy, bcmp, bzero.  Don't include
      <strings.h> and don't define bcopy, bzero, BCMP in config.h.
      72af86bd
  36. 04 Jul, 2010 1 commit
    • Dan Nicolaescu's avatar
      Convert (most) functions in src to standard C. · 971de7fb
      Dan Nicolaescu authored
      * src/alloc.c: Convert function definitions to standard C.
      * src/atimer.c:
      * src/bidi.c:
      * src/bytecode.c:
      * src/callint.c:
      * src/callproc.c:
      * src/casefiddle.c:
      * src/casetab.c:
      * src/category.c:
      * src/ccl.c:
      * src/character.c:
      * src/charset.c:
      * src/chartab.c:
      * src/cmds.c:
      * src/coding.c:
      * src/composite.c:
      * src/data.c:
      * src/dbusbind.c:
      * src/dired.c:
      * src/dispnew.c:
      * src/doc.c:
      * src/doprnt.c:
      * src/ecrt0.c:
      * src/editfns.c:
      * src/fileio.c:
      * src/filelock.c:
      * src/filemode.c:
      * src/fns.c:
      * src/font.c:
      * src/fontset.c:
      * src/frame.c:
      * src/fringe.c:
      * src/ftfont.c:
      * src/ftxfont.c:
      * src/gtkutil.c:
      * src/indent.c:
      * src/insdel.c:
      * src/intervals.c:
      * src/keymap.c:
      * src/lread.c:
      * src/macros.c:
      * src/marker.c:
      * src/md5.c:
      * src/menu.c:
      * src/minibuf.c:
      * src/prefix-args.c:
      * src/print.c:
      * src/ralloc.c:
      * src/regex.c:
      * src/region-cache.c:
      * src/scroll.c:
      * src/search.c:
      * src/sound.c:
      * src/strftime.c:
      * src/syntax.c:
      * src/sysdep.c:
      * src/termcap.c:
      * src/terminal.c:
      * src/terminfo.c:
      * src/textprop.c:
      * src/tparam.c:
      * src/undo.c:
      * src/unexelf.c:
      * src/window.c:
      * src/xfaces.c:
      * src/xfns.c:
      * src/xfont.c:
      * src/xftfont.c:
      * src/xgselect.c:
      * src/xmenu.c:
      * src/xrdb.c:
      * src/xselect.c:
      * src/xsettings.c:
      * src/xsmfns.c:
      * src/xterm.c: Likewise.
      971de7fb
  37. 13 Jan, 2010 1 commit
  38. 19 Oct, 2009 1 commit
    • Dan Nicolaescu's avatar
      * alloc.c: Do not define struct catchtag. · d7306fe6
      Dan Nicolaescu authored
      * eval.c: Move struct catchtag definition ...
      * lisp.h: ... here.
      
      * image.c: Move png.h #include earlier to avoid warnings.
      
      * xterm.c:
      * xsmfns.c:
      * xselect.c:
      * xrdb.c:
      * xmenu.c:
      * xftfont.c:
      * xfont.c:
      * xfns.c:
      * xfaces.c:
      * xdisp.c:
      * window.c:
      * widget.c:
      * w32xfns.c:
      * w32uniscribe.c:
      * w32term.c:
      * w32select.c:
      * w32reg.c:
      * w32proc.c:
      * w32menu.c:
      * w32inevt.c:
      * w32heap.c:
      * w32font.c:
      * w32fns.c:
      * w32console.c:
      * w32.c:
      * w16select.c:
      * vm-limit.c:
      * unexsol.c:
      * unexec.c:
      * unexcw.c:
      * unexaix.c:
      * undo.c:
      * tparam.c:
      * textprop.c:
      * terminfo.c:
      * terminal.c:
      * termcap.c:
      * term.c:
      * syntax.c:
      * sound.c:
      * sheap.c:
      * search.c:
      * scroll.c:
      * region-cache.c:
      * regex.c:
      * ralloc.c:
      * process.c:
      * print.c:
      * msdos.c:
      * minibuf.c:
      * menu.c:
      * marker.c:
      * macros.c:
      * keymap.c:
      * keyboard.c:
      * intervals.c:
      * insdel.c:
      * indent.c:
      * gtkutil.c:
      * ftxfont.c:
      * ftfont.c:
      * fringe.c:
      * frame.c:
      * fontset.c:
      * font.c:
      * fns.c:
      * floatfns.c:
      * filelock.c:
      * fileio.c:
      * emacs.c:
      * editfns.c:
      * dosfns.c:
      * doprnt.c:
      * doc.c:
      * dispnew.c:
      * dired.c:
      * dbusbind.c:
      * data.c:
      * composite.c:
      * coding.c:
      * cmds.c:
      * cm.c:
      * chartab.c:
      * charset.c:
      * character.c:
      * ccl.c:
      * category.c:
      * casetab.c:
      * casefiddle.c:
      * callproc.c:
      * callint.c:
      * bytecode.c:
      * buffer.c:
      * atimer.c: Include setjmp.h.  (Bug#4643)
      
      * xlwmenu.c:
      * lwlib.c:
      * lwlib-utils.c:
      * lwlib-Xm.c:
      * lwlib-Xlw.c:
      * lwlib-Xaw.c: Include setjmp.h.
      d7306fe6