1. 27 Apr, 2020 2 commits
    • Paul Eggert's avatar
      Improve multibyte_length performance · e49d3a45
      Paul Eggert authored
      * src/character.h (multibyte_length):
      Merge tests so that there are fewer conditional branches.
      This improved CPU speed of ‘make compile-always’
      by about 1.5% on my platform.
      e49d3a45
    • Paul Eggert's avatar
      Improve string_char_and_length speed · ed2def7d
      Paul Eggert authored
      This tweak improved the CPU time performance of
      ‘make compile-always’ by about 1.7% on my platform.
      * src/character.c (string_char): Remove; no longer used.
      * src/character.h (string_char_and_length): Redo so that it
      needn’t call string_char.  This helps the caller, which can now
      become a leaf function.
      ed2def7d
  2. 21 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Fix string-to-multibyte overlong sequence bug · c88a3be8
      Paul Eggert authored
      * src/character.h (MULTIBYTE_LENGTH, MULTIBYTE_LENGTH_NO_CHECK):
      Remove, replacing with ...
      (multibyte_length): ... this new function.  All callers changed.
      The new function rejects overlong multibyte forms.
      * test/src/buffer-tests.el (buffer-multibyte-overlong-sequences):
      New test.
      c88a3be8
  3. 17 Apr, 2020 2 commits
    • 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
    • Paul Eggert's avatar
      Prefer inline functions in character.h · 3e46a231
      Paul Eggert authored
      In character.h, replace macros with inline functions or enums
      when this is easy.  This improves maintainability and
      on my platform (Fedora 31 x86-64, gcc -O2) improved CPU
      performance very slightly (0.3%) on ‘make compile-always’.
      * src/buffer.h (SANE_TAB_WIDTH, CHARACTER_WIDTH):
      Move here from character.h, and make them inline functions.
      Tune CHARACTER_WIDTH so that ASCII_CHAR_WIDTH is no longer needed.
      (sanitize_tab_width, sanitize_char_width):
      Move here from character.h.
      * src/character.h (MAX_CHAR, MAX_UNICODE_CHAR, MAX_1_BYTE_CHAR)
      (MAX_2_BYTE_CHAR, MAX_3_BYTE_CHAR, MAX_4_BYTE_CHAR)
      (MAX_5_BYTE_CHAR, MIN_MULTIBYTE_LEADING_CODE)
      (MAX_MULTIBYTE_LEADING_CODE, MAX_MULTIBYTE_LENGTH):
      Now enum constants instead of macros.
      * src/character.h (CHAR_BYTES): Redo to avoid conditional branches.
      (CHAR_BYTE8_P, BYTE8_TO_CHAR, UNIBYTE_TO_CHAR, CHAR_TO_BYTE8)
      (CHAR_TO_BYTE_SAFE, CHAR_BYTE8_HEAD_P, CHARACTERP)
      (CHECK_CHARACTER, CHECK_CHARACTER_CAR, CHECK_CHARACTER_CDR)
      (CHAR_PRINTABLE_P, CHAR_BYTES, CHAR_LEADING_CODE, BYTE8_STRING)
      (LEADING_CODE_P, TRAILING_CODE_P, CHAR_HEAD_P)
      (BYTES_BY_CHAR_HEAD):
      Now inline functions instead of macros.
      (ASCII_CHAR_WIDTH): Remove; no longer used.
      * src/conf_post.h (ATTRIBUTE_PURE): New macro.
      * src/lisp.h (char_table_ref): Use it, for better inlining.
      * src/fns.c (base64_decode_1): Add now-necessary casts.
      3e46a231
  4. 12 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Remove UNSIGNED_CMP · 43282a67
      Paul Eggert authored
      I added this macro in 2011 to fix some signedness comparison bugs.
      However, it’s a weird macro and the bugs can be fixed in a
      more-straightforward way.  This helps performance slightly (0.5%) on my
      platform (Fedora 31 x86-64, GCC 9.3.1 with -O2).
      * src/casefiddle.c (do_casify_natnum): Use simple comparison
      instead of UNSIGNED_CMP.
      * src/character.h (CHAR_VALID_P, SINGLE_BYTE_CHAR_P, CHAR_STRING):
      * src/composite.h (COMPOSITION_ENCODE_RULE_VALID):
      * src/lisp.h (ASCII_CHAR_P):
      Now an inline function, and uses simple comparison instead of
      UNSIGNED_CMP.
      * src/dispextern.h (FACE_FROM_ID, FACE_FROM_ID_OR_NULL)
      (IMAGE_FROM_ID, IMAGE_OPT_FROM_ID): Move these to ...
      * src/frame.h (FACE_FROM_ID, FACE_FROM_ID_OR_NULL)
      (IMAGE_FROM_ID, IMAGE_OPT_FROM_ID): ... here, and make them
      inline functions that no longer use UNSIGNED_CMP.
      * src/keyboard.c (read_char): UNSIGNED_CMP is not needed here
      since XFIXNAT always returns a nonnegative value.
      * src/lisp.h (UNSIGNED_CMP): Remove; no longer used.
      43282a67
  5. 28 Nov, 2019 1 commit
    • Noam Postavsky's avatar
      Stop signaling an error when reading "smart quotes" in symbols · 85f586f3
      Noam Postavsky authored
      Revert commits from 2018-01-28 "Fix round tripping of read->print for
      symbols with strange quotes", and 2017-07-22 "Signal error for symbol
      names with strange quotes (Bug#2967)".
      * etc/NEWS: Remove corresponding entries.
      * src/character.c (confusable_symbol_character_p):
      * test/src/lread-tests.el (lread-tests--old-style-backquotes): Remove.
      * src/lread.c (read1): Don't signal error on confusable character.
      * src/print.c (print_object): Don't escape confusable characters.
      85f586f3
  6. 15 Nov, 2019 1 commit
    • Paul Eggert's avatar
      Port hexdigit init to non-GCC + pdumper · e68912ea
      Paul Eggert authored
      The old code assumed that hexdigit initialization (needed by
      non-GCC) could be done in syms_of_character, but that is no longer
      true with pdumper.  Instead, simplify hexdigit init so that it can
      be done statically on all C99 platforms.  Problem discovered on
      Solaris 10 sparc + Oracle Solaris Studio 12.6.
      * src/character.c (hexdigit): Add 1 to every value; all uses
      changed.  This simplifies the initialization so that it can be
      done statically on any C99 compiler.  hexdigit is now always const.
      (syms_of_character): Omit no-longer-necessary initialization.
      * src/character.h (HEXDIGIT_CONST, HEXDIGIT_IS_CONST):
      Remove.  All uses removed.
      e68912ea
  7. 22 May, 2019 1 commit
    • Paul Eggert's avatar
      Remove fixnum restriction on some display vars · dfed333b
      Paul Eggert authored
      This is a minor patch to remove some fixnum restrictions.
      Many more such patches are needed, but one thing at a time.
      * doc/emacs/custom.texi (Examining): Update fill-column example.
      * src/buffer.c (fill-column, left-margin, tab-width)
      (buffer-saved-size, left-margin-width, right-margin-width)
      (left-fringe-width, right-fringe-width, scroll-bar-width)
      (scroll-bar-height, buffer-display-count):
      Allow any integer; do not restrict to fixnums.
      * src/character.h (SANE_TAB_WIDTH): Do not assume tab_width
      is a nonnegative fixnum.
      (sanitize_tab_width): Take a Lisp_Object integer, not an
      EMACS_INT.  Only use changed.
      * src/data.c (store_symval_forwarding): Remove unnecessary
      SYMBOLP since the predicate (e.g., Qintegerp) is always a
      symbol (leave the test in as an eassert).  Avoid assignments
      inside if-conditions.
      * src/fileio.c (Fdo_auto_save): Do not assume
      buffer-saved-size is a fixnum.  Avoid undefined behavior
      on EMACS_INT overflow by multiplying a fixnum by at most 4,
      not by at most 13.
      * src/window.c (set_window_buffer): When buffer-display-count
      is too large for a fixnum, make it a bignum.
      * src/xdisp.c (FILL_COLUMN_INDICATOR_NEEDED): Remove macro, ...
      (fill_column_indicator_column): ... replacing with this new function.
      All uses changed.  The function is a bit pickier, to prevent
      problems with non-character fixnums and columns out of range
      for int, and to remove the assumption that integers are in
      fixnum range.
      (append_space_for_newline, extend_face_to_end_of_line):
      Avoid undefined behavior with signed integer overflow.
      Simplify.
      dfed333b
  8. 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
  9. 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
  10. 15 Jun, 2018 1 commit
    • Eli Zaretskii's avatar
      Reject invalid 5-byte sequences when detecting UTF-8 encoding · 22aa665c
      Eli Zaretskii authored
      * src/coding.c (detect_coding_utf_8): Reject multibyte sequences
      whose leading byte is greater than MAX_MULTIBYTE_LEADING_CODE.
      (Bug#31829)
      * src/character.h (MAX_MULTIBYTE_LEADING_CODE): Add commentary
      about the connection between the value of this macro and MAX_CHAR.
      22aa665c
  11. 16 Feb, 2018 1 commit
  12. 28 Jan, 2018 1 commit
    • Noam Postavsky's avatar
      Fix round tripping of read->print for symbols with strange quotes · 36c8128e
      Noam Postavsky authored
      Since 2017-07-22 "Signal error for symbol names with strange
      quotes (Bug#2967)", symbol names beginning with certain quote
      characters require an escaping backslash.  However, the corresponding
      change for printing missed, so that (eq (read (prin1-to-string SYM))
      SYM) does not give `t' for such symbols.
      * src/character.c (confusable_symbol_character_p): New function,
      extracted from test `read1'.
      * src/lread.c (read1): Use it.
      * src/print.c (print_object): Use it to print a backslash for symbols
      starting with characters that `read1' requires to be escaped.
      * test/src/print-tests.el (print-read-roundtrip): New test.
      * etc/NEWS.26:
      * etc/NEWS: Clarify the announcement for the earlier reader
      change (Bug#30217).
      36c8128e
  13. 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
  14. 06 Jul, 2017 1 commit
    • Paul Eggert's avatar
      Convert hex digits more systematically · d6662694
      Paul Eggert authored
      This makes the code a bit smaller and presumably faster, as
      it substitutes a single lookup for conditional jumps.
      * src/character.c (hexdigit): New constant.
      (syms_of_character) [HEXDIGIT_IS_CONST]: Initialize it.
      * src/character.h (HEXDIGIT_CONST, HEXDIGIT_IS_CONST): New macros.
      (hexdigit): New decl.
      (char_hexdigit): New inline function.
      * src/charset.c: Do not include c-ctype.h.
      * src/charset.c (read_hex):
      * src/editfns.c (styled_format):
      * src/image.c (xbm_scan):
      * src/lread.c (read_escape):
      * src/regex.c (ISXDIGIT) [emacs]:
      Use char_hexdigit insted of doing it by hand.
      d6662694
  15. 06 Jan, 2017 1 commit
    • Philipp Stephani's avatar
      Add support for Unicode whitespace in [:blank:] · 512e9886
      Philipp Stephani authored
      See Bug#25366.
      
      * src/character.c (blankp): New function for checking Unicode
      horizontal whitespace.
      * src/regex.c (ISBLANK): Use 'blankp' for non-ASCII horizontal
      whitespace.
      (BIT_BLANK): New bit for range table.
      (re_wctype_to_bit, execute_charset): Use it.
      * test/lisp/subr-tests.el (subr-tests--string-match-p--blank): Add
      unit test for [:blank:] character class.
      * test/src/regex-tests.el (test): Adapt unit test.
      * doc/lispref/searching.texi (Char Classes): Document new Unicode
      behavior for [:blank:].
      512e9886
  16. 23 Sep, 2016 1 commit
  17. 13 Sep, 2016 1 commit
  18. 09 Sep, 2016 2 commits
    • Michal Nazarewicz's avatar
      Replace decimalnump with alphanumericp · c579b28f
      Michal Nazarewicz authored
      decimalnump was used in regex.c only in ISALNUM macro which ored it with
      alphabeticp.  Because both of those functions require Unicode general
      category lookup, this resulted in unnecessary lookups (if alphabeticp
      return false decimalp had to perform another lookup).  Drop decimalnump
      in favour of alphanumericp which combines decimelnump with alphabeticp.
      
      * src/character.c (decimalnump): Remove in favour of…
      (alphanumericp): …new function.
      
      * src/regex.c (ISALNUM): Use alphanumericp.
      c579b28f
    • Michal Nazarewicz's avatar
      STRING_CHAR does not unify characters; update documentation · 3ffc5f44
      Michal Nazarewicz authored
      * src/character.h (STRING_CHAR): Update doc.
      * src/buffer.h (FETCH_MULTIBYTE_CHAR): Update doc.  While at it, change
      the function to use BYTE_POS_ADDR instead of open-coding it.
      3ffc5f44
  19. 18 Aug, 2016 1 commit
    • Eli Zaretskii's avatar
      Improve commentary in src/character.h · 37d4723f
      Eli Zaretskii authored
      * src/character.h (BYTES_BY_CHAR_HEAD, MULTIBYTE_LENGTH)
      (MULTIBYTE_LENGTH_NO_CHECK, STRING_CHAR_AND_LENGTH): Remove stale
      info from commentary and improve it.
      37d4723f
  20. 22 Apr, 2016 1 commit
    • Paul Eggert's avatar
      Improve character name escapes · bd1c7ca6
      Paul Eggert authored
      * doc/lispref/nonascii.texi (Character Properties):
      Avoid duplication of Unicode names.  Reformat examples to fit in
      narrow pages.
      * doc/lispref/objects.texi (General Escape Syntax):
      Simplify and better-organize explanation of \N{...} escapes.
      * src/character.h (CHAR_SURROGATE_PAIR_P): Remove; unused.
      (char_surrogate_p): New inline function.
      * src/lread.c: Do not include string.h; no longer needed.
      (invalid_character_name, check_scalar_value): Remove; the ideas
      behind these functions are now bundled into character_name_to_code.
      (character_name_to_code): Remove undocumented support for "CJK
      IDEOGRAPH-XXXX" names, as "U+XXXX" suffices.  Reject monstrosities
      like "\N{U+-0}" and null bytes in \N escapes.  Reject floating
      point in \N escapes instead of returning garbage.  Use
      AUTO_STRING_WITH_LEN to lessen pressure on the garbage collector.
      * test/src/lread-tests.el (lread-char-number, lread-char-name)
      (lread-string-char-number, lread-string-char-name):
      Test runtime behavior, not compile-time, as the test framework
      is not set up to test compile-time.
      (lread-char-surrogate-1, lread-char-surrogate-2)
      (lread-char-surrogate-3, lread-char-surrogate-4)
      (lread-string-char-number-2, lread-string-char-number-3):
      New tests.
      (lread-string-char-number-1): Rename from lread-string-char-number.
      bd1c7ca6
  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. 31 Dec, 2015 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Avoid writing to purespace · 47580e0d
      YAMAMOTO Mitsuharu authored
      * src/alloc.c (Fmake_string): Don't write to empty string contents.
      (allocate_vector): Don't write to empty vector size.
      * src/character.h (CHECK_CHARACTER_CAR, CHECK_CHARACTER_CDR):
      Don't call unnecessary XSETCAR or XSETCDR.
      * src/lisp.h (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE): Don't
      write to empty string size_byte.
      47580e0d
  23. 16 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Make src headers idempotent and standalone · 55ba8c02
      Paul Eggert authored
      Redo src/*.h so that each include file is idempotent (that is, can
      be included multiple times with the latter inclusions having no
      effect) and standalone (that is, can be included by itself,
      with no include file other than config.h needed as a prerequisite).
      This is standard practice in GNU programs nowadays.
      * lwlib/lwlib-widget.h, src/buffer.h, src/category.h, src/character.h:
      * src/charset.h, src/coding.h, src/commands.h, src/disptab.h:
      * src/fontset.h, src/gnutls.h, src/indent.h, src/keymap.h, src/macros.h:
      * src/regex.h [emacs]:
      * src/syntax.h, src/systty.h, src/termhooks.h:
      Include lisp.h, for Lisp_Object.
      * src/buffer.h, src/category.h, src/cm.h, src/commands.h, src/disptab.h:
      * src/indent.h, src/intervals.h, src/keyboard.h, src/macros.h:
      * src/process.h, src/puresize.h, src/region-cache.h, src/syntax.h:
      * src/syssignal.h, src/sysstdio.h, src/systty.h, src/termchar.h:
      * src/termopts.h, src/tparam.h, src/unexec.h:
      Protect against multiple inclusion.
      * src/buffer.h: Include character.h, for STRING_CHAR.
      * src/emacsgtkfixed.h (struct frame):
      * src/fontset.h (struct face):
      * src/region-cache.h (struct buffer):
      * src/termhooks.h (struct glyph):
      * src/xsettings.h (struct x_display_info):
      Add possibly-forward decl.
      * src/syntax.h: Include buffer.h, for BVAR.
      * src/sysselect.h: Include lisp.h, for eassume.
      * src/termchar.h: Include <stdio.h>, for FILE.
      * src/widget.h: Include <X11/IntrinsicP.h>, for Widget.
      * src/xsettings.h: Include <X11/Xlib.h>, for XEvent.
      55ba8c02
  24. 14 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Prefer ‘format’ to ‘substitute-command-keys’ · 6af5aad2
      Paul Eggert authored
      * src/character.h (uLSQM, uRSQM): Move here ...
      * src/doc.c (uLSQM, uRSQM): ... from here.
      * src/doc.c (Fsubstitute_command_keys):
      * src/syntax.c (Finternal_describe_syntax_value):
      * lisp/cedet/mode-local.el (mode-local-print-binding)
      (mode-local-describe-bindings-2):
      * lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
      * lisp/cus-theme.el (describe-theme-1):
      * lisp/descr-text.el (describe-text-properties-1, describe-char):
      * lisp/emacs-lisp/cl-extra.el (cl--describe-class):
      * lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
      * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
      * lisp/emacs-lisp/package.el (describe-package-1):
      * lisp/faces.el (describe-face):
      * lisp/help-fns.el (help-fns--key-bindings)
      (help-fns--compiler-macro, help-fns--parent-mode)
      (help-fns--obsolete, help-fns--interactive-only)
      (describe-function-1, describe-variable):
      * lisp/help.el (describe-mode):
      Prefer ‘format’ to ‘substitute-command-keys’ when either will do
      to implement quoting style.  This generally makes the code simpler.
      6af5aad2
  25. 11 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Give names to Unicode code points in C code · d6640d6e
      Paul Eggert authored
      * src/character.h (NO_BREAK_SPACE, SOFT_HYPHEN)
      (ZERO_WIDTH_NON_JOINER, ZERO_WIDTH_JOINER, HYPHEN)
      (NON_BREAKING_HYPHEN, LEFT_SINGLE_QUOTATION_MARK)
      (RIGHT_SINGLE_QUOTATION_MARK, PARAGRAPH_SEPARATOR)
      (LEFT_POINTING_ANGLE_BRACKET, RIGHT_POINTING_ANGLE_BRACKET)
      (LEFT_ANGLE_BRACKET, RIGHT_ANGLE_BRACKET)
      (OBJECT_REPLACEMENT_CHARACTER):
      New named constants for Unicode code points.
      * src/bidi.c (bidi_fetch_char, CANONICAL_EQU):
      * src/composite.c (char_composable_p):
      * src/lread.c (readevalloop, read1):
      * src/xdisp.c (get_next_display_element):
      Use them.
      * src/doc.c (LEFT_SINGLE_QUOTATION_POINT):
      Remove; now in character.h.
      d6640d6e
  26. 15 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Make [:graph:] act like [:print:] sans space · a122a027
      Paul Eggert authored
      In POSIX [[:print:]] is equivalent to [ [:graph:]], so change
      [:graph:] so that it matches everything that [:print:] does,
      except for space.
      * doc/lispref/searching.texi (Char Classes):
      * etc/NEWS:
      * lisp/emacs-lisp/rx.el (rx):
      Document [:graph:] to be [:print:] sans ' '.
      * src/character.c, src/character.h (graphicp): New function.
      * src/regex.c (ISGRAPH) [emacs]: Use it.
      (BIT_GRAPH): New macro.
      (BIT_PRINT): Increase to 0x200, to make room for BIT_GRAPH.
      (re_wctype_to_bit) [! WIDE_CHAR_SUPPORT]:
      Return BIT_GRAPH for RECC_GRAPH.
      (re_match_2_internal) [emacs]: Use ISGRAPH if BIT_GRAPH,
      and ISPRINT if BIT_PRINT.
      a122a027
  27. 14 Apr, 2015 1 commit
    • Eli Zaretskii's avatar
      Make [:print:] support non-ASCII characters correctly · 6c284c6b
      Eli Zaretskii authored
      * src/regex.c (ISPRINT): Call 'printablep' for multibyte characters.
      (BIT_PRINT): New bit mask.
      (re_wctype_to_bit): Return BIT_PRINT for RECC_PRINT.
      * src/character.c (printablep): New function.
      * src/character.h (printablep): Add prototype.
      
      * lisp/emacs-lisp/rx.el (rx): Doc fix: document the new behavior
      of 'print', 'alnum', and 'alphabetic'.
      
      * doc/lispref/searching.texi (Char Classes): Document the new
      behavior of [:print:].
      
      * etc/NEWS: Mention the new behavior of [:print:].
      6c284c6b
  28. 28 Feb, 2015 1 commit
    • Eli Zaretskii's avatar
      Improve [:alpha:] and [:alnum:] for multibyte characters (Bug#19878) · 1a50945f
      Eli Zaretskii authored
       src/character.c (alphabeticp, decimalnump): New functions.
       src/character.h (alphabeticp, decimalnump): Add prototypes.
       src/regex.c (ISALNUM, ISALPHA): Check Unicode character properties
       for multibyte characters by calling alphabeticp and decimalnump.
       (BIT_ALPHA, BIT_ALNUM): New bit masks.
       (re_wctype_to_bit): Return them when the class is RECC_ALPHA or
       RECC_ALNUM.
       (re_match_2_internal): Call ISALPHA and ISALNUM when appropriate.
      
       doc/lispref/searching.texi (Char Classes): Update the documentation of
       [:alpha:] and [:alnum:].
      
       etc/NEWS: Mention the changes in [:alpha:] and [:alnum:].
      1a50945f
  29. 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.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  30. 09 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      Add macros to allocate temporary Lisp objects with alloca. · c7dfea94
      Dmitry Antipov authored
      Respect MAX_ALLOCA and fall back to regular GC for large objects.
      * character.h (parse_str_as_multibyte): Move prototype to ...
      * lisp.h (parse_str_as_multibyte): ... here.
      (struct Lisp_Cons): Add GCALIGNED attribute if supported.
      (scoped_cons, scoped_list2, build_local_vector, build_local_string):
      New macros.
      (scoped_cons_init, pointer_valid_for_lisp_object, local_vector_init)
      (local_string_init): New functions.
      * alloc.c (verify_alloca) [ENABLE_CHECKING]: New function.
      (init_alloc_once): Call it.
      c7dfea94
  31. 08 Jul, 2014 1 commit
    • Dmitry Antipov's avatar
      * chartab.c (char_table_translate): Move to... · f298de52
      Dmitry Antipov authored
      * character.h (char_table_translate): ... inline function here.
      Avoid Faref and assume that args are always valid.  This helps to
      speedup search, which is especially important for a huge buffers.
      * lisp.h (char_table_translate): Remove prototype.
      f298de52
  32. 23 Jun, 2014 1 commit
    • Dmitry Antipov's avatar
      Simplify and cleanup character conversion stuff. · 200fc949
      Dmitry Antipov authored
      * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe):
      Remove prototypes.
      * character.c (multibyte_char_to_unibyte)
      (multibyte_char_to_unibyte_safe): Remove; no longer used.
      * character.h (make_char): Remove; unused.
      (CHAR_TO_BYTE8, CHAR_TO_BYTE_SAFE): Simplify.
      (ASCII_BYTE_P): Remove; ASCII_CHAR_P does the same thing.
      * buffer.c, charset.c, charset.h, cmds.c, coding.c, editfns.c:
      * fileio.c, indent.c, insdel.c, keyboard.c, lread.c, print.c:
      * search.c, term.c, xdisp.c, xterm.c: Related users changed.
      200fc949
  33. 14 Feb, 2014 1 commit
  34. 14 Dec, 2013 1 commit
    • Paul Eggert's avatar
      Use bool for boolean, focusing on headers. · 96c06863
      Paul Eggert authored
      * configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK):
      Use bool for boolean.
      * lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE):
      Remove.  All uses replaced with uncapitalized version.
      * lib-src/emacsclient.c (message):
      * lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names):
      * lib-src/hexl.c (un_flag, iso_flag, endian):
      * lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next)
      (pop_trash):
      Use bool for boolean.
      * lib-src/etags.c (bool): Remove.
      * lib-src/etags.c (globals, members, declarations, no_line_directive)
      (no_duplicates): Use 'int' for boolean values that getopt requires
      to be 'int'.  Formerly, these were 'bool' and 'bool' was 'int',
      but we can no longer rely on this implementation.
      * lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields.
      * lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields.
      * src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c:
      No need to include <stdbool.h>, since conf_post.h does it now.
      * src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION)
      (BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P)
      (SET_PER_BUFFER_VALUE_P):
      * src/ccl.c, src/ccl.h (setup_ccl_program):
      * src/ccl.h (CHECK_CCL_PROGRAM):
      * src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR)
      (CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY)
      (PREV_CHAR_BOUNDARY, 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):
      * src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
      (CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET)
      (CHARSET_FAST_MAP_SET):
      * src/coding.c (decode_coding_ccl, encode_coding_ccl):
      * src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC)
      (CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2)
      (JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE)
      (ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8)
      (decode_coding_c_string):
      * src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE):
      * src/conf_post.h (has_attribute):
      * src/dispextern.h (trace_redisplay_p):
      (INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE)
      (SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH)
      (SET_GLYPH_FROM_CHAR_GLYPH):
      (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P)
      (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P)
      (PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p)
      (cursor_in_mouse_face_p):
      * src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows)
      (blank_row, prepare_desired_row)
      (build_frame_matrix_from_leaf_window, make_current)
      (mirror_make_current, mirrored_line_dance, mirror_line_dance)
      (update_window, scrolling_window, update_frame_line):
      * src/disptab.h (GLYPH_FOLLOW_ALIASES):
      * src/editfns.c (Fformat):
      * src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC)
      (FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE)
      (FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC)
      (FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC)
      (FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY)
      (CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG)
      (FONT_DEFERRED_LOG):
      * src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P):
      (FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME)
      (FRAME_MOUSE_UPDATE):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask)
      (x_create_bitmap_from_xpm_data, xpm_load_image):
      * src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT)
      (set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE)
      (MERGE_INTERVAL_CACHE):
      * src/keymap.h (KEYMAPP):
      * src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE)
      (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP)
      (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER)
      (CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER)
      (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
      (DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT)
      (RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE)
      (SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp):
      * src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX)
      (UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
      (SETUP_BUFFER_SYNTAX_TABLE):
      * src/systime.h (timespec_valid_p):
      * src/term.c (save_and_enable_current_matrix):
      * src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P):
      * src/xdisp.c (in_display_vector_p, display_tool_bar_line)
      (redisplay_internal, try_window_reusing_current_matrix)
      (sync_frame_with_window_matrix_rows, try_window_id)
      (display_menu_bar, display_tty_menu_item, display_mode_line)
      (coords_in_mouse_face_p, cursor_in_mouse_face_p):
      * src/xmenu.c (xmenu_show):
      * src/xterm.c (use_xim, x_term_init):
      * src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET)
      (struct x_bitmap_record):
      Use bool for booleans.
      * src/ccl.c (struct buffer_text):
      * src/ccl.h (struct ccl_program):
      * src/charset.h (struct charset):
      * src/cm.h (struct cm):
      * src/coding.h (struct iso_2022_spec, struct coding_system):
      * src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row)
      (struct glyph_string, struct face, struct face_cache)
      (struct bidi_string_data, struct bidi_it)
      (struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo)
      (struct image):
      * src/editfns.c (Fformat):
      * src/frame.h (struct frame):
      * src/fringe.c (struct fringe_bitmap):
      * src/intervals.h (struct interval):
      * src/keyboard.h (struct kboard):
      * src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker)
      (struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free)
      (struct Lisp_Buffer_Local_Value, union specbinding):
      * src/macfont.m (struct macfont_info):
      * src/process.h (struct Lisp_Process):
      * src/termchar.h (struct tty_display_info):
      * src/window.h (struct window):
      * src/xterm.h (struct x_output):
      Use bool_bf for boolean bit-fields.
      * src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0.
      All callers changed.
      * src/ccl.h (struct ccl_program): Remove unused members private_state,
      src_multibyte, dst_multibyte, cr_consumed, suppress_error,
      eight_bit_control.
      (struct ccl_spec): Remove unused members cr_carryover,
      eight_bit_carryover.
      * src/conf_post.h: Include <stdbool.h>.
      (bool_bf): New type.
      * src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
      * src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
      Surround statement macro with proper 'do { ... } while (false)' brackets.
      (SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool.
      (PRODUCE_GLYPHS): Simplify use of boolean.
      * src/fileio.c (Fcopy_file):
      If I is an integer, prefer 'if (I != 0)' to 'if (I)'.
      * src/lisp.h (UNGCPRO): Return void, not int.
      (FOR_EACH_TAIL): Use void expression, not int expression.
      * src/region-cache.c: Reindent.
      * src/region-cache.h: Copy comments from region-cache.c, to fix
      incorrect remarks about booleans.
      96c06863
  35. 04 Nov, 2013 1 commit
    • Paul Eggert's avatar
      Port to stricter C99 platforms. · 91f2d272
      Paul Eggert authored
      Especially, C99 prohibits nesting a struct X inside struct Y if
      struct X has a flexible array member.
      Also, merge from gnulib, incorporating:
      2013-11-03 intprops: port to Oracle Studio c99
      * lib/intprops.h: Update from gnulib.
      * src/alloc.c (struct sdata): New type.
      (sdata): Implement in terms of struct sdata.
      Remove u member; all uses replaced by next_vector, set_next_vector.
      (SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change.
      (SDATA_DATA_OFFSET): Now a constant, not a macro.
      (struct sblock): Rename first_data member to data, which is now
      a flexible array member.  All uses changed.
      (next_vector, set_next_vector, large_vector_vec): New functions.
      (vector_alignment): New constant.
      (roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too.
      (struct large-vector): Now merely a NEXT member, since the old approach
      ran afoul of stricter C99.  All uses changed to use
      large_vector_vec or large_vector_offset.
      (large_vector_offset): New constant.
      * src/dispnew.c: Include tparam.h, for tgetent.
      Do not include term.h; no longer needed.
      * src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn.
      * src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int.
      (struct Lisp_Vector): Use a flexible array member for contents,
      instead of a union with a member that is an array of size 1.
      All uses changed.
      (ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the
      fact that the struct no longer contains a union.
      (struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay)
      (struct Lisp_Save_Value, struct Lisp_Free):
      Use unsigned, not int, for spacers, to avoid c99 warning.
      (union specbinding): Use unsigned, not bool, for bitfield, as
      bool is not portable to pre-C99 hosts.
      91f2d272
  36. 24 Sep, 2013 1 commit
    • Dmitry Antipov's avatar
      Use union for the payload of struct Lisp_Vector. · d6d9cbc1
      Dmitry Antipov authored
      This helps to avoid a few glitches dictated by C's aliasing rules.
      * lisp.h (struct Lisp_Vector): Use union for next and
      contents member.  Adjust comment.  Change related users.
      * alloc.c (next_in_free_list, set_next_in_free_list): Remove.
      Related users changed.
      * buffer.c, bytecode.c, ccl.c, character.h, chartab.c, composite.c:
      * composite.h, disptab.h, fns.c, fontset.c, indent.c, keyboard.c:
      * lread.c, msdos.c, process.c, w32menu.c, window.c, xdisp.c:
      * xfaces.c, xfont.c, xmenu.c: Related users changed.
      d6d9cbc1
  37. 20 Sep, 2013 1 commit
    • Paul Eggert's avatar
      A simpler, centralized INLINE. · 00382e8b
      Paul Eggert authored
      * lib-src/profile.c (INLINE): New macro.
      (SYSTIME_INLINE): Remove.
      * src/conf_post.h (INLINE): Define only if not already defined.
      This allows us to use a single INLINE, defined by one file
      per executable.
      * src/emacs.c (INLINE): Define it.
      Also, include category.h, charset.h, composite.h, dispextern.h,
      syntax.h, systime.h, so that their INLINE definitions are expanded
      properly for Emacs.
      * src/blockinput.h, src/keyboard.c (BLOCKINPUT_INLINE):
      * src/buffer.h, src/buffer.c (BUFFER_INLINE):
      * src/category.h, src/category.c (CATEGORY_INLINE):
      * src/character.h, src/character.c (CHARACTER_INLINE):
      * src/charset.h, src/charset.c (CHARSET_INLINE):
      * src/composite.h, src/composite.c (COMPOSITE_INLINE):
      * src/dispextern.h, src/dispnew.c (DISPEXTERN_INLINE):
      * src/frame.h, src/frame.c (FRAME_INLINE):
      * src/intervals.h, src/intervals.c (INTERVALS_INLINE):
      * src/keyboard.h, src/keyboard.c (KEYBOARD_INLINE):
      * src/lisp.h, src/alloc.c (LISP_INLINE):
      * src/process.h, src/process.c (PROCESS_INLINE):
      * src/syntax.h, src/syntax.c (SYNTAX_INLINE):
      * src/systime.h, src/sysdep.c (SYSTIME_INLINE):
      * src/termhooks.h, src/terminal.h (TERMHOOKS_INLINE):
      * src/window.h, src/window.c (WINDOW_INLINE):
      Remove.  All uses replaced with INLINE.
      00382e8b