1. 17 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Prefer more inline functions in character.h · 27d10183
      Paul Eggert authored
      * src/buffer.h (fetch_char_advance, fetch_char_advance_no_check)
      (buf_next_char_len, next_char_len, buf_prev_char_len)
      (prev_char_len, inc_both, dec_both): New inline functions,
      replacing the old character.h macros FETCH_CHAR_ADVANCE,
      FETCH_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS, INC_POS, BUF_DEC_POS,
      DEC_POS, INC_BOTH, DEC_BOTH respectively.  All callers changed.
      These new functions all assume buffer primitives and so need
      to be here rather than in character.h.
      * src/casefiddle.c (make_char_unibyte): New static function,
      replacing the old MAKE_CHAR_UNIBYTE macro.  All callers changed.
      (do_casify_unibyte_string): Use SINGLE_BYTE_CHAR_P instead
      of open-coding it.
      * src/ccl.c (GET_TRANSLATION_TABLE): New static function,
      replacing the old macro of the same name.
      * src/character.c (string_char): Omit 2nd arg.  3rd arg can no
      longer be NULL.  All callers changed.
      * src/character.h (SINGLE_BYTE_CHAR_P): Move up.
      (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE, PREV_CHAR_BOUNDARY)
      (STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE)
      (FETCH_STRING_CHAR_ADVANCE)
      (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
      (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
      (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
      (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): Remove.
      (make_char_multibyte): New static function, replacing
      the old macro MAKE_CHAR_MULTIBYTE.  All callers changed.
      (CHAR_STRING_ADVANCE): Remove; all callers changed to use
      CHAR_STRING.
      (NEXT_CHAR_BOUNDARY): Remove; it was unused.
      (raw_prev_char_len): New inline function, replacing the
      old PREV_CHAR_BOUNDARY macro.  All callers changed.
      (string_char_and_length): New inline function, replacing the
      old STRING_CHAR_AND_LENGTH macro.  All callers changed.
      (STRING_CHAR): Rewrite in terms of string_char_and_length.
      (string_char_advance): New inline function, replacing the old
      STRING_CHAR_ADVANCE macro.  All callers changed.
      (fetch_string_char_advance): New inline function, replacing the
      old FETCH_STRING_CHAR_ADVANCE macro.  All callers changed.
      (fetch_string_char_as_multibyte_advance): New inline function,
      replacing the old FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE macro.
      All callers changed.
      (fetch_string_char_advance_no_check): New inline function,
      replacing the old FETCH_STRING_CHAR_ADVANCE_NO_CHECK macro.  All
      callers changed.
      * src/regex-emacs.c (HEAD_ADDR_VSTRING): Remove; no longer used.
      * src/syntax.c (scan_lists): Use dec_bytepos instead of
      open-coding it.
      * src/xdisp.c (string_char_and_length): Rename from
      string_char_and_length to avoid name conflict with new function in
      character.h.  All callers changed.
      27d10183
  2. 01 Jan, 2020 1 commit
  3. 06 Dec, 2019 1 commit
  4. 07 May, 2019 1 commit
    • Stefan Monnier's avatar
      * src/marker.c (buf_bytepos_to_charpos): Re-add the CHAR_HEAD_P assertion · 32cf0781
      Stefan Monnier authored
      This assertion was removed in 1c349c62
      because the assumption was invalid during set_intervals_multibyte_1.
      So we change set_intervals_multibyte_1 to solve the problem in the same
      way as in the rest of Fset_buffer_multibyte, which actually simplifies
      the code.
      
      * src/buffer.c (advance_to_char_boundary): Not static any more.
      * src/buffer.h (advance_to_char_boundary): Add prototype.
      * src/intervals.c (set_intervals_multibyte_1): Use it.
      32cf0781
  5. 05 Mar, 2019 1 commit
  6. 04 Mar, 2019 1 commit
  7. 02 Mar, 2019 1 commit
  8. 31 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Widen modiff counts to avoid wraparound · 05d2fc71
      Paul Eggert authored
      Widen modification counts to at least 64 bits, to make
      wraparound practically impossible.
      * doc/lispref/buffers.texi (Buffer Modification):
      Don’t say the modification-count can wrap around.
      * src/buffer.c (Frestore_buffer_modified_p, Fbuffer_swap_text)
      (modify_overlay):
      * src/insdel.c (insert_1_both, insert_from_string_1)
      (insert_from_gap, insert_from_buffer_1)
      (adjust_after_replace, replace_range, replace_range_2)
      (del_range_2, modify_text):
      * src/textprop.c (modify_text_properties):
      Use modiff_incr instead of incrementing	directly.
      (Fbuffer_modified_tick, Fbuffer_chars_modified_tick):
      Don’t assume modification counts fit into fixnums.
      * src/buffer.h (struct buffer_text, struct buffer):
      * src/cmds.c (internal_self_insert):
      * src/fileio.c (Finsert_file_contents):
      * src/indent.c (last_known_column_modified):
      * src/keyboard.c (command_loop_1):
      * src/marker.c (cached_modiff):
      * src/syntax.c (find_start_modiff, parse_sexp_propertize)
      (find_defun_start):
      * src/window.h (struct window):
      Use modiff_count for modification counts.
      * src/editfns.c (Fsubst_char_in_region):
      Copy instead of incrementing modification counts,
      since integer overflow checking is not needed here.
      * src/lisp.h (modiff_count): New type.
      (modiff_incr, modiff_to_integer): New inline functions.
      * src/pdumper.c (dump_buffer): Update hash.
      05d2fc71
  9. 01 Jan, 2019 1 commit
  10. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, 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/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  11. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  12. 03 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Centralize Bug#30931 fix · 51ee8bc4
      Paul Eggert authored
      * src/marker.c (detach_marker): New function.
      * src/editfns.c (save_restriction_restore):
      * src/insdel.c (signal_before_change): Use it.
      
      (cherry picked from commit 6f66a43d)
      51ee8bc4
  13. 30 Mar, 2018 1 commit
    • Paul Eggert's avatar
      Centralize Bug#30931 fix · 6f66a43d
      Paul Eggert authored
      * src/marker.c (detach_marker): New function.
      * src/editfns.c (save_restriction_restore):
      * src/insdel.c (signal_before_change): Use it.
      6f66a43d
  14. 26 Mar, 2018 3 commits
  15. 01 Jan, 2018 1 commit
  16. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  17. 01 Jan, 2017 1 commit
  18. 06 Sep, 2016 1 commit
    • Eli Zaretskii's avatar
      Avoid assertion violations when using marker positions · 644f77b5
      Eli Zaretskii authored
      * src/intervals.c (set_point_from_marker): If MARKER comes from
      another buffer, recalculate its byte position before using it to
      set point.
      * src/marker.c (set_marker_internal): If POSITION is a marker from
      another buffer, recalculate its byte position before using it.
      (Bug#24368)
      644f77b5
  19. 01 May, 2016 1 commit
  20. 30 Apr, 2016 1 commit
  21. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  22. 01 Jan, 2016 1 commit
  23. 01 Jan, 2015 2 commits
  24. 02 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      * buffer.h (decode_buffer): New function. · 77ea21cd
      Dmitry Antipov authored
      * buffer.c (Fbuffer_name, Fbuffer_file_name, Fbuffer_base_buffer)
      (Fbuffer_local_variables, Fbuffer_modified_p, Fbuffer_modified_tick)
      (Fbuffer_chars_modified_tick, Fdelete_all_overlays):
      * data.c (Flocal_variables_p):
      * fileio.c (Fverify_visited_file_modtime):
      * marker.c (live_buffer): Use it.
      77ea21cd
  25. 01 Jan, 2014 1 commit
  26. 16 Aug, 2013 1 commit
    • Xue Fuqiao's avatar
      Remove documentation of undefined behavior. · 2bede2ed
      Xue Fuqiao authored
      * doc/lispref/positions.texi (Character Motion):
      * doc/lispref/markers.texi (Moving Markers):
      (Creating Markers): Comment out undefined behavior.
      
      * src/marker.c (set_marker): Remove documentation of undefined behavior.
      2bede2ed
  27. 14 Aug, 2013 2 commits
  28. 17 Jun, 2013 1 commit
    • Paul Eggert's avatar
      Use functions, not macros, for XINT etc. · 84575e67
      Paul Eggert authored
      In lisp.h, prefer functions to function-like macros, and
      constants to object-like macros, when either will do.  This:
       . simplifies use, as there's no more need to worry about
         arguments' side effects being evaluated multiple times.
       . makes the code easier to debug on some platforms.
      However, when using gcc -O0, keep using function-like macros
      for a few critical operations, for performance reasons.
      This sort of thing isn't needed with gcc -Og, but -Og
      is a GCC 4.8 feature and isn't widely-enough available yet.
      Also, move functions from lisp.h to individual modules when possible.
      From a suggestion by Andreas Schwab in <http://bugs.gnu.org/11935#68>.
      * alloc.c (XFLOAT_INIT, set_symbol_name):
      * buffer.c (CHECK_OVERLAY):
      * chartab.c (CHECK_CHAR_TABLE, set_char_table_ascii)
      (set_char_table_parent):
      * coding.c (CHECK_NATNUM_CAR, CHECK_NATNUM_CDR):
      * data.c (BOOLFWDP, INTFWDP, KBOARD_OBJFWDP, OBJFWDP, XBOOLFWD)
      (XKBOARD_OBJFWD, XINTFWD, XOBJFWD, CHECK_SUBR, set_blv_found)
      (blv_value, set_blv_value, set_blv_where, set_blv_defcell)
      (set_blv_valcell):
      * emacs.c (setlocale) [!HAVE_SETLOCALE]:
      * eval.c (specpdl_symbol, specpdl_old_value, specpdl_where)
      (specpdl_arg, specpdl_func, backtrace_function, backtrace_nargs)
      (backtrace_args, backtrace_debug_on_exit):
      * floatfns.c (CHECK_FLOAT):
      * fns.c (CHECK_HASH_TABLE, CHECK_LIST_END)
      (set_hash_key_and_value, set_hash_next, set_hash_next_slot)
      (set_hash_hash, set_hash_hash_slot, set_hash_index)
      (set_hash_index_slot):
      * keymap.c (CHECK_VECTOR_OR_CHAR_TABLE):
      * marker.c (CHECK_MARKER):
      * textprop.c (CHECK_STRING_OR_BUFFER):
      * window.c (CHECK_WINDOW_CONFIGURATION):
      Move here from lisp.h, and make these functions static rather than
      extern inline.
      * buffer.c (Qoverlayp):
      * data.c (Qsubrp):
      * fns.c (Qhash_table_p):
      * window.c (Qwindow_configuration_p):
      Now static.
      * lisp.h: Remove the abovementioned defns and decls.
      
      * configure.ac (WARN_CFLAGS): Remove -Wbad-function-cast,
      as it generates bogus warnings about reasonable casts of calls.
      * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]:
      Remove enum lsb_bits; no longer needed.
      (allocate_misc, free_misc): Don't use XMISCTYPE as an lvalue.
      * buffer.c (Qoverlap):
      * data.c (Qsubrp):
      * fns.c (Qhash_table_p):
      Now extern, so lisp.h can use these symbols.
      * dispextern.h: Include character.h, for MAX_CHAR etc.
      (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
      (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
      (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
      (GLYPH_CODE_P): Move here from lisp.h.
      (GLYPH_CHAR, GLYPH_FACE, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
      (GLYPH_CHAR_VALID_P, GLYPH_CODE_P): Now functions, not macros.
      (GLYPH_MODE_LINE_FACE): Now enums, not macros.
      * eval.c (Fautoload): Cast XUNTAG output to intptr_t, since
      XUNTAG now returns void *.
      * lisp.h (lisp_h_XLI, lisp_h_XIL, lisp_h_CHECK_LIST_CONS)
      (lisp_h_CHECK_NUMBER CHECK_SYMBOL, lisp_h_CHECK_TYPE)
      (lisp_h_CONSP, lisp_h_EQ, lisp_h_FLOATP, lisp_h_INTEGERP)
      (lisp_h_MARKERP, lisp_h_MISCP, lisp_h_NILP)
      (lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_CONSTANT_P)
      (lisp_h_SYMBOL_VAL, lisp_h_SYMBOLP, lisp_h_VECTORLIKEP)
      (lisp_h_XCAR, lisp_h_XCDR, lisp_h_XCONS, lisp_h_XHASH)
      (lisp_h_XPNTR, lisp_h_XSYMBOL):
      New macros, renamed from their sans-lisp_h_ counterparts.
      (XLI, XIL, CHECK_LIST_CONS, CHECK_NUMBER CHECK_SYMBOL)
      (CHECK_TYPE, CONSP, EQ, FLOATP, INTEGERP, MARKERP)
      (MISCP, NILP, SET_SYMBOL_VAL, SYMBOL_CONSTANT_P, SYMBOL_VAL, SYMBOLP)
      (VECTORLIKEP, XCAR, XCDR, XCONS, XHASH, XPNTR, XSYMBOL):
      If compiling via GCC without optimization, define these as macros
      in addition to inline functions.
      To disable this, compile with -DINLINING=0.
      (LISP_MACRO_DEFUN, LISP_MACRO_DEFUN_VOID): New macros.
      (check_cons_list) [!GC_CHECK_CONS_LIST]: Likewise.
      (make_number, XFASTINT, XINT, XTYPE, XUNTAG): Likewise, but
      hand-optimize only in the USE_LSB_TAG case, as GNUish hosts do that.
      (INTMASK, VALMASK): Now macros, since static values cannot be
      accessed from extern inline functions.
      (VALMASK): Also a constant, for benefit of old GDB.
      (LISP_INT_TAG_P): Remove; no longer needed as the only caller
      is INTEGERP, which can fold it in.
      (XLI, XIL, XHASH, XTYPE,XINT, XFASTINT, XUINT)
      (make_number, XPNTR, XUNTAG, EQ, XCONS, XVECTOR, XSTRING, XSYMBOL)
      (XFLOAT, XPROCESS, XWINDOW, XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE)
      (XSUB_CHAR_TABLE, XBOOL_VECTOR, make_lisp_ptr, CHECK_TYPE)
      (CHECK_STRING_OR_BUFFER, XCAR, XCDR, XSETCAR, XSETCDR, CAR, CDR)
      (CAR_SAFE, CDR_SAFE, STRING_MULTIBYTE, SDATA, SSDATA, SREF, SSET)
      (SCHARS, STRING_BYTES, SBYTES, STRING_SET_CHARS, STRING_COPYIN, AREF)
      (ASIZE, ASET, CHAR_TABLE_REF_ASCII, CHAR_TABLE_REF)
      (CHAR_TABLE_SET, CHAR_TABLE_EXTRA_SLOTS, SYMBOL_VAL, SYMBOL_ALIAS)
      (SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL, SET_SYMBOL_ALIAS)
      (SET_SYMBOL_BLV, SET_SYMBOL_FWD, SYMBOL_NAME, SYMBOL_INTERNED_P)
      (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P, SYMBOL_CONSTANT_P)
      (XHASH_TABLE, HASH_TABLE_P, CHECK_HASH_TABLE, HASH_KEY, HASH_VALUE)
      (HASH_NEXT, HASH_HASH, HASH_INDEX, HASH_TABLE_SIZE)
      (XMISC, XMISCANY, XMARKER, XOVERLAY, XSAVE_VALUE, XFWDTYPE)
      (XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD, XKBOARD_OBJFWD)
      (XFLOAT_DATA, XFLOAT_INIT, NILP, NUMBERP, NATNUMP)
      (RANGED_INTEGERP, CONSP, FLOATP, MISCP, STRINGP, SYMBOLP)
      (INTEGERP, VECTORLIKEP, VECTORP, OVERLAYP)
      (MARKERP, SAVE_VALUEP, AUTOLOADP, INTFWDP, BOOLFWDP, OBJFWDP)
      (BUFFER_OBJFWDP, KBOARD_OBJFWDP, PSEUDOVECTOR_TYPEP)
      (PSEUDOVECTORP, WINDOW_CONFIGURATIONP, PROCESSP, WINDOWP)
      (TERMINALP, SUBRP, COMPILEDP, BUFFERP, CHAR_TABLE_P)
      (SUB_CHAR_TABLE_P, BOOL_VECTOR_P, FRAMEP, IMAGEP, ARRAYP)
      (CHECK_LIST, CHECK_LIST_CONS, CHECK_LIST_END, CHECK_STRING)
      (CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
      (CHECK_VECTOR, CHECK_VECTOR_OR_STRING, CHECK_ARRAY)
      (CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER, CHECK_WINDOW)
      (CHECK_WINDOW_CONFIGURATION, CHECK_PROCESS, CHECK_SUBR)
      (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, XFLOATINT)
      (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT, CHECK_OVERLAY)
      (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR, CHECK_NATNUM_CAR)
      (CHECK_NATNUM_CDR, FUNCTIONP, SPECPDL_INDEX, LOADHIST_ATTACH)
      Now functions.
      (check_cons_list) [!GC_CHECK_CONS_LIST]: New empty function.
      (LISP_MAKE_RVALUE, TYPEMASK): Remove; no longer needed.
      (VALMASK): Define in one place rather than in two, merging the
      USE_LSB_TAG parts; this is simpler.
      (aref_addr, gc_aset, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM)
      (max, min, struct Lisp_String, UNSIGNED_CMP, ASCII_CHAR_P):
      Move up, to avoid use before definition.
      Also include "globals.h" earlier, for the same reason.
      (make_natnum): New function.
      (XUNTAG): Now returns void *, not intptr_t, as this means fewer casts.
      (union Lisp_Fwd, BOOLFWDP, BOOL_VECTOR_P, BUFFER_OBJFWDP, BUFFERP)
      (CHAR_TABLE_P, CHAR_TABLE_REF_ASCII, CONSP, FLOATP, INTEGERP, INTFWDP)
      (KBOARD_OBJFWDP, MARKERP, MISCP, NILP, OBJFWDP, OVERLAYP, PROCESSP)
      (PSEUDOVECTORP, SAVE_VALUEP, STRINGP, SUB_CHAR_TABLE_P, SUBRP, SYMBOLP)
      (VECTORLIKEP, WINDOWP, Qoverlayp, char_table_ref, char_table_set)
      (char_table_translate, Qarrayp, Qbufferp, Qbuffer_or_string_p)
      (Qchar_table_p, Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp)
      (Qnil, Qnumberp, Qsubrp, Qstringp, Qsymbolp, Qvectorp)
      (Qvector_or_char_table_p, Qwholenump, Ffboundp, wrong_type_argument)
      (initialized, Qhash_table_p, extract_float, Qprocessp, Qwindowp)
      (Qwindow_configuration_p, Qimage): New forward declarations.
      (XSETFASTINT): Simplify by rewriting in terms of make_natnum.
      (STRING_COPYIN): Remove; unused.
      (XCAR_AS_LVALUE, XCDR_AS_LVALUE): Remove these macros, replacing with ...
      (xcar_addr, xcdr_addr): New functions.  All uses changed.
      (IEEE_FLOATING_POINT): Now a constant, not a macro.
      (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
      (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
      (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
      (GLYPH_CODE_P): Move to dispextern.h, to avoid define-before-use.
      (TYPE_RANGED_INTEGERP): Simplify.
      (Qsubrp, Qhash_table_p, Qoverlayp): New extern decls.
      (setlocale, fixup_locale, synchronize_system_messages_locale)
      (synchronize_system_time_locale) [!HAVE_SETLOCALE]:
      Now empty functions, not macros.
      (functionp): Return bool, not int.
      * window.c (Qwindow_configuration_p): Now extern,
      so window.h can use it.
      * window.h (Qwindowp): Move decl back to lisp.h.
      84575e67
  29. 19 Feb, 2013 1 commit
  30. 11 Feb, 2013 1 commit
    • Dmitry Antipov's avatar
      * marker.c (set_marker_internal): If desired position is passed · f74de345
      Dmitry Antipov authored
      as a marker, avoid call to buf_charpos_to_bytepos.
      * window.c (Fset_window_point): Omit redundant type checking.
      (Fset_window_start): Likewise.  Format comment.
      (window_scroll_pixel_based): Use set_marker_restricted_both
      with character and byte positions obtained from an iterator.
      (Fset_window_configuration): Use set_marker_restricted_both.
      * xdisp.c (message_dolog): Likewise.
      f74de345
  31. 01 Jan, 2013 1 commit
  32. 20 Dec, 2012 1 commit
    • Dmitry Antipov's avatar
      Avoid calls to CHAR_TO_BYTE if byte position is known. · 13002885
      Dmitry Antipov authored
      * editfns.c (make_buffer_string_both): Use move_gap_both.
      (Fbuffer_string): Use make_buffer_string_both.
      * marker.c (buf_charpos_to_bytepos): Convert to eassert.
      Adjust comment.
      (buf_bytepos_to_charpos): Likewise.
      (charpos_to_bytepos): Remove.
      * fileio.c (Finsert_file_contents): Use move_gap_both.
      * search.c (Freplace_match): Likewise.
      * process.c (process_send_region): Likewise. Use convenient
      names for byte positions.
      * lisp.h (charpos_to_bytepos): Remove prototype.
      * indent.c (scan_for_column): Use CHAR_TO_BYTE.
      * insdel.c (move_gap): Likewise.
      13002885
  33. 11 Oct, 2012 2 commits
    • Paul Eggert's avatar
      lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans. · 7cded46f
      Paul Eggert authored
      * lread.c (load_each_byte, new_backquote_flag, readchar)
      (read_filtered_event, lisp_file_lexically_bound_p)
      (safe_to_load_version, Fload, complete_filename_p, openp)
      (build_load_history, readevalloop, read_escape, read1)
      (string_to_number, read_vector, read_list):
      * macros.c (Fstart_kbd_macro):
      * marker.c (CONSIDER):
      * menu.c (parse_single_submenu, digest_single_submenu)
      (find_and_return_menu_selection, Fx_popup_menu):
      * minibuf.c (read_minibuf_noninteractive, read_minibuf)
      (Ftry_completion):
      * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
      (ns_menu_show):
      * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
      (xmenu_show, xdialog_show):
      Use bool for booleans.
      * lread.c (safe_to_load_version): Rename from safe_to_load_p,
      as it's not a predicate.  All uses changed.  Omit unnecessary
      buffer termination.
      7cded46f
    • Paul Eggert's avatar
      fd2f90cf
  34. 01 Oct, 2012 1 commit
    • Paul Eggert's avatar
      Prefer plain 'static' to 'static inline'. · b0ab8123
      Paul Eggert authored
      With static functions, modern compilers inline pretty well by
      themselves; advice from programmers often hurts as much as it helps.
      On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
      this change shrinks the text size of the Emacs executable by 1.1%
      without affecting CPU significantly in my benchmark.
      * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
      (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
      (mark_maybe_object, mark_maybe_pointer, bounded_number):
      * 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, set_buffer_overlays_before)
      (set_buffer_overlays_after):
      * category.c (bset_category_table):
      * charset.c (read_hex):
      * coding.c (produce_composition, produce_charset)
      (handle_composition_annotation, handle_charset_annotation)
      (char_encodable_p):
      * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
      (assign_row, set_frame_matrix_frame, make_current)
      (add_row_entry):
      * eval.c (set_specpdl_symbol, set_specpdl_old_value):
      * fns.c (maybe_resize_hash_table):
      * frame.c (fset_buffer_predicate, fset_minibuffer_window):
      * gmalloc.c (register_heapinfo):
      * image.c (lookup_image_type):
      * intervals.c (set_interval_object, set_interval_left)
      (set_interval_right, copy_interval_parent, rotate_right)
      (rotate_left, balance_possible_root_interval):
      * keyboard.c (kset_echo_string, kset_kbd_queue)
      (kset_keyboard_translate_table, kset_last_prefix_arg)
      (kset_last_repeatable_command, kset_local_function_key_map)
      (kset_overriding_terminal_local_map, kset_real_last_command)
      (kset_system_key_syms, clear_event, set_prop):
      * lread.c (digit_to_number):
      * marker.c (attach_marker, live_buffer, set_marker_internal):
      * nsterm.m (ns_compute_glyph_string_overhangs):
      * process.c (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):
      * syntax.c (bset_syntax_table, dec_bytepos):
      * terminal.c (tset_param_alist):
      * textprop.c (interval_has_some_properties)
      (interval_has_some_properties_list):
      * window.c (wset_combination_limit, wset_dedicated)
      (wset_display_table, wset_hchild, wset_left_fringe_width)
      (wset_left_margin_cols, wset_new_normal, wset_new_total)
      (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
      (wset_right_fringe_width, wset_right_margin_cols)
      (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
      (wset_vertical_scroll_bar_type, wset_window_parameters):
      * xdisp.c (wset_base_line_number, wset_base_line_pos)
      (wset_column_number_displayed, wset_region_showing)
      (window_box_edges, run_window_scroll_functions)
      (append_glyph_string_lists, prepend_glyph_string_lists)
      (append_glyph_string, set_glyph_string_background_width)
      (append_glyph, append_composite_glyph)
      (take_vertical_position_into_account):
      * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
      (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
      (lface_hash, lface_same_font_attributes_p, lookup_face):
      * xml.c (libxml2_loaded_p):
      * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
      (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
      Now 'static', not 'static inline'.
      
      Fixes: debbugs:12541
      b0ab8123
  35. 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