aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-04 20:44:52 +0000
committerRichard M. Stallman1997-07-04 20:44:52 +0000
commit2e34157cd9e74150e79e0ce23236252b47fb5f1a (patch)
tree418451da8380ec73d5d46dc648c07e6ad8af845f /src
parent8c239ac3ed4f636810bc08959e1318b1a6e928ba (diff)
downloademacs-2e34157cd9e74150e79e0ce23236252b47fb5f1a.tar.gz
emacs-2e34157cd9e74150e79e0ce23236252b47fb5f1a.zip
Fix bugs with inappropriate mixing of Lisp_Object with int.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c25
-rw-r--r--src/casefiddle.c4
-rw-r--r--src/casetab.c5
-rw-r--r--src/category.c4
-rw-r--r--src/category.h11
-rw-r--r--src/ccl.c2
-rw-r--r--src/coding.c9
-rw-r--r--src/config.in1
-rw-r--r--src/editfns.c4
-rw-r--r--src/fileio.c3
-rw-r--r--src/fns.c4
-rw-r--r--src/indent.c9
-rw-r--r--src/intervals.c14
-rw-r--r--src/intervals.h6
-rw-r--r--src/keymap.c9
-rw-r--r--src/lisp.h22
-rw-r--r--src/minibuf.c2
-rw-r--r--src/print.c2
-rw-r--r--src/syntax.c6
-rw-r--r--src/syntax.h4
-rw-r--r--src/sysdep.c2
-rw-r--r--src/textprop.c6
22 files changed, 90 insertions, 64 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 7b33c71daef..42f6ca1582c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2789,6 +2789,8 @@ modify_overlay (buf, start, end)
2789} 2789}
2790 2790
2791 2791
2792Lisp_Object Fdelete_overlay ();
2793
2792DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, 2794DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0,
2793 "Set the endpoints of OVERLAY to BEG and END in BUFFER.\n\ 2795 "Set the endpoints of OVERLAY to BEG and END in BUFFER.\n\
2794If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.\n\ 2796If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.\n\
@@ -2839,13 +2841,13 @@ buffer.")
2839 /* Redisplay where the overlay was. */ 2841 /* Redisplay where the overlay was. */
2840 if (!NILP (obuffer)) 2842 if (!NILP (obuffer))
2841 { 2843 {
2842 Lisp_Object o_beg; 2844 int o_beg;
2843 Lisp_Object o_end; 2845 int o_end;
2844 2846
2845 o_beg = OVERLAY_POSITION (OVERLAY_START (overlay)); 2847 o_beg = OVERLAY_POSITION (OVERLAY_START (overlay));
2846 o_end = OVERLAY_POSITION (OVERLAY_END (overlay)); 2848 o_end = OVERLAY_POSITION (OVERLAY_END (overlay));
2847 2849
2848 modify_overlay (ob, XINT (o_beg), XINT (o_end)); 2850 modify_overlay (ob, o_beg, o_end);
2849 } 2851 }
2850 2852
2851 /* Redisplay where the overlay is going to be. */ 2853 /* Redisplay where the overlay is going to be. */
@@ -2854,22 +2856,21 @@ buffer.")
2854 else 2856 else
2855 /* Redisplay the area the overlay has just left, or just enclosed. */ 2857 /* Redisplay the area the overlay has just left, or just enclosed. */
2856 { 2858 {
2857 Lisp_Object o_beg; 2859 int o_beg, o_end;
2858 Lisp_Object o_end;
2859 int change_beg, change_end; 2860 int change_beg, change_end;
2860 2861
2861 o_beg = OVERLAY_POSITION (OVERLAY_START (overlay)); 2862 o_beg = OVERLAY_POSITION (OVERLAY_START (overlay));
2862 o_end = OVERLAY_POSITION (OVERLAY_END (overlay)); 2863 o_end = OVERLAY_POSITION (OVERLAY_END (overlay));
2863 2864
2864 if (XINT (o_beg) == XINT (beg)) 2865 if (o_beg == XINT (beg))
2865 modify_overlay (b, XINT (o_end), XINT (end)); 2866 modify_overlay (b, o_end, XINT (end));
2866 else if (XINT (o_end) == XINT (end)) 2867 else if (o_end == XINT (end))
2867 modify_overlay (b, XINT (o_beg), XINT (beg)); 2868 modify_overlay (b, o_beg, XINT (beg));
2868 else 2869 else
2869 { 2870 {
2870 if (XINT (beg) < XINT (o_beg)) o_beg = beg; 2871 if (XINT (beg) < o_beg) o_beg = XINT (beg);
2871 if (XINT (end) > XINT (o_end)) o_end = end; 2872 if (XINT (end) > o_end) o_end = XINT (end);
2872 modify_overlay (b, XINT (o_beg), XINT (o_end)); 2873 modify_overlay (b, o_beg, o_end);
2873 } 2874 }
2874 } 2875 }
2875 2876
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 90d09b46ac4..dfa2981eb04 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -47,12 +47,12 @@ casify_object (flag, obj)
47 { 47 {
48 if (INTEGERP (obj)) 48 if (INTEGERP (obj))
49 { 49 {
50 c = DOWNCASE (obj); 50 c = DOWNCASE (XFASTINT (obj));
51 if (inword) 51 if (inword)
52 XSETFASTINT (obj, c); 52 XSETFASTINT (obj, c);
53 else if (c == XFASTINT (obj)) 53 else if (c == XFASTINT (obj))
54 { 54 {
55 c = UPCASE1 (obj); 55 c = UPCASE1 (XFASTINT (obj));
56 XSETFASTINT (obj, c); 56 XSETFASTINT (obj, c);
57 } 57 }
58 return obj; 58 return obj;
diff --git a/src/casetab.c b/src/casetab.c
index 29a237cb948..a933be69c7d 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -31,7 +31,8 @@ Lisp_Object Vascii_canon_table, Vascii_eqv_table;
31 31
32/* Used as a temporary in DOWNCASE and other macros in lisp.h. No 32/* Used as a temporary in DOWNCASE and other macros in lisp.h. No
33 need to mark it, since it is used only very temporarily. */ 33 need to mark it, since it is used only very temporarily. */
34Lisp_Object case_temp1, case_temp2; 34int case_temp1;
35Lisp_Object case_temp2;
35 36
36static void set_canon (); 37static void set_canon ();
37static void set_identity (); 38static void set_identity ();
@@ -207,7 +208,7 @@ static void
207shuffle (table, c, elt) 208shuffle (table, c, elt)
208 Lisp_Object table, c, elt; 209 Lisp_Object table, c, elt;
209{ 210{
210 if (NATNUMP (elt) && c != elt) 211 if (NATNUMP (elt) && !EQ (c, elt))
211 { 212 {
212 Lisp_Object tem = Faref (table, elt); 213 Lisp_Object tem = Faref (table, elt);
213 Faset (table, elt, c); 214 Faset (table, elt, c);
diff --git a/src/category.c b/src/category.c
index 81ef3dcd622..f63b65e1301 100644
--- a/src/category.c
+++ b/src/category.c
@@ -574,8 +574,8 @@ word_boundary_p (c1, c2)
574 if (CONSP (elt) 574 if (CONSP (elt)
575 && CATEGORYP (XCONS (elt)->car) 575 && CATEGORYP (XCONS (elt)->car)
576 && CATEGORYP (XCONS (elt)->cdr) 576 && CATEGORYP (XCONS (elt)->cdr)
577 && CATEGORY_MEMBER (XCONS (elt)->car, category_set1) 577 && CATEGORY_MEMBER (XFASTINT (XCONS (elt)->car), category_set1)
578 && CATEGORY_MEMBER (XCONS (elt)->cdr, category_set2)) 578 && CATEGORY_MEMBER (XFASTINT (XCONS (elt)->cdr), category_set2))
579 return !default_result; 579 return !default_result;
580 } 580 }
581 return default_result; 581 return default_result;
diff --git a/src/category.h b/src/category.h
index 0421ed145c9..f646f9ddfcb 100644
--- a/src/category.h
+++ b/src/category.h
@@ -79,9 +79,8 @@ Boston, MA 02111-1307, USA. */
79/* Return 1 if CATEGORY_SET contains CATEGORY, else return 0. 79/* Return 1 if CATEGORY_SET contains CATEGORY, else return 0.
80 The faster version of `!NILP (Faref (category_set, category))'. */ 80 The faster version of `!NILP (Faref (category_set, category))'. */
81#define CATEGORY_MEMBER(category, category_set) \ 81#define CATEGORY_MEMBER(category, category_set) \
82 (!NILP (category_set) \ 82 (XCATEGORY_SET (category_set)->data[(category) / 8] \
83 && (XCATEGORY_SET (category_set)->data[XFASTINT (category) / 8] \ 83 & (1 << ((category) % 8)))
84 & (1 << (XFASTINT (category) % 8))))
85 84
86/* Temporary internal variable used in macro CHAR_HAS_CATEGORY. */ 85/* Temporary internal variable used in macro CHAR_HAS_CATEGORY. */
87extern Lisp_Object _temp_category_set; 86extern Lisp_Object _temp_category_set;
@@ -106,14 +105,16 @@ extern Lisp_Object _temp_category_set;
106 table = XCHAR_TABLE (table)->parent; \ 105 table = XCHAR_TABLE (table)->parent; \
107 else \ 106 else \
108 temp = Faref (table, \ 107 temp = Faref (table, \
109 COMPOSITE_CHAR_P (c) ? cmpchar_component (c, 0) : (c)); \ 108 make_number (COMPOSITE_CHAR_P (c) \
109 ? cmpchar_component (c, 0) : (c))); \
110 temp; }) 110 temp; })
111#else 111#else
112#define CATEGORY_SET(c) \ 112#define CATEGORY_SET(c) \
113 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \ 113 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
114 ? Faref (current_buffer->category_table, make_number ((unsigned char) c)) \ 114 ? Faref (current_buffer->category_table, make_number ((unsigned char) c)) \
115 : Faref (current_buffer->category_table, \ 115 : Faref (current_buffer->category_table, \
116 COMPOSITE_CHAR_P (c) ? cmpchar_component ((c), 0) : (c))) 116 make_number (COMPOSITE_CHAR_P (c) \
117 ? cmpchar_component ((c), 0) : (c))))
117#endif 118#endif
118 119
119/* Return the doc string of CATEGORY in category table TABLE. */ 120/* Return the doc string of CATEGORY in category table TABLE. */
diff --git a/src/ccl.c b/src/ccl.c
index 8b10e6fce0a..1d34418895e 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -654,7 +654,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
654 654
655 case CCL_WriteArrayReadJump: /* A--D--D--R--E--S--S-rrrXXXXX */ 655 case CCL_WriteArrayReadJump: /* A--D--D--R--E--S--S-rrrXXXXX */
656 i = reg[rrr]; 656 i = reg[rrr];
657 j = ccl_prog[ic]; 657 j = XINT (ccl_prog[ic]);
658 if ((unsigned int) i < j) 658 if ((unsigned int) i < j)
659 { 659 {
660 i = XINT (ccl_prog[ic + 1 + i]); 660 i = XINT (ccl_prog[ic + 1 + i]);
diff --git a/src/coding.c b/src/coding.c
index b04912ceba6..75e4980ec1b 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -702,7 +702,9 @@ detect_coding_iso2022 (src, src_end)
702/* Set designation state into CODING. */ 702/* Set designation state into CODING. */
703#define DECODE_DESIGNATION(reg, dimension, chars, final_char) \ 703#define DECODE_DESIGNATION(reg, dimension, chars, final_char) \
704 do { \ 704 do { \
705 int charset = ISO_CHARSET_TABLE (dimension, chars, final_char); \ 705 int charset = ISO_CHARSET_TABLE (make_number (dimension), \
706 make_number (chars), \
707 make_number (final_char)); \
706 if (charset >= 0) \ 708 if (charset >= 0) \
707 { \ 709 { \
708 if (coding->direction == 1 \ 710 if (coding->direction == 1 \
@@ -3515,9 +3517,10 @@ which is a list of all the arguments given to `find-coding-system'.")
3515 || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) 3517 || (EQ (operation, Qopen_network_stream) && INTEGERP (target))))
3516 error ("Invalid %dth argument", XINT (target_idx) + 1); 3518 error ("Invalid %dth argument", XINT (target_idx) + 1);
3517 3519
3518 chain = (operation == Qinsert_file_contents || operation == Qwrite_region 3520 chain = ((EQ (operation, Qinsert_file_contents)
3521 || EQ (operation, Qwrite_region))
3519 ? Vfile_coding_system_alist 3522 ? Vfile_coding_system_alist
3520 : (operation == Qopen_network_stream 3523 : (EQ (operation, Qopen_network_stream)
3521 ? Vnetwork_coding_system_alist 3524 ? Vnetwork_coding_system_alist
3522 : Vprocess_coding_system_alist)); 3525 : Vprocess_coding_system_alist));
3523 if (NILP (chain)) 3526 if (NILP (chain))
diff --git a/src/config.in b/src/config.in
index ae403b21999..c5ed60c811b 100644
--- a/src/config.in
+++ b/src/config.in
@@ -324,6 +324,7 @@ Boston, MA 02111-1307, USA. */
324#ifdef emacs /* Don't do this for lib-src. */ 324#ifdef emacs /* Don't do this for lib-src. */
325/* Tell regex.c to use a type compatible with Emacs. */ 325/* Tell regex.c to use a type compatible with Emacs. */
326#define RE_TRANSLATE_TYPE Lisp_Object * 326#define RE_TRANSLATE_TYPE Lisp_Object *
327#define RE_TRANSLATE(TBL, C) XINT ((TBL)[C])
327#endif 328#endif
328 329
329/* Avoid link-time collision with system mktime if we will use our own. */ 330/* Avoid link-time collision with system mktime if we will use our own. */
diff --git a/src/editfns.c b/src/editfns.c
index 7e663cccb27..72a954b8986 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -981,7 +981,7 @@ If you want them to stand for years in this century, you must do that yourself."
981 char *tzstring; 981 char *tzstring;
982 char **oldenv = environ, **newenv; 982 char **oldenv = environ, **newenv;
983 983
984 if (zone == Qt) 984 if (EQ (zone, Qt))
985 tzstring = "UTC0"; 985 tzstring = "UTC0";
986 else if (STRINGP (zone)) 986 else if (STRINGP (zone))
987 tzstring = (char *) XSTRING (zone)->data; 987 tzstring = (char *) XSTRING (zone)->data;
@@ -1146,7 +1146,7 @@ If TZ is t, use Universal Time.")
1146 1146
1147 if (NILP (tz)) 1147 if (NILP (tz))
1148 tzstring = 0; 1148 tzstring = 0;
1149 else if (tz == Qt) 1149 else if (EQ (tz, Qt))
1150 tzstring = "UTC0"; 1150 tzstring = "UTC0";
1151 else 1151 else
1152 { 1152 {
diff --git a/src/fileio.c b/src/fileio.c
index f59df5fce97..c397cd0f474 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3726,6 +3726,7 @@ This does code conversion according to the value of\n\
3726} 3726}
3727 3727
3728static Lisp_Object build_annotations (); 3728static Lisp_Object build_annotations ();
3729extern Lisp_Object Ffile_locked_p ();
3729 3730
3730/* If build_annotations switched buffers, switch back to BUF. 3731/* If build_annotations switched buffers, switch back to BUF.
3731 Kill the temporary buffer that was selected in the meantime. 3732 Kill the temporary buffer that was selected in the meantime.
@@ -5065,7 +5066,7 @@ The value should be either ?/ or ?\\ (any other value is treated as ?\\).\n\
5065This variable affects the built-in functions only on Windows,\n\ 5066This variable affects the built-in functions only on Windows,\n\
5066on other platforms, it is initialized so that Lisp code can find out\n\ 5067on other platforms, it is initialized so that Lisp code can find out\n\
5067what the normal separator is."); 5068what the normal separator is.");
5068 Vdirectory_sep_char = '/'; 5069 XSETFASTINT (Vdirectory_sep_char, '/');
5069 5070
5070 DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist, 5071 DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist,
5071 "*Alist of elements (REGEXP . HANDLER) for file names handled specially.\n\ 5072 "*Alist of elements (REGEXP . HANDLER) for file names handled specially.\n\
diff --git a/src/fns.c b/src/fns.c
index 473f9ed17d6..6da0d354b5b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -584,7 +584,7 @@ This function allows vectors as well as strings.")
584 size = XVECTOR (string)->size; 584 size = XVECTOR (string)->size;
585 585
586 if (NILP (to)) 586 if (NILP (to))
587 to = size; 587 XSETINT (to, size);
588 else 588 else
589 CHECK_NUMBER (to, 2); 589 CHECK_NUMBER (to, 2);
590 590
@@ -1185,6 +1185,8 @@ internal_equal (o1, o2, depth)
1185 return 0; 1185 return 0;
1186} 1186}
1187 1187
1188extern Lisp_Object Fmake_char_internal ();
1189
1188DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0, 1190DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0,
1189 "Store each element of ARRAY with ITEM.\n\ 1191 "Store each element of ARRAY with ITEM.\n\
1190ARRAY is a vector, string, char-table, or bool-vector.") 1192ARRAY is a vector, string, char-table, or bool-vector.")
diff --git a/src/indent.c b/src/indent.c
index e2c7f12d29d..ab82f8212b4 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -208,8 +208,9 @@ skip_invisible (pos, next_boundary_p, to, window)
208 int to; 208 int to;
209 Lisp_Object window; 209 Lisp_Object window;
210{ 210{
211 Lisp_Object prop, position, end, overlay_limit, proplimit; 211 Lisp_Object prop, position, overlay_limit, proplimit;
212 Lisp_Object buffer; 212 Lisp_Object buffer;
213 int end;
213 214
214 XSETFASTINT (position, pos); 215 XSETFASTINT (position, pos);
215 XSETBUFFER (buffer, current_buffer); 216 XSETBUFFER (buffer, current_buffer);
@@ -239,8 +240,8 @@ skip_invisible (pos, next_boundary_p, to, window)
239 /* No matter what. don't go past next overlay change. */ 240 /* No matter what. don't go past next overlay change. */
240 if (XFASTINT (overlay_limit) < XFASTINT (proplimit)) 241 if (XFASTINT (overlay_limit) < XFASTINT (proplimit))
241 proplimit = overlay_limit; 242 proplimit = overlay_limit;
242 end = Fnext_single_property_change (position, Qinvisible, 243 end = XFASTINT (Fnext_single_property_change (position, Qinvisible,
243 buffer, proplimit); 244 buffer, proplimit));
244 /* Don't put the boundary in the middle of multibyte form if 245 /* Don't put the boundary in the middle of multibyte form if
245 there is no actual property change. */ 246 there is no actual property change. */
246 if (end == pos + 100 247 if (end == pos + 100
@@ -248,7 +249,7 @@ skip_invisible (pos, next_boundary_p, to, window)
248 && end < ZV) 249 && end < ZV)
249 while (pos < end && !CHAR_HEAD_P (POS_ADDR (end))) 250 while (pos < end && !CHAR_HEAD_P (POS_ADDR (end)))
250 end--; 251 end--;
251 *next_boundary_p = XFASTINT (end); 252 *next_boundary_p = end;
252 } 253 }
253 /* if the `invisible' property is set, we can skip to 254 /* if the `invisible' property is set, we can skip to
254 the next property change */ 255 the next property change */
diff --git a/src/intervals.c b/src/intervals.c
index fa23272160b..995b1cfb2eb 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -85,7 +85,7 @@ create_root_interval (parent)
85 XSTRING (parent)->intervals = new; 85 XSTRING (parent)->intervals = new;
86 } 86 }
87 87
88 new->parent = (INTERVAL) parent; 88 new->parent = (INTERVAL) XFASTINT (parent);
89 new->position = 1; 89 new->position = 1;
90 90
91 return new; 91 return new;
@@ -411,7 +411,7 @@ balance_possible_root_interval (interval)
411 if (interval->parent == NULL_INTERVAL) 411 if (interval->parent == NULL_INTERVAL)
412 return interval; 412 return interval;
413 413
414 parent = (Lisp_Object) (interval->parent); 414 XSETFASTINT (parent, (EMACS_INT) interval->parent);
415 interval = balance_an_interval (interval); 415 interval = balance_an_interval (interval);
416 416
417 if (BUFFERP (parent)) 417 if (BUFFERP (parent))
@@ -1130,10 +1130,10 @@ delete_interval (i)
1130 if (ROOT_INTERVAL_P (i)) 1130 if (ROOT_INTERVAL_P (i))
1131 { 1131 {
1132 Lisp_Object owner; 1132 Lisp_Object owner;
1133 owner = (Lisp_Object) i->parent; 1133 XSETFASTINT (owner, (EMACS_INT) i->parent);
1134 parent = delete_node (i); 1134 parent = delete_node (i);
1135 if (! NULL_INTERVAL_P (parent)) 1135 if (! NULL_INTERVAL_P (parent))
1136 parent->parent = (INTERVAL) owner; 1136 parent->parent = (INTERVAL) XFASTINT (owner);
1137 1137
1138 if (BUFFERP (owner)) 1138 if (BUFFERP (owner))
1139 BUF_INTERVALS (XBUFFER (owner)) = parent; 1139 BUF_INTERVALS (XBUFFER (owner)) = parent;
@@ -1868,7 +1868,7 @@ move_if_not_intangible (position)
1868 if (! NILP (Vinhibit_point_motion_hooks)) 1868 if (! NILP (Vinhibit_point_motion_hooks))
1869 /* If intangible is inhibited, always move point to POSITION. */ 1869 /* If intangible is inhibited, always move point to POSITION. */
1870 ; 1870 ;
1871 else if (PT < position && pos < ZV) 1871 else if (PT < position && XINT (pos) < ZV)
1872 { 1872 {
1873 /* We want to move forward, so check the text before POSITION. */ 1873 /* We want to move forward, so check the text before POSITION. */
1874 1874
@@ -1884,7 +1884,7 @@ move_if_not_intangible (position)
1884 intangible_propval)) 1884 intangible_propval))
1885 pos = Fprevious_char_property_change (pos, Qnil); 1885 pos = Fprevious_char_property_change (pos, Qnil);
1886 } 1886 }
1887 else if (pos > BEGV) 1887 else if (XINT (pos) > BEGV)
1888 { 1888 {
1889 /* We want to move backward, so check the text after POSITION. */ 1889 /* We want to move backward, so check the text after POSITION. */
1890 1890
@@ -2010,7 +2010,7 @@ copy_intervals_to_string (string, buffer, position, length)
2010 if (NULL_INTERVAL_P (interval_copy)) 2010 if (NULL_INTERVAL_P (interval_copy))
2011 return; 2011 return;
2012 2012
2013 interval_copy->parent = (INTERVAL) string; 2013 interval_copy->parent = (INTERVAL) XFASTINT (string);
2014 XSTRING (string)->intervals = interval_copy; 2014 XSTRING (string)->intervals = interval_copy;
2015} 2015}
2016 2016
diff --git a/src/intervals.h b/src/intervals.h
index d19a92a4608..aa914ceff98 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -37,9 +37,15 @@ Boston, MA 02111-1307, USA. */
37/* True if an interval pointer is null, or is a Lisp_Buffer or 37/* True if an interval pointer is null, or is a Lisp_Buffer or
38 Lisp_String pointer (meaning it points to the owner of this 38 Lisp_String pointer (meaning it points to the owner of this
39 interval tree). */ 39 interval tree). */
40#ifdef NO_UNION_TYPE
40#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL \ 41#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL \
41 || BUFFERP ((Lisp_Object)(i)) \ 42 || BUFFERP ((Lisp_Object)(i)) \
42 || STRINGP ((Lisp_Object)(i))) 43 || STRINGP ((Lisp_Object)(i)))
44#else
45#define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL \
46 || BUFFERP ((Lisp_Object){(EMACS_INT)(i)}) \
47 || STRINGP ((Lisp_Object){(EMACS_INT)(i)}))
48#endif
43 49
44/* True if this interval has no right child. */ 50/* True if this interval has no right child. */
45#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL) 51#define NULL_RIGHT_CHILD(i) ((i)->right == NULL_INTERVAL)
diff --git a/src/keymap.c b/src/keymap.c
index ef7e90df53a..5d18cf9349d 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -538,8 +538,7 @@ get_keyelt (object, autoload)
538 key = Fcdr (object); 538 key = Fcdr (object);
539 if (INTEGERP (key) && (XINT (key) & meta_modifier)) 539 if (INTEGERP (key) && (XINT (key) & meta_modifier))
540 { 540 {
541 object = access_keymap (map, make_number (meta_prefix_char), 541 object = access_keymap (map, meta_prefix_char, 0, 0);
542 0, 0);
543 map = get_keymap_1 (object, 0, autoload); 542 map = get_keymap_1 (object, 0, autoload);
544 object = access_keymap (map, 543 object = access_keymap (map,
545 make_number (XINT (key) & ~meta_modifier), 544 make_number (XINT (key) & ~meta_modifier),
@@ -1515,8 +1514,8 @@ then the value includes only maps for prefixes that start with PREFIX.")
1515 1514
1516 element = thisseq; 1515 element = thisseq;
1517 tem = Fvconcat (1, &element); 1516 tem = Fvconcat (1, &element);
1518 XVECTOR (tem)->contents[XINT (last)] 1517 XSETFASTINT (XVECTOR (tem)->contents[XINT (last)],
1519 = XINT (elt) | meta_modifier; 1518 XINT (elt) | meta_modifier);
1520 1519
1521 /* This new sequence is the same length as 1520 /* This new sequence is the same length as
1522 thisseq, so stick it in the list right 1521 thisseq, so stick it in the list right
@@ -2746,7 +2745,7 @@ describe_vector (vector, elt_prefix, elt_describer,
2746 int starting_i; 2745 int starting_i;
2747 2746
2748 if (indices == 0) 2747 if (indices == 0)
2749 indices = (Lisp_Object *) alloca (3 * sizeof (Lisp_Object)); 2748 indices = (int *) alloca (3 * sizeof (int));
2750 2749
2751 definition = Qnil; 2750 definition = Qnil;
2752 2751
diff --git a/src/lisp.h b/src/lisp.h
index f104af63794..ecfc0b657c2 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -608,11 +608,11 @@ struct Lisp_Vector
608 and 8-bit Europeans characters. For these characters, do not check 608 and 8-bit Europeans characters. For these characters, do not check
609 validity of CT. Do not follow parent. */ 609 validity of CT. Do not follow parent. */
610#define CHAR_TABLE_REF(CT, IDX) \ 610#define CHAR_TABLE_REF(CT, IDX) \
611 (XFASTINT (IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS \ 611 ((IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
612 ? (!NILP (XCHAR_TABLE (CT)->contents[XFASTINT (IDX)])\ 612 ? (!NILP (XCHAR_TABLE (CT)->contents[IDX]) \
613 ? XCHAR_TABLE (CT)->contents[XFASTINT (IDX)] \ 613 ? XCHAR_TABLE (CT)->contents[IDX] \
614 : XCHAR_TABLE (CT)->defalt) \ 614 : XCHAR_TABLE (CT)->defalt) \
615 : Faref (CT, IDX)) 615 : Faref (CT, make_number (IDX)))
616 616
617/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and 617/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
618 8-bit Europeans characters. Do not check validity of CT. */ 618 8-bit Europeans characters. Do not check validity of CT. */
@@ -1314,7 +1314,8 @@ extern char *stack_bottom;
1314#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) 1314#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))
1315 1315
1316/* Variables used locally in the following case handling macros. */ 1316/* Variables used locally in the following case handling macros. */
1317extern Lisp_Object case_temp1, case_temp2; 1317extern int case_temp1;
1318extern Lisp_Object case_temp2;
1318 1319
1319/* Current buffer's map from characters to lower-case characters. */ 1320/* Current buffer's map from characters to lower-case characters. */
1320 1321
@@ -1484,6 +1485,7 @@ extern Lisp_Object Ffset (), Fsetplist ();
1484extern Lisp_Object Fsymbol_value (), find_symbol_value (), Fset (); 1485extern Lisp_Object Fsymbol_value (), find_symbol_value (), Fset ();
1485extern Lisp_Object Fdefault_value (), Fset_default (), Fdefault_boundp (); 1486extern Lisp_Object Fdefault_value (), Fset_default (), Fdefault_boundp ();
1486extern Lisp_Object Fmake_local_variable (); 1487extern Lisp_Object Fmake_local_variable ();
1488extern Lisp_Object Flocal_variable_if_set_p ();
1487 1489
1488extern Lisp_Object Faref (), Faset (); 1490extern Lisp_Object Faref (), Faset ();
1489 1491
@@ -1517,6 +1519,7 @@ extern Lisp_Object Fend_of_line (), Fforward_char (), Fforward_line ();
1517/* Defined in coding.c */ 1519/* Defined in coding.c */
1518extern Lisp_Object Fcoding_system_p (), Fcheck_coding_system (); 1520extern Lisp_Object Fcoding_system_p (), Fcheck_coding_system ();
1519extern Lisp_Object Fread_coding_system (), Fread_non_nil_coding_system (); 1521extern Lisp_Object Fread_coding_system (), Fread_non_nil_coding_system ();
1522extern Lisp_Object Ffind_coding_system ();
1520 1523
1521/* Defined in syntax.c */ 1524/* Defined in syntax.c */
1522extern Lisp_Object Fforward_word (); 1525extern Lisp_Object Fforward_word ();
@@ -1539,6 +1542,8 @@ extern Lisp_Object assq_no_quit ();
1539extern Lisp_Object Fcopy_alist (); 1542extern Lisp_Object Fcopy_alist ();
1540extern Lisp_Object Fplist_get (); 1543extern Lisp_Object Fplist_get ();
1541extern Lisp_Object Fset_char_table_parent (); 1544extern Lisp_Object Fset_char_table_parent ();
1545extern Lisp_Object Fchar_table_extra_slot ();
1546extern Lisp_Object Frassoc ();
1542 1547
1543/* Defined in insdel.c */ 1548/* Defined in insdel.c */
1544extern void move_gap (); 1549extern void move_gap ();
@@ -1675,6 +1680,7 @@ extern Lisp_Object save_excursion_save (), save_restriction_save ();
1675extern Lisp_Object save_excursion_restore (), save_restriction_restore (); 1680extern Lisp_Object save_excursion_restore (), save_restriction_restore ();
1676extern Lisp_Object Fchar_to_string (); 1681extern Lisp_Object Fchar_to_string ();
1677extern Lisp_Object Fdelete_region (), Fnarrow_to_region (), Fwiden (); 1682extern Lisp_Object Fdelete_region (), Fnarrow_to_region (), Fwiden ();
1683extern Lisp_Object Fuser_login_name (), Fsystem_name ();
1678 1684
1679/* defined in buffer.c */ 1685/* defined in buffer.c */
1680extern Lisp_Object Foverlay_start (), Foverlay_end (); 1686extern Lisp_Object Foverlay_start (), Foverlay_end ();
@@ -1695,6 +1701,7 @@ extern Lisp_Object Ferase_buffer ();
1695extern Lisp_Object Qoverlayp; 1701extern Lisp_Object Qoverlayp;
1696extern Lisp_Object get_truename_buffer (); 1702extern Lisp_Object get_truename_buffer ();
1697extern struct buffer *all_buffers; 1703extern struct buffer *all_buffers;
1704extern Lisp_Object Fprevious_overlay_change ();
1698 1705
1699/* defined in marker.c */ 1706/* defined in marker.c */
1700 1707
@@ -1719,6 +1726,7 @@ extern Lisp_Object Ffile_accessible_directory_p ();
1719extern Lisp_Object Funhandled_file_name_directory (); 1726extern Lisp_Object Funhandled_file_name_directory ();
1720extern Lisp_Object Ffile_directory_p (); 1727extern Lisp_Object Ffile_directory_p ();
1721extern Lisp_Object Fwrite_region (); 1728extern Lisp_Object Fwrite_region ();
1729extern Lisp_Object Ffile_readable_p (), Ffile_executable_p ();
1722 1730
1723/* Defined in abbrev.c */ 1731/* Defined in abbrev.c */
1724 1732
@@ -1788,6 +1796,7 @@ extern void describe_map_tree ();
1788 1796
1789/* defined in indent.c */ 1797/* defined in indent.c */
1790extern Lisp_Object Fvertical_motion (), Findent_to (), Fcurrent_column (); 1798extern Lisp_Object Fvertical_motion (), Findent_to (), Fcurrent_column ();
1799extern Lisp_Object Fmove_to_column ();
1791 1800
1792/* defined in window.c */ 1801/* defined in window.c */
1793extern Lisp_Object Qwindowp, Qwindow_live_p; 1802extern Lisp_Object Qwindowp, Qwindow_live_p;
@@ -1838,6 +1847,7 @@ extern Lisp_Object Fset_frame_size ();
1838extern Lisp_Object Fset_frame_position (); 1847extern Lisp_Object Fset_frame_position ();
1839extern Lisp_Object Fraise_frame (); 1848extern Lisp_Object Fraise_frame ();
1840extern Lisp_Object Fredirect_frame_focus (); 1849extern Lisp_Object Fredirect_frame_focus ();
1850extern Lisp_Object frame_buffer_list ();
1841 1851
1842/* defined in emacs.c */ 1852/* defined in emacs.c */
1843extern Lisp_Object decode_env_path (); 1853extern Lisp_Object decode_env_path ();
@@ -1891,6 +1901,8 @@ extern Lisp_Object Fprevious_single_property_change ();
1891extern Lisp_Object Fget_text_property (), Fput_text_property (); 1901extern Lisp_Object Fget_text_property (), Fput_text_property ();
1892extern Lisp_Object Fset_text_properties (); 1902extern Lisp_Object Fset_text_properties ();
1893extern Lisp_Object Ftext_property_not_all (); 1903extern Lisp_Object Ftext_property_not_all ();
1904extern Lisp_Object Fprevious_char_property_change ();
1905extern Lisp_Object Fnext_char_property_change ();
1894 1906
1895/* defined in intervals.c */ 1907/* defined in intervals.c */
1896extern Lisp_Object get_local_map (); 1908extern Lisp_Object get_local_map ();
diff --git a/src/minibuf.c b/src/minibuf.c
index a4dd9379e0a..4a2c805f170 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -956,7 +956,7 @@ scmp (s1, s2, len)
956 956
957 if (completion_ignore_case) 957 if (completion_ignore_case)
958 { 958 {
959 while (l && EQ (DOWNCASE (*s1++), DOWNCASE (*s2++))) 959 while (l && DOWNCASE (*s1++) == DOWNCASE (*s2++))
960 l--; 960 l--;
961 } 961 }
962 else 962 else
diff --git a/src/print.c b/src/print.c
index 6ac2b25745d..b399d63c091 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1063,7 +1063,7 @@ print (obj, printcharfun, escapeflag)
1063 else 1063 else
1064 { 1064 {
1065 if (CONSP (printed_gensyms)) 1065 if (CONSP (printed_gensyms))
1066 XSETFASTINT (tem, XCDR (XCAR (printed_gensyms)) + 1); 1066 XSETFASTINT (tem, XFASTINT (XCDR (XCAR (printed_gensyms))) + 1);
1067 else 1067 else
1068 XSETFASTINT (tem, 1); 1068 XSETFASTINT (tem, 1);
1069 printed_gensyms = Fcons (Fcons (obj, tem), printed_gensyms); 1069 printed_gensyms = Fcons (Fcons (obj, tem), printed_gensyms);
diff --git a/src/syntax.c b/src/syntax.c
index 4a60e1e0267..f39b356d731 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -190,7 +190,7 @@ update_syntax_table (pos, count, init, object)
190 190
191 gl_state.current_syntax_table = tmp_table; 191 gl_state.current_syntax_table = tmp_table;
192 gl_state.old_prop = tmp_table; 192 gl_state.old_prop = tmp_table;
193 if (Fsyntax_table_p (tmp_table) == Qt) 193 if (EQ (Fsyntax_table_p (tmp_table), Qt))
194 { 194 {
195 gl_state.use_global = 0; 195 gl_state.use_global = 0;
196 } 196 }
@@ -665,7 +665,7 @@ DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0,
665 char_int = XINT (character); 665 char_int = XINT (character);
666 code = SYNTAX (char_int); 666 code = SYNTAX (char_int);
667 if (code == Sopen || code == Sclose) 667 if (code == Sopen || code == Sclose)
668 return make_number (SYNTAX_MATCH (char_int)); 668 return SYNTAX_MATCH (char_int);
669 return Qnil; 669 return Qnil;
670} 670}
671 671
@@ -735,7 +735,7 @@ DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3,
735 p = XSTRING (newentry)->data; 735 p = XSTRING (newentry)->data;
736 code = (enum syntaxcode) syntax_spec_code[*p++]; 736 code = (enum syntaxcode) syntax_spec_code[*p++];
737 if (((int) code & 0377) == 0377) 737 if (((int) code & 0377) == 0377)
738 error ("invalid syntax description letter: %c", XINT (c)); 738 error ("invalid syntax description letter: %c", p[-1]);
739 739
740 if (code == Sinherit) 740 if (code == Sinherit)
741 { 741 {
diff --git a/src/syntax.h b/src/syntax.h
index 61cb4fa9668..bcd90562d29 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -134,7 +134,7 @@ extern Lisp_Object syntax_parent_lookup ();
134 ({ Lisp_Object temp; \ 134 ({ Lisp_Object temp; \
135 temp = SYNTAX_ENTRY (c); \ 135 temp = SYNTAX_ENTRY (c); \
136 (CONSP (temp) \ 136 (CONSP (temp) \
137 ? XINT (XCONS (temp)->cdr) \ 137 ? XCONS (temp)->cdr \
138 : Qnil); }) 138 : Qnil); })
139#else 139#else
140#define SYNTAX(c) \ 140#define SYNTAX(c) \
@@ -152,7 +152,7 @@ extern Lisp_Object syntax_parent_lookup ();
152#define SYNTAX_MATCH(c) \ 152#define SYNTAX_MATCH(c) \
153 (syntax_temp = SYNTAX_ENTRY ((c)), \ 153 (syntax_temp = SYNTAX_ENTRY ((c)), \
154 (CONSP (syntax_temp) \ 154 (CONSP (syntax_temp) \
155 ? XINT (XCONS (syntax_temp)->cdr) \ 155 ? XCONS (syntax_temp)->cdr \
156 : Qnil)) 156 : Qnil))
157#endif 157#endif
158 158
diff --git a/src/sysdep.c b/src/sysdep.c
index 978e7f0f622..8bde434f52d 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1283,7 +1283,7 @@ init_sys_modes ()
1283 tty = old_tty; 1283 tty = old_tty;
1284 1284
1285#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) 1285#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
1286 Vtty_erase_char = old_tty.main.c_cc[VERASE]; 1286 XSETINT (Vtty_erase_char, old_tty.main.c_cc[VERASE]);
1287 1287
1288#ifdef DGUX 1288#ifdef DGUX
1289 /* This allows meta to be sent on 8th bit. */ 1289 /* This allows meta to be sent on 8th bit. */
diff --git a/src/textprop.c b/src/textprop.c
index 3fafc38d129..89e08076b9a 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1739,13 +1739,11 @@ report_interval_modification (start, end)
1739 Lisp_Object start, end; 1739 Lisp_Object start, end;
1740{ 1740{
1741 if (! NILP (interval_insert_behind_hooks)) 1741 if (! NILP (interval_insert_behind_hooks))
1742 call_mod_hooks (interval_insert_behind_hooks, 1742 call_mod_hooks (interval_insert_behind_hooks, start, end);
1743 make_number (start), make_number (end));
1744 if (! NILP (interval_insert_in_front_hooks) 1743 if (! NILP (interval_insert_in_front_hooks)
1745 && ! EQ (interval_insert_in_front_hooks, 1744 && ! EQ (interval_insert_in_front_hooks,
1746 interval_insert_behind_hooks)) 1745 interval_insert_behind_hooks))
1747 call_mod_hooks (interval_insert_in_front_hooks, 1746 call_mod_hooks (interval_insert_in_front_hooks, start, end);
1748 make_number (start), make_number (end));
1749} 1747}
1750 1748
1751void 1749void