1. 01 Jan, 2013 1 commit
  2. 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
  3. 11 Sep, 2012 1 commit
    • 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
  4. 25 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * xgselect.c (xg_select): Use auto storage for the GPollFD buffer · 0f46bc75
      Paul Eggert authored
      as that's faster and simpler than static storage.  Don't bother
      with the g_main_context_query overhead if g_main_context_pending
      says no events are pending.
      (gfds, gfds_size): Remove these static vars.
      (xgselect_initialize): Remove; no longer needed.
      All uses and decls removed.
      0f46bc75
  5. 10 Jul, 2012 1 commit
    • 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
  6. 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
  7. 22 Jun, 2012 1 commit
  8. 21 May, 2012 1 commit
  9. 19 May, 2012 1 commit
  10. 16 May, 2012 1 commit
  11. 10 May, 2012 1 commit
  12. 11 Jan, 2012 1 commit
  13. 05 Jan, 2012 1 commit
  14. 05 Aug, 2011 1 commit
  15. 29 Jul, 2011 1 commit
  16. 01 Jul, 2011 1 commit
    • Jan Djärv's avatar
      * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h · 0949d2b6
      Jan Djärv authored
      (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
      xg_select.
      
      * xgselect.c: Add defined (HAVE_GSETTINGS).
      (xgselect_initialize): Ditto.
      
      * xsettings.c (store_monospaced_changed): Take new font as arg and
      check for change against current_mono_font.
      (EMACS_TYPE_SETTINGS): Remove this and related defines.
      (emacs_settings_constructor, emacs_settings_get_property)
      (emacs_settings_set_property, emacs_settings_class_init)
      (emacs_settings_init, gsettings_obj): Remove.
      (something_changedCB): New function for HAVE_GSETTINGS.
      (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
      with value as argument.
      (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
      g_settings_new.  Do not create gsettings_obj.
      Remove calls to g_settings_bind. Connect something_changedCB to
      "changed".
      
      Fixes: debbugs:8967
      0949d2b6
  17. 16 Apr, 2011 1 commit
  18. 13 Mar, 2011 1 commit
  19. 26 Jan, 2011 1 commit
  20. 25 Jan, 2011 1 commit
  21. 15 Jan, 2011 1 commit
  22. 02 Jan, 2011 1 commit
  23. 26 Sep, 2010 1 commit
  24. 04 Jul, 2010 2 commits
    • Juanma Barranquero's avatar
      Fix more prototypes. · e5447b22
      Juanma Barranquero authored
      * atimer.c (start_atimer): Use EMACS_TIME, not struct timeval.
      * sysdep.c (set_file_times): Use EMACS_TIME, not struct timeval.
      * xgselect.c (xg_select): Use SELECT_TYPE, EMACS_TIME.
      e5447b22
    • 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
  25. 02 Jun, 2010 1 commit
    • Dan Nicolaescu's avatar
      Fix config.h includes. · 08a494a3
      Dan Nicolaescu authored
      * src/xsettings.c:
      * src/xgselect.c:
      * src/nsterm.m:
      * src/nsselect.m:
      * src/nsimage.m:
      * src/nsfont.m:
      * src/nsfns.m:
      * src/dbusbind.c: Use #include <config.h> instead of "config.h" as all
      other files do.
      08a494a3
  26. 13 Jan, 2010 1 commit
  27. 01 Dec, 2009 1 commit
  28. 21 Nov, 2009 1 commit
    • Jan Djärv's avatar
      Use a select wrapper around the GLib event loop, thus taking into account GLib · 872870b2
      Jan Djärv authored
      timeouts and event sources.  This simplifies Gtk+-code a lot, and is needed
      for handling GConf death/restart.
      
      * xterm.c: #include xgselect.h.
      (x_initialize): Call xgselect_initialize.
      
      * xsettings.c (something_changedCB): C++ comments => C comments.
      (init_gconf): Do not deal with any GLib file descriptors, xg_select
      does that now.
      
      * gtkutil.c (xg_timer, xg_process_timeouts, xg_start_timer)
      (xg_stop_timer, menu_grab_callback_cnt, menu_grab_callback)
      (scroll_bar_button_cb): Remove.
      (create_menus): C++ comments => C comments. Don't bind grab-notify
      event.
      (xg_create_scroll_bar): Don't bind button-press-event and
      button-release-event.
      
      * process.c: Include xgselect.h if defined (USE_GTK) ||
      defined (HAVE_GCONF).
      (wait_reading_process_output): Call xg_select for the same condition.
      
      * xgselect.c (xg_select): New function to better integrate with
      GLib/Gtk event handling.  Needed if GConf daemon dies/restarts.
      
      * xgselect.h: New file, declare xg_select, xgselect_initialize.
      
      * Makefile.in (XOBJ): Add xgselect.o.
      872870b2