1. 16 Jan, 2015 1 commit
    • Dmitry Antipov's avatar
      Prefer INLINE functions in font.h to match style used in lisp.h · 4303d110
      Dmitry Antipov authored
      * font.h (FONTP, FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P)
      (CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY, CHECK_FONT_OBJECT)
      (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT, CHECK_FONT_GET_OBJECT):
      Now functions.
      * font.c (Ffont_otf_alternates, Fquery_font, Ffont_get_glyphs):
      * ftfont.c (ftfont_shape):
      * macfont.m (macfont_shape):
      * w32uniscribe.c (uniscribe_shape):
      * xftfont.c (xftfont_shape): Adjust CHECK_FONT_GET_OBJECT users.
      4303d110
  2. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab...
      58f2d6ef
  3. 01 Jan, 2015 1 commit
  4. 24 Sep, 2014 1 commit
    • Paul Eggert's avatar
      Fix some slow uses and misuses of strcat. · 4620e6bc
      Paul Eggert authored
      * doc.c (get_doc_string):
      * gtkutil.c (get_utf8_string):
      * xsmfns.c (x_session_initialize):
      Avoid recomputation of string length.
      * ftfont.c (ftfont_spec_pattern):
      * xfns.c (xic_create_fontsetname):
      Don't assume output buffer is initially zero.
      4620e6bc
  5. 07 Sep, 2014 1 commit
    • Paul Eggert's avatar
      Use SAFE_ALLOCA etc. to avoid unbounded stack allocation. · b3bf18b3
      Paul Eggert authored
      This follows up on the recent thread in emacs-devel on alloca; see:
      http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html
      This patch also cleans up alloca-related glitches noted while
      examining the code looking for unbounded alloca.
      * alloc.c (listn):
      * callproc.c (init_callproc):
      Rewrite to avoid need for alloca.
      * buffer.c (mouse_face_overlay_overlaps)
      (report_overlay_modification):
      * buffer.h (GET_OVERLAYS_AT):
      * coding.c (make_subsidiaries):
      * doc.c (Fsnarf_documentation):
      * editfns.c (Fuser_full_name):
      * fileio.c (Ffile_name_directory, Fexpand_file_name)
      (search_embedded_absfilename, Fsubstitute_in_file_name):
      * fns.c (Fmake_hash_table):
      * font.c (font_vconcat_entity_vectors, font_update_drivers):
      * fontset.c (fontset_pattern_regexp, Ffontset_info):
      * frame.c (Fmake_terminal_frame, x_set_frame_parameters)
      (xrdb_get_resource, x_get_resource_string):
      * ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf):
      * ftxfont.c (ftxfont_draw):
      * image.c (xbm_load, xpm_load, jpeg_load_body):
      * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items):
      * keymap.c (Fdescribe_buffer_bindings, describe_map):
      * lread.c (openp):
      * menu.c (digest_single_submenu, find_and_call_menu_selection)
      (find_and_return_menu_selection):
      * print.c (PRINTFINISH):
      * process.c (Fformat_network_address):
      * scroll.c (do_scrolling, do_direct_scrolling, scrolling_1):
      * search.c (search_buffer, Fmatch_data, Fregexp_quote):
      * sound.c (wav_play, au_play):
      * syntax.c (skip_chars):
      * term.c (tty_menu_activate, tty_menu_show):
      * textprop.c (get_char_property_and_overlay):
      * window.c (Fset_window_configuration):
      * xdisp.c (safe__call, next_overlay_change, vmessage)
      (compute_overhangs_and_x, draw_glyphs, note_mouse_highlight):
      * xfaces.c (face_at_buffer_position):
      * xmenu.c (x_menu_show):
      Use SAFE_ALLOCA etc. instead of plain alloca, since the
      allocation size isn't bounded.
      * callint.c (Fcall_interactively): Redo memory_full check
      so that it can be done at compile-time on some platforms.
      * coding.c (MAX_LOOKUP_MAX): New constant.
      (get_translation_table): Use it.
      * callproc.c (call_process): Use SAFE_NALLOCA instead of
      SAFE_ALLOCA, to catch integer overflows on size calculation.
      (exec_failed) [!DOS_NT]: New function.
      (child_setup) [!DOS_NT]: Use it.
      * editfns.c (Ftranspose_regions):
      Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'.
      * editfns.c (check_translation):
      Allocate larger buffers on the heap.
      * eval.c (internal_lisp_condition_case):
      Check for MAX_ALLOCA overflow.
      * fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector.
      (Fbase64_encode_region, Fbase64_decode_region):
      Avoid unnecessary calls to SAFE_FREE before 'error'.
      * buffer.c (mouse_face_overlay_overlaps):
      * editfns.c (Fget_pos_property, check_translation):
      * eval.c (Ffuncall):
      * font.c (font_unparse_xlfd, font_find_for_lface):
      * ftfont.c (ftfont_drive_otf):
      * keyboard.c (echo_add_key, read_decoded_event_from_main_queue)
      (menu_bar_items, tool_bar_items):
      * sound.c (Fplay_sound_internal):
      * xdisp.c (load_overlay_strings, dump_glyph_row):
      Use an ordinary auto buffer rather than alloca, since the
      allocation size is fixed and small.
      * ftfont.c: Include <c-strcase.h>.
      (matching_prefix): New function.
      (get_adstyle_property): Use it, to avoid need for alloca.
      * keyboard.c (echo_add_key):
      * keymap.c (describe_map): Use ptrdiff_t, not int.
      * keyboard.c (echo_add_key): Prefer sizeof to strlen.
      * keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS,
      when counting bytes.
      * lisp.h (xlispstrdupa): Remove, replacing with ...
      (SAFE_ALLOCA_STRING): ... new macro with different API.
      This fixes a portability problem, namely, alloca result
      passed to another function.  All uses changed.
      (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA,
      not MAX_ALLOCA - 1.
      * regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE)
      (REGEX_ALLOCATE): New macros.
      (REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
      (REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal):
      Use them.
      * xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it
      by hand.
      (decode_mode_spec_coding): Store directly into buf rather than
      into an alloca temporary and copying the temporary to the buf.
      
      Fixes: debbugs:18410
      b3bf18b3
  6. 25 Aug, 2014 1 commit
    • Dmitry Antipov's avatar
      One more minor cleanup of font subsystem. · 8661ebaa
      Dmitry Antipov authored
      * font.h (struct font_driver): Convert text_extents to
      return void because returned value is never actually used.
      * macfont.c (macfont_text_extents):
      * w32font.c (w32font_text_extents):
      * xftfont.c (xftfont_text_extents): Adjust to return void
      and assume that 'metrics' argument is always non-NULL.
      * ftfont.c (ftfont_text_extents):
      * xfont.c (xfont_text_extents): Likewise.  Avoid redundant memset.
      8661ebaa
  7. 09 Jul, 2014 1 commit
    • Dmitry Antipov's avatar
      Next minor cleanup of font subsystem. · 876d043f
      Dmitry Antipov authored
      * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no
      users) and FONT_FORMAT_INDEX (set by a few font drivers but never
      really used).
      (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove;
      unused.
      * ftfont.h (ftfont_font_format): Remove prototype.
      * ftfont.c (ftfont_font_format): Remove; now unused.
      (ftfont_open):
      * nsfont.m (nsfont_open):
      * w32font.c (w32font_open_internal):
      * w32uniscribe.c (uniscribe_open):
      * xfont.c (xfont_open):
      * xftfont.c (xftfont_open): All users changed.
      876d043f
  8. 08 Jul, 2014 1 commit
  9. 04 Jul, 2014 1 commit
    • Dmitry Antipov's avatar
      * font.h (struct font_driver): Remove get_outline and free_outline; · 9d7b0167
      Dmitry Antipov authored
      not used by any font driver.
      * ftfont.c (ftfont_driver):
      * macfont.m (macfont_driver):
      * nsfont.m (nsfont_driver):
      * w32font.c (w32font_driver):
      * w32uniscribe.c (uniscribe_font_driver):
      * xfont.c (xfont_driver): Related users changed.
      * xselect.c (x_get_window_property): Use convenient xmalloc.
      Call to xfree only if some data was really allocated.
      9d7b0167
  10. 17 Jun, 2014 1 commit
    • Paul Eggert's avatar
      Omit redundant extern decls. · 73bfe891
      Paul Eggert authored
      Most of this patch is from Dmitry Antipov, in:
      http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00263.html
      * configure.ac (WERROR_CFLAGS): Add -Wredundant-decls.
      * lib-src/emacsclient.c (getenv): Remove decl.
      * lib-src/make-docfile.c (write_globals): Add ATTRIBUTE_CONST for
      Fbyteorder, Ftool_bar_height, Fmax_char, Fidentity.
      * lwlib/lwlib-Xm.c (lw_motif_widget_p, xm_update_one_value)
      (xm_create_dialog, xm_destroy_instance, xm_popup_menu)
      (xm_set_keyboard_focus, xm_set_main_areas): Remove decls.
      * src/commands.h (update_mode_lines):
      * src/frame.h (Qbackground_color, Qforeground_color)
      (x_set_menu_bar_lines):
      * src/ftfont.c (ftfont_font_format):
      * src/intervals.h (Qkeymap, Qfont):
      * src/keyboard.c (timer_check, safe_run_hooks, Qregion_extract_function):
      * src/lisp.h (Ffboundp, Qnil, Qt, Qlambda, Qintegerp, Qwholenump)
      (Qsymbolp, Qlisp, Qconsp, Qstringp, Qarrayp, Qbufferp, Qmarkerp)
      (Qvectorp, Qbuffer_or_string_p, Qchar_table_p, Qvector_or_char_table_p)
      (Qfloatp, Qnumberp...
      73bfe891
  11. 23 Jan, 2014 1 commit
  12. 06 Jan, 2014 1 commit
    • Paul Eggert's avatar
      Spelling fixes. · d5081c1e
      Paul Eggert authored
      * calc/calc-yank.el (calc-edit-mode, calc-edit-cancel):
      * emacs-lisp/debug.el (cancel-debug-on-entry):
      * epg.el (epg-error-to-string):
      * files.el (recover-file):
      * lpr.el (lpr-buffer, print-buffer, lpr-region, print-region):
      * mail/emacsbug.el (report-emacs-bug-hook):
      * mail/sendmail.el (mail-recover):
      * ses.el (ses-yank-resize):
      * term/ns-win.el (ns-print-buffer):
      Spelling fixes in diagnostics, mostly for "canceled" with one L.
      * epg.el (epg-key-capability-alist): Rename from misspelled version.
      All uses changed.
      * obsolete/xesam.el (xesam-all-fields): Fix misspelled field name.
      d5081c1e
  13. 01 Jan, 2014 1 commit
  14. 13 Dec, 2013 1 commit
  15. 12 Dec, 2013 1 commit
    • Dmitry Antipov's avatar
      * font.h (struct font_entity) [HAVE_NS]: New field to record · cf86e18b
      Dmitry Antipov authored
      font driver which was used to create this entity.
      (struct font) [HAVE_WINDOW_SYSTEM]: New field to record
      frame where the font was opened.
      (font_close_object): Add prototype.
      * font.c (font_make_entity) [HAVE_NS]: Zero out driver field.
      (font_close_object): Not static any more.  Lost frame arg.
      Adjust comment and users.
      * alloc.c (cleanup_vector): Call font_close_object to adjust
      per-frame font counters correctly.  If HAVE_NS, also call
      driver-specific cleanup for font-entity objects.
      * ftfont.c (ftfont_open):
      * nsfont.m (nsfont_open):
      * w32font.c (w32font_open_internal):
      * xfont.c (xfont_open):
      * xftfont.c (xftfont_open): Save frame pointer in font object.
      * macfont.m (macfont_open): Likewise.
      (macfont_descriptor_entity): Save driver pointer to be able
      to call its free_entity routine when font-entity is swept.
      * ftxfont.c (ftxfont_open): Add eassert because frame
      pointer should be saved by ftfont_driver.open.
      cf86e18b
  16. 04 Dec, 2013 1 commit
  17. 25 Oct, 2013 1 commit
    • Dmitry Antipov's avatar
      Omit unused frame argument of font API's close function. · 78e0b35c
      Dmitry Antipov authored
      * font.h (struct font): Drop frame argument.  Adjust comment.
      * font.c (font_clear_cache, font_close_object): Adjust users.
      * ftfont.c (ftfont_close):
      * ftxfont.c (ftxfont_close):
      * macfont.m (macfont_close):
      * nsfont.m (nsfont_close):
      * w32font.c (w32font_close):
      * xfont.c (xfont_close):
      * xftfont.c (xftfont_close): Adjust driver-specific close
      functions, tweak comments and make functions safe if called
      more than once for the same font object.
      78e0b35c
  18. 11 Oct, 2013 1 commit
    • Paul Eggert's avatar
      * lisp.h (eassume): New macro. · b9ff995e
      Paul Eggert authored
      Also, include <verify.h>, for 'assume'.
      * alloc.c (bool_vector_payload_bytes, Fmake_bool_vector)
      (vroundup, vector_nbytes):
      * data.c (bool_vector_spare_mask, bool_vector_binop_driver)
      (Fbool_vector_not, Fbool_vector_count_matches)
      (Fbool_vector_count_matches_at):
      Use eassume, not eassert.
      * casetab.c (set_identity, shuffle):
      * composite.c (composition_gstring_put_cache):
      * dispnew.c (update_frame_1):
      * ftfont.c (ftfont_shape_by_flt):
      * image.c (gif_load):
      * intervals.c (offset_intervals):
      * macfont.m (macfont_shape):
      Remove calls to 'assume' that are no longer needed, because
      --enable-gcc-warnings no longer generates bogus warnings
      when these calls are removed.
      b9ff995e
  19. 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
  20. 03 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Drop FRAME_PTR typedef. · a10c8269
      Dmitry Antipov authored
      * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
      * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
      * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
      * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
      * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
      * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
      * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
      All related users changed.
      a10c8269
  21. 01 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Avoid redundant Lisp_Object <-> struct frame conversions in font API. · fdb396e2
      Dmitry Antipov authored
      * font.h (struct font_driver): Change list, match, and list_family
      functions to accept struct frame * as first arg.
      * font.c (font_score, font_compare, font_sort_entities): Remove
      prototypes.
      (font_sort_entities, font_list_entities, font_select_entity):
      (font_find_for_lface, Flist_fonts, Ffont_family_list): Adjust to
      match font API change.
      * xfont.c (xfont_list, xfont_match, xfont_list_family):
      * ftfont.c (ftfont_list, ftfont_match, ftfont_list_family):
      * ftxfont.c (ftxfont_list, ftxfont_match):
      * xftfont.c (xftfont_list, xftfont_match):
      * nsfont.m (nsfont_list, nsfont_match, nsfont_list_family):
      * w32font.c (w32font_list, w32font_match, w32font_list):
      (w32font_list_internal, w32_font_match_internal): Likewise.
      * xfaces.c (Fx_family_fonts): Adjust user.
      fdb396e2
  22. 19 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Fix obscure porting bug with varargs functions. · 1396ac86
      Paul Eggert authored
      The code assumed that int is treated like ptrdiff_t in a vararg
      function, which is not a portable assumption.  There was a similar
      -- though these days less likely -- porting problem with various
      assumptions that pointers of different types all smell the same as
      far as vararg functions is conserved.  To make this problem less
      likely in the future, redo the API to use varargs functions.
      * alloc.c (make_save_value): Remove this vararg function.
      All uses changed to ...
      (make_save_int_int_int, make_save_obj_obj_obj_obj)
      (make_save_ptr_int, make_save_funcptr_ptr_obj, make_save_memory):
      New functions.
      (make_save_ptr): Rename from make_save_pointer, for consistency with
      the above.  Define only on platforms that need it.  All uses changed.
      1396ac86
  23. 16 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Prefer list1 (X) to Fcons (X, Qnil) when building lists. · 6c6f1994
      Paul Eggert authored
      This makes the code easier to read and the executable a bit smaller.
      Do not replace all calls to Fcons that happen to create lists,
      just calls that are intended to create lists.  For example, when
      creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
      rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
      Similarly for list2 through list5.
      * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
      * bytecode.c (exec_byte_code):
      * callint.c (quotify_arg, Fcall_interactively):
      * callproc.c (Fcall_process, create_temp_file):
      * charset.c (load_charset_map_from_file)
      (Fdefine_charset_internal, init_charset):
      * coding.c (get_translation_table, detect_coding_system)
      (Fcheck_coding_systems_region)
      (Fset_terminal_coding_system_internal)
      (Fdefine_coding_system_internal, Fdefine_coding_system_alias):
      * composite.c (update_compositions, Ffind_composition_internal):
      * dired.c (directory_files_internal, file_name_completion)
      (Fsystem_users):
      * dispnew.c (Fopen_termscript, bitch_at_user, init_display):
      * doc.c (Fsnarf_documentation):
      * editfns.c (Fmessage_box):
      * emacs.c (main):
      * eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
      (Feval, eval_sub, Ffuncall, apply_lambda):
      * fileio.c (make_temp_name, Fcopy_file, Faccess_file)
      (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
      (Fset_file_times, Finsert_file_contents)
      (Fchoose_write_coding_system, Fwrite_region):
      * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
      * font.c (font_registry_charsets, font_parse_fcname)
      (font_prepare_cache, font_update_drivers, Flist_fonts):
      * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
      * frame.c (make_frame, Fmake_terminal_frame)
      (x_set_frame_parameters, x_report_frame_params)
      (x_default_parameter, Fx_parse_geometry):
      * ftfont.c (syms_of_ftfont):
      * image.c (gif_load):
      * keyboard.c (command_loop_1):
      * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
      (Fcopy_keymap, append_key, Fcurrent_active_maps)
      (Fminor_mode_key_binding, accessible_keymaps_1)
      (Faccessible_keymaps, Fwhere_is_internal):
      * lread.c (read_emacs_mule_char):
      * menu.c (find_and_return_menu_selection):
      * minibuf.c (get_minibuffer):
      * nsfns.m (Fns_perform_service):
      * nsfont.m (ns_script_to_charset):
      * nsmenu.m (ns_popup_dialog):
      * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
      (Fx_own_selection_internal):
      * nsterm.m (append2):
      * print.c (Fredirect_debugging_output)
      (print_prune_string_charset):
      * process.c (Fdelete_process, Fprocess_contact)
      (Fformat_network_address, set_socket_option)
      (read_and_dispose_of_process_output, write_queue_push)
      (send_process, exec_sentinel):
      * sound.c (Fplay_sound_internal):
      * textprop.c (validate_plist, add_properties)
      (Fput_text_property, Fadd_face_text_property)
      (copy_text_properties, text_property_list, syms_of_textprop):
      * unexaix.c (report_error):
      * unexcoff.c (report_error):
      * unexsol.c (unexec):
      * xdisp.c (redisplay_tool_bar, store_mode_line_string)
      (Fformat_mode_line, syms_of_xdisp):
      * xfaces.c (set_font_frame_param)
      (Finternal_lisp_face_attribute_values)
      (Finternal_merge_in_global_face, syms_of_xfaces):
      * xfns.c (x_default_scroll_bar_color_parameter)
      (x_default_font_parameter, x_create_tip_frame):
      * xfont.c (xfont_supported_scripts):
      * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
      (menu_help_callback, xmenu_show):
      * xml.c (make_dom):
      * xterm.c (set_wm_state):
      Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
      and similarly for list2 through list5.
      6c6f1994
  24. 21 Mar, 2013 1 commit
    • Paul Eggert's avatar
      Use functions and constants to manipulate Lisp_Save_Value objects. · 7b1123d8
      Paul Eggert authored
      This replaces code that used macros and strings and token-pasting.
      The change makes the C source a bit easier to follow,
      and shrinks the Emacs executable a bit.
      * alloc.c: Verify some properties of Lisp_Save_Value's representation.
      (make_save_value): Change 1st arg from string to enum.  All callers
      changed.
      (INTX): Remove.
      (mark_object): Use if, not #if, for GC_MARK_STACK.
      * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
      (XSAVE_OBJECT): Now functions, not macros.
      (STRING_BYTES_BOUND): Now just a macro, not a constant too;
      the constant was never used.
      (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
      (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
      (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
      (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
      New constants.
      (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
      type3 with a single member save_type.  All uses changed.
      (save_type, set_save_pointer, set_save_integer): New functions.
      * print.c (PRINTX): Remove.
      7b1123d8
  25. 04 Mar, 2013 1 commit
  26. 08 Feb, 2013 1 commit
    • Dmitry Antipov's avatar
      * lisp.h (make_uninit_vector): New function. · 25721f5b
      Dmitry Antipov authored
      * alloc.c (Fvector, Fmake_byte_code):
      * ccl.c (Fregister_ccl_program):
      * charset.c (Fdefine_charset_internal, define_charset_internal):
      * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
      * composite.c (syms_of_composite):
      * font.c (Fquery_font, Ffont_info, syms_of_font):
      * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
      * ftfont.c (ftfont_shape_by_flt):
      * indent.c (recompute_width_table):
      * nsselect.m (clean_local_selection_data):
      * syntax.c (init_syntax_once):
      * w32unsubscribe.c (uniscribe_shape):
      * window.c (Fcurrent_window_configuration):
      * xfaces.c (Fx_family_fonts):
      * xselect.c (selection_data_to_lisp_data): Use it.
      25721f5b
  27. 17 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      * lisp.h (toplevel): Add comment about using Lisp_Save_Value · 468afbac
      Dmitry Antipov authored
      objects, related functions and macros.
      (make_save_value): Adjust prototype.
      (make_save_pointer): New prototype.
      (SAFE_NALLOCA): Fix indentation.  Use make_save_pointer.
      (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
      * alloc.c (format_save_value): Rename to make_save_value.
      (make_save_pointer): New function.
      (record_xmalloc): Use make_save_pointer.
      * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
      * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
      Change users of make_save_value to make_save_pointer.
      Likewise for format_save_value and make_save_value.
      468afbac
  28. 15 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      * src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extraction · 2b30549c
      Dmitry Antipov authored
      from any Lisp_Save_Value slot.  Add type checking.
      * src/alloc.c, src/dired.c, src/editfns.c, src/fileio.c, src/ftfont.c:
      * src/gtkutil.c, src/keymap.c, src/lread.c, src/nsterm.h, src/nsmenu.c:
      * src/xfns.c, src/xmenu.c, src/xselect.c: All users changed.
      * admin/coccinelle/xsave.cocci: Semantic patch to adjust users of
      XSAVE_POINTER and XSAVE_INTEGER macros.
      2b30549c
  29. 14 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      Make Lisp_Save_Value more versatile storage for up to four objects. · 73ebd38f
      Dmitry Antipov authored
      * lisp.h (toplevel): Enumeration to describe types of saved objects.
      (struct Lisp_Save_Value): New layout.  Adjust comments.
      (XSAVE_POINTER): New macro.
      (XSAVE_INTEGER): Likewise.
      (allocate_misc): Add prototype.
      (free_misc): Likewise.
      * alloc.c (allocate_misc): Now global.
      (free_misc): Likewise.  Adjust comment.
      (make_save_value): Use new Lisp_Save_Value layout.  Adjust comment.
      (free_save_value): Likewise.
      (mark_object): Likewise.
      * editfns.c (save_excursion_save): Pack everything within
      Lisp_Save_Value and so avoid xmalloc.
      (save_excursion_restore): Adjust to match new layout.  Use free_misc
      because we do not allocate extra memory any more.  Add eassert.
      * print.c (print_object): New code to print Lisp_Save_Value.  Do not
      rely on valid_lisp_object_p if !GC_MARK_STACK.  Adjust comments.
      * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
      * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
      Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
      73ebd38f
  30. 01 Jan, 2013 1 commit
  31. 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
  32. 06 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Use bool for booleans in font-related modules. · a864ef14
      Paul Eggert authored
      * font.c (font_intern_prop, font_style_to_value)
      (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
      (generate_otf_features, font_check_otf_features, font_check_otf)
      (font_match_p, font_list_entities, font_at):
      * fontset.c (fontset_id_valid_p, reorder_font_vector
      (fontset_find_font, Fset_fontset_font)
      (face_suitable_for_char_p) [0]:
      * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
      (ftfont_open, ftfont_text_extents, ftfont_check_otf):
      (m17n_flt_initialized, ftfont_shape_by_flt):
      * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
      * nsfont.m (nsfont_draw):
      * w32font.c (w32font_draw):
      * w32term.c (x_draw_glyphless_glyph_string_foreground):
      Use bool for booleans.
      * font.h: Adjust to above API changes.
      (struct font, struct font_driver, struct font_driver_list):
      Use bool for booleans.
      (struct font): Remove useless member encoding_type.
      All users removed.
      * fontset.c, xftfont.c: Omit unnecessary static decls.
      a864ef14
  33. 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
  34. 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
  35. 11 Jul, 2012 1 commit
  36. 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
  37. 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
  38. 13 Jun, 2012 1 commit
    • Paul Eggert's avatar
      USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604) · bfe3e0a2
      Paul Eggert authored
      * alloc.c (make_number) [!defined make_number]:
      Remove, as lisp.h always defines this now.
      (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
      (roundup_size): Verify that it is a power of 2.
      * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
      * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
      * lisp.h (USE_LSB_TAG): Allow the builder to compile with
      -DUSE_LSB_TAG=0, to override the automatically-selected default.
      USE_LSB_TAG now is always defined to be either 0 or 1.
      All uses changed.
      (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
      code works fine either way, and efficiency is not a concern here,
      as the union type is for debugging, not for production.
      (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
      Use an inline function on all platforms when using the union type,
      since this is simpler and 'static inline' can be used portably
      within Emacs now.
      (LISP_INITIALLY_ZERO): New macro.
      (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
      (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
      bfe3e0a2
  39. 19 Mar, 2012 1 commit
  40. 11 Jan, 2012 1 commit