diff options
| author | Joakim Verona | 2014-06-27 12:10:03 +0200 |
|---|---|---|
| committer | Joakim Verona | 2014-06-27 12:10:03 +0200 |
| commit | 83c4c0569f8c64f3dda203849e787a416c3fcd0d (patch) | |
| tree | a2fd4f9d23fdfcd7c89c7c7ba2b9d9122962fadb /src | |
| parent | d92d0dd4f2d6b04a3ae148ac36ff96c9b109196d (diff) | |
| parent | da313ecaea3f2fad5eee6582dba5e0cc95ee5ea0 (diff) | |
| download | emacs-83c4c0569f8c64f3dda203849e787a416c3fcd0d.tar.gz emacs-83c4c0569f8c64f3dda203849e787a416c3fcd0d.zip | |
manual upstream merge
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 44 | ||||
| -rw-r--r-- | src/Makefile.in | 40 | ||||
| -rw-r--r-- | src/coding.c | 15 | ||||
| -rw-r--r-- | src/composite.c | 35 | ||||
| -rw-r--r-- | src/fns.c | 98 | ||||
| -rw-r--r-- | src/image.c | 5 | ||||
| -rw-r--r-- | src/lisp.h | 18 | ||||
| -rw-r--r-- | src/process.c | 10 |
8 files changed, 124 insertions, 141 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0fc0401265c..b25e2d487d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,47 @@ | |||
| 1 | 2014-06-27 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Makefile.in: Replace BOOTSTRAPEMACS sleight-of-hand | ||
| 4 | with an order-only dependence on bootstrap-emacs. (Bug#2151) | ||
| 5 | (.el.elc): Replace suffix rule with pattern rule. | ||
| 6 | (%.elc): New pattern rule, with order-only prerequisite. | ||
| 7 | ($(lisp)): No more need to depend on BOOTSTRAPEMACS. | ||
| 8 | ($(lispsource)/loaddefs.el): Use an order-only prerequisite | ||
| 9 | in place of BOOTSTRAPEMACS. | ||
| 10 | |||
| 11 | 2014-06-26 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 12 | |||
| 13 | * fns.c (Fcompare_strings): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE. | ||
| 14 | |||
| 15 | 2014-06-25 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 16 | |||
| 17 | Consistently use validate_subarray to verify substring. | ||
| 18 | * fns.c (validate_substring): Not static any more. Adjust to | ||
| 19 | use ptrdiff_t, not EMACS_INT, because string and vector limits | ||
| 20 | can't exceed ptrdiff_t even if EMACS_INT is wider. | ||
| 21 | (Fcompare_strings, Fsubstring, Fsubstring_no_properties) | ||
| 22 | (secure_hash): Adjust user. | ||
| 23 | * lisp.h (validate_subarray): Add prototype. | ||
| 24 | * coding.c (Fundecodable_char_position): | ||
| 25 | * composite.c (Fcomposition_get_gstring, Fcompose_string_internal): | ||
| 26 | Use validate_subarray. Adjust comment to mention substring. | ||
| 27 | |||
| 28 | 2014-06-25 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 29 | |||
| 30 | Do not allow out-of-range character position in Fcompare_strings. | ||
| 31 | * fns.c (validate_subarray): Add prototype. | ||
| 32 | (Fcompare_substring): Use validate_subarray to check ranges. | ||
| 33 | Adjust comment to mention that the semantics was changed. Also see | ||
| 34 | http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00447.html. | ||
| 35 | |||
| 36 | 2014-06-24 Paul Eggert <eggert@cs.ucla.edu> | ||
| 37 | |||
| 38 | Be more consistent about the 'Qfoo' naming convention. | ||
| 39 | * image.c (Fimagemagick_types): | ||
| 40 | * lisp.h (lisp_h_CHECK_TYPE, CHECK_TYPE, CHECK_ARRAY): | ||
| 41 | * process.c (Fmake_network_process): | ||
| 42 | Rename C local identifier 'Qfoo to avoid giving the false | ||
| 43 | impression that it stands for the symbol 'foo'. | ||
| 44 | |||
| 1 | 2014-06-23 Dmitry Antipov <dmantipov@yandex.ru> | 45 | 2014-06-23 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 46 | ||
| 3 | Simplify and cleanup character conversion stuff. | 47 | Simplify and cleanup character conversion stuff. |
diff --git a/src/Makefile.in b/src/Makefile.in index 81fdccc1ca2..2e1f7fd9451 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ### @configure_input@ | 1 | ### @configure_input@ |
| 2 | 2 | ||
| 3 | # Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014 Free Software | 3 | # Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2014 |
| 4 | # Foundation, Inc. | 4 | # Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | # This file is part of GNU Emacs. | 6 | # This file is part of GNU Emacs. |
| 7 | 7 | ||
| @@ -604,40 +604,28 @@ tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS | |||
| 604 | ## such as loaddefs.el or *.elc can typically be produced by any old | 604 | ## such as loaddefs.el or *.elc can typically be produced by any old |
| 605 | ## Emacs executable, so we would like to avoid rebuilding them whenever | 605 | ## Emacs executable, so we would like to avoid rebuilding them whenever |
| 606 | ## we build a new Emacs executable. | 606 | ## we build a new Emacs executable. |
| 607 | ## | ||
| 608 | ## (In other words, changing a single file src/foo.c would force | ||
| 609 | ## dumping a new bootstrap-emacs, then re-byte-compiling all preloaded | ||
| 610 | ## elisp files, and only then dump the actual src/emacs, which is not | ||
| 611 | ## wrong, but is overkill in 99.99% of the cases.) | ||
| 612 | ## | ||
| 607 | ## To solve the circularity, we use 2 different Emacs executables, | 613 | ## To solve the circularity, we use 2 different Emacs executables, |
| 608 | ## "emacs" is the main target and "bootstrap-emacs" is the one used | 614 | ## "emacs" is the main target and "bootstrap-emacs" is the one used |
| 609 | ## to build the *.elc and loaddefs.el files. | 615 | ## to build the *.elc and loaddefs.el files. |
| 610 | ## To solve the freshness issue, we used to use a third file "witness-emacs" | 616 | ## To solve the freshness issue, in the past we tried various clever tricks, |
| 611 | ## which was used to witness the fact that there is a bootstrap-emacs | 617 | ## but now that we require GNU make, we can simply specify |
| 612 | ## executable, and then have dependencies on witness-emacs rather than | 618 | ## bootstrap-emacs$(EXEEXT) as an order-only prerequisite. |
| 613 | ## bootstrap-emacs, but that lead to problems in parallel builds (because | ||
| 614 | ## witness-emacs needed to be free from dependencies (to avoid rebuilding | ||
| 615 | ## it), so it was compiled in parallel, leading typically to having 2 | ||
| 616 | ## processes dumping bootstrap-emacs at the same time). | ||
| 617 | ## So instead, we replace the witness-emacs dependencies by conditional | ||
| 618 | ## bootstrap-dependencies (via $(BOOTSTRAPEMACS)). Of course, since we do | ||
| 619 | ## not want to rely on GNU Make features, we have to rely on an external | ||
| 620 | ## script to do the conditional part of the dependency | ||
| 621 | ## (i.e. see the $(SUBDIR) rule ../Makefile.in). | ||
| 622 | |||
| 623 | .SUFFIXES: .elc .el | ||
| 624 | |||
| 625 | ## These suffix rules do not allow additional dependencies, sadly, so | ||
| 626 | ## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it | ||
| 627 | ## separately below. | ||
| 628 | ## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" | ||
| 629 | .el.elc: | ||
| 630 | @$(MAKE) -C ../lisp compile-onefile THEFILE=$< EMACS="$(bootstrap_exe)" | ||
| 631 | 619 | ||
| 632 | ## Since the .el.elc rule cannot specify an extra dependency, we do it here. | 620 | %.elc: %.el | bootstrap-emacs$(EXEEXT) |
| 633 | $(lisp): $(BOOTSTRAPEMACS) | 621 | @$(MAKE) -C ../lisp compile-onefile THEFILE=$< EMACS="$(bootstrap_exe)" |
| 634 | 622 | ||
| 635 | ## VCSWITNESS points to the file that holds info about the current checkout. | 623 | ## VCSWITNESS points to the file that holds info about the current checkout. |
| 636 | ## We use it as a heuristic to decide when to rebuild loaddefs.el. | 624 | ## We use it as a heuristic to decide when to rebuild loaddefs.el. |
| 637 | ## If empty it is ignored; the parent makefile can set it to some other value. | 625 | ## If empty it is ignored; the parent makefile can set it to some other value. |
| 638 | VCSWITNESS = | 626 | VCSWITNESS = |
| 639 | 627 | ||
| 640 | $(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS) | 628 | $(lispsource)/loaddefs.el: $(VCSWITNESS) | bootstrap-emacs$(EXEEXT) |
| 641 | $(MAKE) -C ../lisp autoloads EMACS="$(bootstrap_exe)" | 629 | $(MAKE) -C ../lisp autoloads EMACS="$(bootstrap_exe)" |
| 642 | 630 | ||
| 643 | ## Dump an Emacs executable named bootstrap-emacs containing the | 631 | ## Dump an Emacs executable named bootstrap-emacs containing the |
diff --git a/src/coding.c b/src/coding.c index 16dc37a3f20..79f116fc618 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -9091,8 +9091,7 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 9091 | 9091 | ||
| 9092 | DEFUN ("unencodable-char-position", Funencodable_char_position, | 9092 | DEFUN ("unencodable-char-position", Funencodable_char_position, |
| 9093 | Sunencodable_char_position, 3, 5, 0, | 9093 | Sunencodable_char_position, 3, 5, 0, |
| 9094 | doc: /* | 9094 | doc: /* Return position of first un-encodable character in a region. |
| 9095 | Return position of first un-encodable character in a region. | ||
| 9096 | START and END specify the region and CODING-SYSTEM specifies the | 9095 | START and END specify the region and CODING-SYSTEM specifies the |
| 9097 | encoding to check. Return nil if CODING-SYSTEM does encode the region. | 9096 | encoding to check. Return nil if CODING-SYSTEM does encode the region. |
| 9098 | 9097 | ||
| @@ -9102,8 +9101,9 @@ list of positions. | |||
| 9102 | 9101 | ||
| 9103 | If optional 5th argument STRING is non-nil, it is a string to search | 9102 | If optional 5th argument STRING is non-nil, it is a string to search |
| 9104 | for un-encodable characters. In that case, START and END are indexes | 9103 | for un-encodable characters. In that case, START and END are indexes |
| 9105 | to the string. */) | 9104 | to the string and treated as in `substring'. */) |
| 9106 | (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object count, Lisp_Object string) | 9105 | (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, |
| 9106 | Lisp_Object count, Lisp_Object string) | ||
| 9107 | { | 9107 | { |
| 9108 | EMACS_INT n; | 9108 | EMACS_INT n; |
| 9109 | struct coding_system coding; | 9109 | struct coding_system coding; |
| @@ -9140,12 +9140,7 @@ to the string. */) | |||
| 9140 | else | 9140 | else |
| 9141 | { | 9141 | { |
| 9142 | CHECK_STRING (string); | 9142 | CHECK_STRING (string); |
| 9143 | CHECK_NATNUM (start); | 9143 | validate_subarray (string, start, end, SCHARS (string), &from, &to); |
| 9144 | CHECK_NATNUM (end); | ||
| 9145 | if (! (XINT (start) <= XINT (end) && XINT (end) <= SCHARS (string))) | ||
| 9146 | args_out_of_range_3 (string, start, end); | ||
| 9147 | from = XINT (start); | ||
| 9148 | to = XINT (end); | ||
| 9149 | if (! STRING_MULTIBYTE (string)) | 9144 | if (! STRING_MULTIBYTE (string)) |
| 9150 | return Qnil; | 9145 | return Qnil; |
| 9151 | p = SDATA (string) + string_char_to_byte (string, from); | 9146 | p = SDATA (string) + string_char_to_byte (string, from); |
diff --git a/src/composite.c b/src/composite.c index 5e14ad037a6..66a20759ec6 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -1684,9 +1684,10 @@ Otherwise (for terminal display), FONT-OBJECT must be a terminal ID, a | |||
| 1684 | frame, or nil for the selected frame's terminal device. | 1684 | frame, or nil for the selected frame's terminal device. |
| 1685 | 1685 | ||
| 1686 | If the optional 4th argument STRING is not nil, it is a string | 1686 | If the optional 4th argument STRING is not nil, it is a string |
| 1687 | containing the target characters between indices FROM and TO. | 1687 | containing the target characters between indices FROM and TO, |
| 1688 | Otherwise FROM and TO are character positions in current buffer; | 1688 | which are treated as in `substring'. Otherwise FROM and TO are |
| 1689 | they can be in either order, and can be integers or markers. | 1689 | character positions in current buffer; they can be in either order, |
| 1690 | and can be integers or markers. | ||
| 1690 | 1691 | ||
| 1691 | A glyph-string is a vector containing information about how to display | 1692 | A glyph-string is a vector containing information about how to display |
| 1692 | a specific character sequence. The format is: | 1693 | a specific character sequence. The format is: |
| @@ -1742,15 +1743,10 @@ should be ignored. */) | |||
| 1742 | } | 1743 | } |
| 1743 | else | 1744 | else |
| 1744 | { | 1745 | { |
| 1745 | CHECK_NATNUM (from); | ||
| 1746 | CHECK_NATNUM (to); | ||
| 1747 | CHECK_STRING (string); | 1746 | CHECK_STRING (string); |
| 1747 | validate_subarray (string, from, to, SCHARS (string), &frompos, &topos); | ||
| 1748 | if (! STRING_MULTIBYTE (string)) | 1748 | if (! STRING_MULTIBYTE (string)) |
| 1749 | error ("Attempt to shape unibyte text"); | 1749 | error ("Attempt to shape unibyte text"); |
| 1750 | if (! (XINT (from) <= XINT (to) && XINT (to) <= SCHARS (string))) | ||
| 1751 | args_out_of_range_3 (string, from, to); | ||
| 1752 | frompos = XFASTINT (from); | ||
| 1753 | topos = XFASTINT (to); | ||
| 1754 | frombyte = string_char_to_byte (string, frompos); | 1750 | frombyte = string_char_to_byte (string, frompos); |
| 1755 | } | 1751 | } |
| 1756 | 1752 | ||
| @@ -1795,21 +1791,18 @@ DEFUN ("compose-string-internal", Fcompose_string_internal, | |||
| 1795 | Scompose_string_internal, 3, 5, 0, | 1791 | Scompose_string_internal, 3, 5, 0, |
| 1796 | doc: /* Internal use only. | 1792 | doc: /* Internal use only. |
| 1797 | 1793 | ||
| 1798 | Compose text between indices START and END of STRING. | 1794 | Compose text between indices START and END of STRING, where |
| 1799 | Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC | 1795 | START and END are treated as in `substring'. Optional 4th |
| 1796 | and 5th arguments are COMPONENTS and MODIFICATION-FUNC | ||
| 1800 | for the composition. See `compose-string' for more details. */) | 1797 | for the composition. See `compose-string' for more details. */) |
| 1801 | (Lisp_Object string, Lisp_Object start, Lisp_Object end, Lisp_Object components, Lisp_Object modification_func) | 1798 | (Lisp_Object string, Lisp_Object start, Lisp_Object end, |
| 1799 | Lisp_Object components, Lisp_Object modification_func) | ||
| 1802 | { | 1800 | { |
| 1803 | CHECK_STRING (string); | 1801 | ptrdiff_t from, to; |
| 1804 | CHECK_NUMBER (start); | ||
| 1805 | CHECK_NUMBER (end); | ||
| 1806 | 1802 | ||
| 1807 | if (XINT (start) < 0 || | 1803 | CHECK_STRING (string); |
| 1808 | XINT (start) > XINT (end) | 1804 | validate_subarray (string, start, end, SCHARS (string), &from, &to); |
| 1809 | || XINT (end) > SCHARS (string)) | 1805 | compose_text (from, to, components, modification_func, string); |
| 1810 | args_out_of_range (start, end); | ||
| 1811 | |||
| 1812 | compose_text (XINT (start), XINT (end), components, modification_func, string); | ||
| 1813 | return string; | 1806 | return string; |
| 1814 | } | 1807 | } |
| 1815 | 1808 | ||
| @@ -50,7 +50,7 @@ static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper; | |||
| 50 | static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512; | 50 | static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512; |
| 51 | 51 | ||
| 52 | static bool internal_equal (Lisp_Object, Lisp_Object, int, bool, Lisp_Object); | 52 | static bool internal_equal (Lisp_Object, Lisp_Object, int, bool, Lisp_Object); |
| 53 | 53 | ||
| 54 | DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, | 54 | DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, |
| 55 | doc: /* Return the argument unchanged. */) | 55 | doc: /* Return the argument unchanged. */) |
| 56 | (Lisp_Object arg) | 56 | (Lisp_Object arg) |
| @@ -232,6 +232,7 @@ string STR1, compare the part between START1 (inclusive) and END1 | |||
| 232 | \(exclusive). If START1 is nil, it defaults to 0, the beginning of | 232 | \(exclusive). If START1 is nil, it defaults to 0, the beginning of |
| 233 | the string; if END1 is nil, it defaults to the length of the string. | 233 | the string; if END1 is nil, it defaults to the length of the string. |
| 234 | Likewise, in string STR2, compare the part between START2 and END2. | 234 | Likewise, in string STR2, compare the part between START2 and END2. |
| 235 | Like in `substring', negative values are counted from the end. | ||
| 235 | 236 | ||
| 236 | The strings are compared by the numeric values of their characters. | 237 | The strings are compared by the numeric values of their characters. |
| 237 | For instance, STR1 is "less than" STR2 if its first differing | 238 | For instance, STR1 is "less than" STR2 if its first differing |
| @@ -244,75 +245,39 @@ If string STR1 is less, the value is a negative number N; | |||
| 244 | - 1 - N is the number of characters that match at the beginning. | 245 | - 1 - N is the number of characters that match at the beginning. |
| 245 | If string STR1 is greater, the value is a positive number N; | 246 | If string STR1 is greater, the value is a positive number N; |
| 246 | N - 1 is the number of characters that match at the beginning. */) | 247 | N - 1 is the number of characters that match at the beginning. */) |
| 247 | (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case) | 248 | (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, |
| 249 | Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case) | ||
| 248 | { | 250 | { |
| 249 | register ptrdiff_t end1_char, end2_char; | 251 | ptrdiff_t from1, to1, from2, to2, i1, i1_byte, i2, i2_byte; |
| 250 | register ptrdiff_t i1, i1_byte, i2, i2_byte; | ||
| 251 | 252 | ||
| 252 | CHECK_STRING (str1); | 253 | CHECK_STRING (str1); |
| 253 | CHECK_STRING (str2); | 254 | CHECK_STRING (str2); |
| 254 | if (NILP (start1)) | 255 | |
| 255 | start1 = make_number (0); | 256 | validate_subarray (str1, start1, end1, SCHARS (str1), &from1, &to1); |
| 256 | if (NILP (start2)) | 257 | validate_subarray (str2, start2, end2, SCHARS (str2), &from2, &to2); |
| 257 | start2 = make_number (0); | 258 | |
| 258 | CHECK_NATNUM (start1); | 259 | i1 = from1; |
| 259 | CHECK_NATNUM (start2); | 260 | i2 = from2; |
| 260 | if (! NILP (end1)) | ||
| 261 | CHECK_NATNUM (end1); | ||
| 262 | if (! NILP (end2)) | ||
| 263 | CHECK_NATNUM (end2); | ||
| 264 | |||
| 265 | end1_char = SCHARS (str1); | ||
| 266 | if (! NILP (end1) && end1_char > XINT (end1)) | ||
| 267 | end1_char = XINT (end1); | ||
| 268 | if (end1_char < XINT (start1)) | ||
| 269 | args_out_of_range (str1, start1); | ||
| 270 | |||
| 271 | end2_char = SCHARS (str2); | ||
| 272 | if (! NILP (end2) && end2_char > XINT (end2)) | ||
| 273 | end2_char = XINT (end2); | ||
| 274 | if (end2_char < XINT (start2)) | ||
| 275 | args_out_of_range (str2, start2); | ||
| 276 | |||
| 277 | i1 = XINT (start1); | ||
| 278 | i2 = XINT (start2); | ||
| 279 | 261 | ||
| 280 | i1_byte = string_char_to_byte (str1, i1); | 262 | i1_byte = string_char_to_byte (str1, i1); |
| 281 | i2_byte = string_char_to_byte (str2, i2); | 263 | i2_byte = string_char_to_byte (str2, i2); |
| 282 | 264 | ||
| 283 | while (i1 < end1_char && i2 < end2_char) | 265 | while (i1 < to1 && i2 < to2) |
| 284 | { | 266 | { |
| 285 | /* When we find a mismatch, we must compare the | 267 | /* When we find a mismatch, we must compare the |
| 286 | characters, not just the bytes. */ | 268 | characters, not just the bytes. */ |
| 287 | int c1, c2; | 269 | int c1, c2; |
| 288 | 270 | ||
| 289 | if (STRING_MULTIBYTE (str1)) | 271 | FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c1, str1, i1, i1_byte); |
| 290 | FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c1, str1, i1, i1_byte); | 272 | FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c2, str2, i2, i2_byte); |
| 291 | else | ||
| 292 | { | ||
| 293 | c1 = SREF (str1, i1++); | ||
| 294 | MAKE_CHAR_MULTIBYTE (c1); | ||
| 295 | } | ||
| 296 | |||
| 297 | if (STRING_MULTIBYTE (str2)) | ||
| 298 | FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c2, str2, i2, i2_byte); | ||
| 299 | else | ||
| 300 | { | ||
| 301 | c2 = SREF (str2, i2++); | ||
| 302 | MAKE_CHAR_MULTIBYTE (c2); | ||
| 303 | } | ||
| 304 | 273 | ||
| 305 | if (c1 == c2) | 274 | if (c1 == c2) |
| 306 | continue; | 275 | continue; |
| 307 | 276 | ||
| 308 | if (! NILP (ignore_case)) | 277 | if (! NILP (ignore_case)) |
| 309 | { | 278 | { |
| 310 | Lisp_Object tem; | 279 | c1 = XINT (Fupcase (make_number (c1))); |
| 311 | 280 | c2 = XINT (Fupcase (make_number (c2))); | |
| 312 | tem = Fupcase (make_number (c1)); | ||
| 313 | c1 = XINT (tem); | ||
| 314 | tem = Fupcase (make_number (c2)); | ||
| 315 | c2 = XINT (tem); | ||
| 316 | } | 281 | } |
| 317 | 282 | ||
| 318 | if (c1 == c2) | 283 | if (c1 == c2) |
| @@ -322,15 +287,15 @@ If string STR1 is greater, the value is a positive number N; | |||
| 322 | past the character that we are comparing; | 287 | past the character that we are comparing; |
| 323 | hence we don't add or subtract 1 here. */ | 288 | hence we don't add or subtract 1 here. */ |
| 324 | if (c1 < c2) | 289 | if (c1 < c2) |
| 325 | return make_number (- i1 + XINT (start1)); | 290 | return make_number (- i1 + from1); |
| 326 | else | 291 | else |
| 327 | return make_number (i1 - XINT (start1)); | 292 | return make_number (i1 - from1); |
| 328 | } | 293 | } |
| 329 | 294 | ||
| 330 | if (i1 < end1_char) | 295 | if (i1 < to1) |
| 331 | return make_number (i1 - XINT (start1) + 1); | 296 | return make_number (i1 - from1 + 1); |
| 332 | if (i2 < end2_char) | 297 | if (i2 < to2) |
| 333 | return make_number (- i1 + XINT (start1) - 1); | 298 | return make_number (- i1 + from1 - 1); |
| 334 | 299 | ||
| 335 | return Qt; | 300 | return Qt; |
| 336 | } | 301 | } |
| @@ -1133,9 +1098,9 @@ Elements of ALIST that are not conses are also shared. */) | |||
| 1133 | Count negative values backwards from the end. | 1098 | Count negative values backwards from the end. |
| 1134 | Set *IFROM and *ITO to the two indexes used. */ | 1099 | Set *IFROM and *ITO to the two indexes used. */ |
| 1135 | 1100 | ||
| 1136 | static void | 1101 | void |
| 1137 | validate_subarray (Lisp_Object array, Lisp_Object from, Lisp_Object to, | 1102 | validate_subarray (Lisp_Object array, Lisp_Object from, Lisp_Object to, |
| 1138 | ptrdiff_t size, EMACS_INT *ifrom, EMACS_INT *ito) | 1103 | ptrdiff_t size, ptrdiff_t *ifrom, ptrdiff_t *ito) |
| 1139 | { | 1104 | { |
| 1140 | EMACS_INT f, t; | 1105 | EMACS_INT f, t; |
| 1141 | 1106 | ||
| @@ -1184,8 +1149,7 @@ With one argument, just copy STRING (with properties, if any). */) | |||
| 1184 | (Lisp_Object string, Lisp_Object from, Lisp_Object to) | 1149 | (Lisp_Object string, Lisp_Object from, Lisp_Object to) |
| 1185 | { | 1150 | { |
| 1186 | Lisp_Object res; | 1151 | Lisp_Object res; |
| 1187 | ptrdiff_t size; | 1152 | ptrdiff_t size, ifrom, ito; |
| 1188 | EMACS_INT ifrom, ito; | ||
| 1189 | 1153 | ||
| 1190 | if (STRINGP (string)) | 1154 | if (STRINGP (string)) |
| 1191 | size = SCHARS (string); | 1155 | size = SCHARS (string); |
| @@ -1225,9 +1189,7 @@ If FROM or TO is negative, it counts from the end. | |||
| 1225 | With one argument, just copy STRING without its properties. */) | 1189 | With one argument, just copy STRING without its properties. */) |
| 1226 | (Lisp_Object string, register Lisp_Object from, Lisp_Object to) | 1190 | (Lisp_Object string, register Lisp_Object from, Lisp_Object to) |
| 1227 | { | 1191 | { |
| 1228 | ptrdiff_t size; | 1192 | ptrdiff_t from_char, to_char, from_byte, to_byte, size; |
| 1229 | EMACS_INT from_char, to_char; | ||
| 1230 | ptrdiff_t from_byte, to_byte; | ||
| 1231 | 1193 | ||
| 1232 | CHECK_STRING (string); | 1194 | CHECK_STRING (string); |
| 1233 | 1195 | ||
| @@ -4656,12 +4618,12 @@ returns nil, then (funcall TEST x1 x2) also returns nil. */) | |||
| 4656 | /* ALGORITHM is a symbol: md5, sha1, sha224 and so on. */ | 4618 | /* ALGORITHM is a symbol: md5, sha1, sha224 and so on. */ |
| 4657 | 4619 | ||
| 4658 | static Lisp_Object | 4620 | static Lisp_Object |
| 4659 | secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror, Lisp_Object binary) | 4621 | secure_hash (Lisp_Object algorithm, Lisp_Object object, Lisp_Object start, |
| 4622 | Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror, | ||
| 4623 | Lisp_Object binary) | ||
| 4660 | { | 4624 | { |
| 4661 | int i; | 4625 | int i; |
| 4662 | ptrdiff_t size; | 4626 | ptrdiff_t size, start_char = 0, start_byte, end_char = 0, end_byte; |
| 4663 | EMACS_INT start_char = 0, end_char = 0; | ||
| 4664 | ptrdiff_t start_byte, end_byte; | ||
| 4665 | register EMACS_INT b, e; | 4627 | register EMACS_INT b, e; |
| 4666 | register struct buffer *bp; | 4628 | register struct buffer *bp; |
| 4667 | EMACS_INT temp; | 4629 | EMACS_INT temp; |
diff --git a/src/image.c b/src/image.c index f8c2402bfc4..b6d1f81ca06 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8549,7 +8549,6 @@ and `imagemagick-types-inhibit'. */) | |||
| 8549 | ExceptionInfo ex; | 8549 | ExceptionInfo ex; |
| 8550 | char **imtypes; | 8550 | char **imtypes; |
| 8551 | size_t i; | 8551 | size_t i; |
| 8552 | Lisp_Object Qimagemagicktype; | ||
| 8553 | 8552 | ||
| 8554 | GetExceptionInfo(&ex); | 8553 | GetExceptionInfo(&ex); |
| 8555 | imtypes = GetMagickList ("*", &numf, &ex); | 8554 | imtypes = GetMagickList ("*", &numf, &ex); |
| @@ -8557,8 +8556,8 @@ and `imagemagick-types-inhibit'. */) | |||
| 8557 | 8556 | ||
| 8558 | for (i = 0; i < numf; i++) | 8557 | for (i = 0; i < numf; i++) |
| 8559 | { | 8558 | { |
| 8560 | Qimagemagicktype = intern (imtypes[i]); | 8559 | Lisp_Object imagemagicktype = intern (imtypes[i]); |
| 8561 | typelist = Fcons (Qimagemagicktype, typelist); | 8560 | typelist = Fcons (imagemagicktype, typelist); |
| 8562 | imtypes[i] = MagickRelinquishMemory (imtypes[i]); | 8561 | imtypes[i] = MagickRelinquishMemory (imtypes[i]); |
| 8563 | } | 8562 | } |
| 8564 | 8563 | ||
diff --git a/src/lisp.h b/src/lisp.h index 8251c62270c..6d0cd57d41e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -341,8 +341,8 @@ error !; | |||
| 341 | #define lisp_h_CHECK_LIST_CONS(x, y) CHECK_TYPE (CONSP (x), Qlistp, y) | 341 | #define lisp_h_CHECK_LIST_CONS(x, y) CHECK_TYPE (CONSP (x), Qlistp, y) |
| 342 | #define lisp_h_CHECK_NUMBER(x) CHECK_TYPE (INTEGERP (x), Qintegerp, x) | 342 | #define lisp_h_CHECK_NUMBER(x) CHECK_TYPE (INTEGERP (x), Qintegerp, x) |
| 343 | #define lisp_h_CHECK_SYMBOL(x) CHECK_TYPE (SYMBOLP (x), Qsymbolp, x) | 343 | #define lisp_h_CHECK_SYMBOL(x) CHECK_TYPE (SYMBOLP (x), Qsymbolp, x) |
| 344 | #define lisp_h_CHECK_TYPE(ok, Qxxxp, x) \ | 344 | #define lisp_h_CHECK_TYPE(ok, predicate, x) \ |
| 345 | ((ok) ? (void) 0 : (void) wrong_type_argument (Qxxxp, x)) | 345 | ((ok) ? (void) 0 : (void) wrong_type_argument (predicate, x)) |
| 346 | #define lisp_h_CONSP(x) (XTYPE (x) == Lisp_Cons) | 346 | #define lisp_h_CONSP(x) (XTYPE (x) == Lisp_Cons) |
| 347 | #define lisp_h_EQ(x, y) (XLI (x) == XLI (y)) | 347 | #define lisp_h_EQ(x, y) (XLI (x) == XLI (y)) |
| 348 | #define lisp_h_FLOATP(x) (XTYPE (x) == Lisp_Float) | 348 | #define lisp_h_FLOATP(x) (XTYPE (x) == Lisp_Float) |
| @@ -388,7 +388,7 @@ error !; | |||
| 388 | # define CHECK_LIST_CONS(x, y) lisp_h_CHECK_LIST_CONS (x, y) | 388 | # define CHECK_LIST_CONS(x, y) lisp_h_CHECK_LIST_CONS (x, y) |
| 389 | # define CHECK_NUMBER(x) lisp_h_CHECK_NUMBER (x) | 389 | # define CHECK_NUMBER(x) lisp_h_CHECK_NUMBER (x) |
| 390 | # define CHECK_SYMBOL(x) lisp_h_CHECK_SYMBOL (x) | 390 | # define CHECK_SYMBOL(x) lisp_h_CHECK_SYMBOL (x) |
| 391 | # define CHECK_TYPE(ok, Qxxxp, x) lisp_h_CHECK_TYPE (ok, Qxxxp, x) | 391 | # define CHECK_TYPE(ok, predicate, x) lisp_h_CHECK_TYPE (ok, predicate, x) |
| 392 | # define CONSP(x) lisp_h_CONSP (x) | 392 | # define CONSP(x) lisp_h_CONSP (x) |
| 393 | # define EQ(x, y) lisp_h_EQ (x, y) | 393 | # define EQ(x, y) lisp_h_EQ (x, y) |
| 394 | # define FLOATP(x) lisp_h_FLOATP (x) | 394 | # define FLOATP(x) lisp_h_FLOATP (x) |
| @@ -1008,8 +1008,9 @@ make_lisp_proc (struct Lisp_Process *p) | |||
| 1008 | 1008 | ||
| 1009 | /* Type checking. */ | 1009 | /* Type checking. */ |
| 1010 | 1010 | ||
| 1011 | LISP_MACRO_DEFUN_VOID (CHECK_TYPE, (int ok, Lisp_Object Qxxxp, Lisp_Object x), | 1011 | LISP_MACRO_DEFUN_VOID (CHECK_TYPE, |
| 1012 | (ok, Qxxxp, x)) | 1012 | (int ok, Lisp_Object predicate, Lisp_Object x), |
| 1013 | (ok, predicate, x)) | ||
| 1013 | 1014 | ||
| 1014 | /* Deprecated and will be removed soon. */ | 1015 | /* Deprecated and will be removed soon. */ |
| 1015 | 1016 | ||
| @@ -2557,9 +2558,9 @@ CHECK_VECTOR_OR_STRING (Lisp_Object x) | |||
| 2557 | CHECK_TYPE (VECTORP (x) || STRINGP (x), Qarrayp, x); | 2558 | CHECK_TYPE (VECTORP (x) || STRINGP (x), Qarrayp, x); |
| 2558 | } | 2559 | } |
| 2559 | INLINE void | 2560 | INLINE void |
| 2560 | CHECK_ARRAY (Lisp_Object x, Lisp_Object Qxxxp) | 2561 | CHECK_ARRAY (Lisp_Object x, Lisp_Object predicate) |
| 2561 | { | 2562 | { |
| 2562 | CHECK_TYPE (ARRAYP (x), Qxxxp, x); | 2563 | CHECK_TYPE (ARRAYP (x), predicate, x); |
| 2563 | } | 2564 | } |
| 2564 | INLINE void | 2565 | INLINE void |
| 2565 | CHECK_BUFFER (Lisp_Object x) | 2566 | CHECK_BUFFER (Lisp_Object x) |
| @@ -3468,7 +3469,8 @@ ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *); | |||
| 3468 | ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object, | 3469 | ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object, |
| 3469 | EMACS_UINT); | 3470 | EMACS_UINT); |
| 3470 | extern struct hash_table_test hashtest_eql, hashtest_equal; | 3471 | extern struct hash_table_test hashtest_eql, hashtest_equal; |
| 3471 | 3472 | extern void validate_subarray (Lisp_Object, Lisp_Object, Lisp_Object, | |
| 3473 | ptrdiff_t, ptrdiff_t *, ptrdiff_t *); | ||
| 3472 | extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t, | 3474 | extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 3473 | ptrdiff_t, ptrdiff_t); | 3475 | ptrdiff_t, ptrdiff_t); |
| 3474 | extern Lisp_Object merge (Lisp_Object, Lisp_Object, Lisp_Object); | 3476 | extern Lisp_Object merge (Lisp_Object, Lisp_Object, Lisp_Object); |
diff --git a/src/process.c b/src/process.c index 592c43acc2d..3242222a94a 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2844,7 +2844,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2844 | struct gcpro gcpro1; | 2844 | struct gcpro gcpro1; |
| 2845 | ptrdiff_t count = SPECPDL_INDEX (); | 2845 | ptrdiff_t count = SPECPDL_INDEX (); |
| 2846 | ptrdiff_t count1; | 2846 | ptrdiff_t count1; |
| 2847 | Lisp_Object QCaddress; /* one of QClocal or QCremote */ | 2847 | Lisp_Object colon_address; /* Either QClocal or QCremote. */ |
| 2848 | Lisp_Object tem; | 2848 | Lisp_Object tem; |
| 2849 | Lisp_Object name, buffer, host, service, address; | 2849 | Lisp_Object name, buffer, host, service, address; |
| 2850 | Lisp_Object filter, sentinel; | 2850 | Lisp_Object filter, sentinel; |
| @@ -2892,8 +2892,8 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2892 | backlog = XINT (tem); | 2892 | backlog = XINT (tem); |
| 2893 | } | 2893 | } |
| 2894 | 2894 | ||
| 2895 | /* Make QCaddress an alias for :local (server) or :remote (client). */ | 2895 | /* Make colon_address an alias for :local (server) or :remote (client). */ |
| 2896 | QCaddress = is_server ? QClocal : QCremote; | 2896 | colon_address = is_server ? QClocal : QCremote; |
| 2897 | 2897 | ||
| 2898 | /* :nowait BOOL */ | 2898 | /* :nowait BOOL */ |
| 2899 | if (!is_server && socktype != SOCK_DGRAM | 2899 | if (!is_server && socktype != SOCK_DGRAM |
| @@ -2920,7 +2920,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2920 | res = &ai; | 2920 | res = &ai; |
| 2921 | 2921 | ||
| 2922 | /* :local ADDRESS or :remote ADDRESS */ | 2922 | /* :local ADDRESS or :remote ADDRESS */ |
| 2923 | address = Fplist_get (contact, QCaddress); | 2923 | address = Fplist_get (contact, colon_address); |
| 2924 | if (!NILP (address)) | 2924 | if (!NILP (address)) |
| 2925 | { | 2925 | { |
| 2926 | host = service = Qnil; | 2926 | host = service = Qnil; |
| @@ -3307,7 +3307,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3307 | memcpy (datagram_address[s].sa, lres->ai_addr, lres->ai_addrlen); | 3307 | memcpy (datagram_address[s].sa, lres->ai_addr, lres->ai_addrlen); |
| 3308 | } | 3308 | } |
| 3309 | #endif | 3309 | #endif |
| 3310 | contact = Fplist_put (contact, QCaddress, | 3310 | contact = Fplist_put (contact, colon_address, |
| 3311 | conv_sockaddr_to_lisp (lres->ai_addr, lres->ai_addrlen)); | 3311 | conv_sockaddr_to_lisp (lres->ai_addr, lres->ai_addrlen)); |
| 3312 | #ifdef HAVE_GETSOCKNAME | 3312 | #ifdef HAVE_GETSOCKNAME |
| 3313 | if (!is_server) | 3313 | if (!is_server) |