aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-03-29 17:39:12 -0700
committerPaul Eggert2011-03-29 17:39:12 -0700
commit77861b9528e3fbb5f406267ff298a95009530b7f (patch)
treed7eb3886831322f956d997d7bd10d034dfca5839 /src
parentd806ab682a8e914345db3f2eede292f85745c98c (diff)
parentde6dbc14a72347f3f2a3b4f0bf3c39d6f69a425e (diff)
downloademacs-77861b9528e3fbb5f406267ff298a95009530b7f.tar.gz
emacs-77861b9528e3fbb5f406267ff298a95009530b7f.zip
Fix more problems found by GCC 4.6.0's static checks.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog73
-rw-r--r--src/alloc.c47
-rw-r--r--src/callint.c5
-rw-r--r--src/callproc.c70
-rw-r--r--src/character.c10
-rw-r--r--src/charset.c7
-rw-r--r--src/chartab.c6
-rw-r--r--src/cm.c6
-rw-r--r--src/coding.c18
-rw-r--r--src/data.c31
-rw-r--r--src/dbusbind.c51
-rw-r--r--src/dispnew.c7
-rw-r--r--src/editfns.c42
-rw-r--r--src/eval.c102
-rw-r--r--src/fns.c63
-rw-r--r--src/font.c4
-rw-r--r--src/frame.c4
-rw-r--r--src/image.c6
-rw-r--r--src/keyboard.c162
-rw-r--r--src/keyboard.h4
-rw-r--r--src/lisp.h14
-rw-r--r--src/menu.c3
-rw-r--r--src/process.c15
-rw-r--r--src/syntax.c6
-rw-r--r--src/term.c2
-rw-r--r--src/unexelf.c4
-rw-r--r--src/window.c6
-rw-r--r--src/xdisp.c22
-rw-r--r--src/xselect.c10
-rw-r--r--src/xterm.c4
30 files changed, 450 insertions, 354 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1e77a6439e1..973b7712e53 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,76 @@
12011-03-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix more problems found by GCC 4.6.0's static checks.
4
5 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
6 Remove unused local var.
7
8 * editfns.c (Fmessage_box): Remove unused local var.
9
10 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12 Omit unused local vars.
13 * window.c (shrink_windows): Omit unused local var.
14 * menu.c (digest_single_submenu): Omit unused local var.
15 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16 Omit unused local var.
17
18 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19 Don't assume string length fits in int.
20 (keyremap_step, read_key_sequence): Use size_t for sizes.
21 (read_key_sequence): Don't check last_real_key_start redundantly.
22
23 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
24 instead of alloca (Bug#8344).
25
26 * eval.c (Fbacktrace): Don't assume nargs fits in int.
27 (Fbacktrace_frame): Don't assume nframes fits in int.
28
29 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
30
31 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
32 concerns.
33
34 * term.c (produce_glyphless_glyph): Remove unnecessary test.
35
36 * cm.c (calccost): Turn while-do into do-while, for clarity.
37
38 * keyboard.c (syms_of_keyboard): Use the same style as later
39 in this function when indexing through an array. This also
40 works around GCC bug 48267.
41
42 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
43
44 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
45
46 * chartab.c (sub_char_table_ref_and_range): Redo for slight
47 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
48
49 * keyboard.c, keyboard.h (num_input_events): Now size_t.
50 This avoids undefined behavior on integer overflow, and is a bit
51 more convenient anyway since it is compared to a size_t variable.
52
53 Variadic C functions now count arguments with size_t, not int.
54 This avoids an unnecessary limitation on 64-bit machines, which
55 caused (substring ...) to crash on large vectors (Bug#8344).
56 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
57 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
58 All variadic functions and their callers changed accordingly.
59 (struct gcpro.nvars): Now size_t, not int. All uses changed.
60 * data.c (arith_driver, float_arith_driver): Likewise.
61 * editfns.c (general_insert_function): Likewise.
62 * eval.c (struct backtrace.nargs, interactive_p)
63 (internal_condition_case_n, run_hook_with_args, apply_lambda)
64 (funcall_lambda, mark_backtrace): Likewise.
65 * fns.c (concat): Likewise.
66 * frame.c (x_set_frame_parameters): Likewise.
67 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
68 0 if not found, not -1. All callers changed.
69
70 * alloc.c (garbage_collect): Don't assume stack size fits in int.
71 (stack_copy_size): Now size_t, not int.
72 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
73
12011-03-28 Juanma Barranquero <lekktu@gmail.com> 742011-03-28 Juanma Barranquero <lekktu@gmail.com>
2 75
3 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end', 76 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
diff --git a/src/alloc.c b/src/alloc.c
index 66695e7a9bc..177a2266fb6 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -254,8 +254,10 @@ const char *pending_malloc_warning;
254 254
255/* Buffer in which we save a copy of the C stack at each GC. */ 255/* Buffer in which we save a copy of the C stack at each GC. */
256 256
257#if MAX_SAVE_STACK > 0
257static char *stack_copy; 258static char *stack_copy;
258static int stack_copy_size; 259static size_t stack_copy_size;
260#endif
259 261
260/* Non-zero means ignore malloc warnings. Set during initialization. 262/* Non-zero means ignore malloc warnings. Set during initialization.
261 Currently not used. */ 263 Currently not used. */
@@ -2705,7 +2707,7 @@ DEFUN ("list", Flist, Slist, 0, MANY, 0,
2705 doc: /* Return a newly created list with specified arguments as elements. 2707 doc: /* Return a newly created list with specified arguments as elements.
2706Any number of arguments, even zero arguments, are allowed. 2708Any number of arguments, even zero arguments, are allowed.
2707usage: (list &rest OBJECTS) */) 2709usage: (list &rest OBJECTS) */)
2708 (int nargs, register Lisp_Object *args) 2710 (size_t nargs, register Lisp_Object *args)
2709{ 2711{
2710 register Lisp_Object val; 2712 register Lisp_Object val;
2711 val = Qnil; 2713 val = Qnil;
@@ -2921,10 +2923,10 @@ DEFUN ("vector", Fvector, Svector, 0, MANY, 0,
2921 doc: /* Return a newly created vector with specified arguments as elements. 2923 doc: /* Return a newly created vector with specified arguments as elements.
2922Any number of arguments, even zero arguments, are allowed. 2924Any number of arguments, even zero arguments, are allowed.
2923usage: (vector &rest OBJECTS) */) 2925usage: (vector &rest OBJECTS) */)
2924 (register int nargs, Lisp_Object *args) 2926 (register size_t nargs, Lisp_Object *args)
2925{ 2927{
2926 register Lisp_Object len, val; 2928 register Lisp_Object len, val;
2927 register int i; 2929 register size_t i;
2928 register struct Lisp_Vector *p; 2930 register struct Lisp_Vector *p;
2929 2931
2930 XSETFASTINT (len, nargs); 2932 XSETFASTINT (len, nargs);
@@ -2943,10 +2945,10 @@ stack size, (optional) doc string, and (optional) interactive spec.
2943The first four arguments are required; at most six have any 2945The first four arguments are required; at most six have any
2944significance. 2946significance.
2945usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) 2947usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */)
2946 (register int nargs, Lisp_Object *args) 2948 (register size_t nargs, Lisp_Object *args)
2947{ 2949{
2948 register Lisp_Object len, val; 2950 register Lisp_Object len, val;
2949 register int i; 2951 register size_t i;
2950 register struct Lisp_Vector *p; 2952 register struct Lisp_Vector *p;
2951 2953
2952 XSETFASTINT (len, nargs); 2954 XSETFASTINT (len, nargs);
@@ -4228,7 +4230,7 @@ static void
4228check_gcpros (void) 4230check_gcpros (void)
4229{ 4231{
4230 struct gcpro *p; 4232 struct gcpro *p;
4231 int i; 4233 size_t i;
4232 4234
4233 for (p = gcprolist; p; p = p->next) 4235 for (p = gcprolist; p; p = p->next)
4234 for (i = 0; i < p->nvars; ++i) 4236 for (i = 0; i < p->nvars; ++i)
@@ -4837,7 +4839,7 @@ returns nil, because real GC can't be done. */)
4837{ 4839{
4838 register struct specbinding *bind; 4840 register struct specbinding *bind;
4839 char stack_top_variable; 4841 char stack_top_variable;
4840 register int i; 4842 register size_t i;
4841 int message_p; 4843 int message_p;
4842 Lisp_Object total[8]; 4844 Lisp_Object total[8];
4843 int count = SPECPDL_INDEX (); 4845 int count = SPECPDL_INDEX ();
@@ -4903,21 +4905,26 @@ returns nil, because real GC can't be done. */)
4903#if MAX_SAVE_STACK > 0 4905#if MAX_SAVE_STACK > 0
4904 if (NILP (Vpurify_flag)) 4906 if (NILP (Vpurify_flag))
4905 { 4907 {
4906 i = &stack_top_variable - stack_bottom; 4908 char *stack;
4907 if (i < 0) i = -i; 4909 size_t stack_size;
4908 if (i < MAX_SAVE_STACK) 4910 if (&stack_top_variable < stack_bottom)
4909 { 4911 {
4910 if (stack_copy == 0) 4912 stack = &stack_top_variable;
4911 stack_copy = (char *) xmalloc (stack_copy_size = i); 4913 stack_size = stack_bottom - &stack_top_variable;
4912 else if (stack_copy_size < i) 4914 }
4913 stack_copy = (char *) xrealloc (stack_copy, (stack_copy_size = i)); 4915 else
4914 if (stack_copy) 4916 {
4917 stack = stack_bottom;
4918 stack_size = &stack_top_variable - stack_bottom;
4919 }
4920 if (stack_size <= MAX_SAVE_STACK)
4921 {
4922 if (stack_copy_size < stack_size)
4915 { 4923 {
4916 if ((EMACS_INT) (&stack_top_variable - stack_bottom) > 0) 4924 stack_copy = (char *) xrealloc (stack_copy, stack_size);
4917 memcpy (stack_copy, stack_bottom, i); 4925 stack_copy_size = stack_size;
4918 else
4919 memcpy (stack_copy, &stack_top_variable, i);
4920 } 4926 }
4927 memcpy (stack_copy, stack, stack_size);
4921 } 4928 }
4922 } 4929 }
4923#endif /* MAX_SAVE_STACK > 0 */ 4930#endif /* MAX_SAVE_STACK > 0 */
diff --git a/src/callint.c b/src/callint.c
index bb815a5bd01..40d89acd16c 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -265,8 +265,9 @@ invoke it. If KEYS is omitted or nil, the return value of
265 recorded as a call to the function named callint_argfuns[varies[i]]. */ 265 recorded as a call to the function named callint_argfuns[varies[i]]. */
266 int *varies; 266 int *varies;
267 267
268 register int i, j; 268 register size_t i, j;
269 int count, foo; 269 size_t count;
270 int foo;
270 char prompt1[100]; 271 char prompt1[100];
271 char *tem1; 272 char *tem1;
272 int arg_from_tty = 0; 273 int arg_from_tty = 0;
diff --git a/src/callproc.c b/src/callproc.c
index 75f239d1be2..eb2a2268fe1 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -177,7 +177,7 @@ and returns a numeric exit status or a signal description string.
177If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. 177If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.
178 178
179usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) 179usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
180 (int nargs, register Lisp_Object *args) 180 (size_t nargs, register Lisp_Object *args)
181{ 181{
182 Lisp_Object infile, buffer, current_dir, path; 182 Lisp_Object infile, buffer, current_dir, path;
183 volatile int display_p_volatile; 183 volatile int display_p_volatile;
@@ -189,6 +189,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
189 char buf[CALLPROC_BUFFER_SIZE_MAX]; 189 char buf[CALLPROC_BUFFER_SIZE_MAX];
190 int bufsize = CALLPROC_BUFFER_SIZE_MIN; 190 int bufsize = CALLPROC_BUFFER_SIZE_MIN;
191 int count = SPECPDL_INDEX (); 191 int count = SPECPDL_INDEX ();
192 volatile USE_SAFE_ALLOCA;
192 193
193 const unsigned char **volatile new_argv_volatile; 194 const unsigned char **volatile new_argv_volatile;
194 register const unsigned char **new_argv; 195 register const unsigned char **new_argv;
@@ -221,7 +222,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
221 /* Decide the coding-system for giving arguments. */ 222 /* Decide the coding-system for giving arguments. */
222 { 223 {
223 Lisp_Object val, *args2; 224 Lisp_Object val, *args2;
224 int i; 225 size_t i;
225 226
226 /* If arguments are supplied, we may have to encode them. */ 227 /* If arguments are supplied, we may have to encode them. */
227 if (nargs >= 5) 228 if (nargs >= 5)
@@ -242,7 +243,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
242 val = Qraw_text; 243 val = Qraw_text;
243 else 244 else
244 { 245 {
245 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); 246 SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2);
246 args2[0] = Qcall_process; 247 args2[0] = Qcall_process;
247 for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; 248 for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
248 coding_systems = Ffind_operation_coding_system (nargs + 1, args2); 249 coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
@@ -372,11 +373,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
372 && SREF (path, 1) == ':') 373 && SREF (path, 1) == ':')
373 path = Fsubstring (path, make_number (2), Qnil); 374 path = Fsubstring (path, make_number (2), Qnil);
374 375
375 new_argv_volatile = new_argv = (const unsigned char **) 376 SAFE_ALLOCA (new_argv, const unsigned char **,
376 alloca (max (2, nargs - 2) * sizeof (char *)); 377 (nargs > 4 ? nargs - 2 : 2) * sizeof *new_argv);
378 new_argv_volatile = new_argv;
377 if (nargs > 4) 379 if (nargs > 4)
378 { 380 {
379 register int i; 381 register size_t i;
380 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 382 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
381 383
382 GCPRO5 (infile, buffer, current_dir, path, error_file); 384 GCPRO5 (infile, buffer, current_dir, path, error_file);
@@ -643,9 +645,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
643 { 645 {
644 if (EQ (coding_systems, Qt)) 646 if (EQ (coding_systems, Qt))
645 { 647 {
646 int i; 648 size_t i;
647 649
648 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); 650 SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2);
649 args2[0] = Qcall_process; 651 args2[0] = Qcall_process;
650 for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; 652 for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
651 coding_systems 653 coding_systems
@@ -809,6 +811,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
809 when exiting. */ 811 when exiting. */
810 call_process_exited = 1; 812 call_process_exited = 1;
811 813
814 SAFE_FREE ();
812 unbind_to (count, Qnil); 815 unbind_to (count, Qnil);
813 816
814 if (synch_process_termsig) 817 if (synch_process_termsig)
@@ -864,7 +867,7 @@ and returns a numeric exit status or a signal description string.
864If you quit, the process is killed with SIGINT, or SIGKILL if you quit again. 867If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.
865 868
866usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &rest ARGS) */) 869usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &rest ARGS) */)
867 (int nargs, register Lisp_Object *args) 870 (size_t nargs, register Lisp_Object *args)
868{ 871{
869 struct gcpro gcpro1; 872 struct gcpro gcpro1;
870 Lisp_Object filename_string; 873 Lisp_Object filename_string;
@@ -873,7 +876,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
873 /* Qt denotes we have not yet called Ffind_operation_coding_system. */ 876 /* Qt denotes we have not yet called Ffind_operation_coding_system. */
874 Lisp_Object coding_systems; 877 Lisp_Object coding_systems;
875 Lisp_Object val, *args2; 878 Lisp_Object val, *args2;
876 int i; 879 size_t i;
877 char *tempfile; 880 char *tempfile;
878 Lisp_Object tmpdir, pattern; 881 Lisp_Object tmpdir, pattern;
879 882
@@ -897,30 +900,35 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
897#endif 900#endif
898 } 901 }
899 902
900 pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir); 903 {
901 tempfile = (char *) alloca (SBYTES (pattern) + 1); 904 USE_SAFE_ALLOCA;
902 memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1); 905 pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir);
903 coding_systems = Qt; 906 SAFE_ALLOCA (tempfile, char *, SBYTES (pattern) + 1);
907 memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1);
908 coding_systems = Qt;
904 909
905#ifdef HAVE_MKSTEMP 910#ifdef HAVE_MKSTEMP
906 { 911 {
907 int fd; 912 int fd;
908 913
909 BLOCK_INPUT; 914 BLOCK_INPUT;
910 fd = mkstemp (tempfile); 915 fd = mkstemp (tempfile);
911 UNBLOCK_INPUT; 916 UNBLOCK_INPUT;
912 if (fd == -1) 917 if (fd == -1)
913 report_file_error ("Failed to open temporary file", 918 report_file_error ("Failed to open temporary file",
914 Fcons (Vtemp_file_name_pattern, Qnil)); 919 Fcons (Vtemp_file_name_pattern, Qnil));
915 else 920 else
916 close (fd); 921 close (fd);
917 } 922 }
918#else 923#else
919 mktemp (tempfile); 924 mktemp (tempfile);
920#endif 925#endif
921 926
922 filename_string = build_string (tempfile); 927 filename_string = build_string (tempfile);
923 GCPRO1 (filename_string); 928 GCPRO1 (filename_string);
929 SAFE_FREE ();
930 }
931
924 start = args[0]; 932 start = args[0];
925 end = args[1]; 933 end = args[1];
926 /* Decide coding-system of the contents of the temporary file. */ 934 /* Decide coding-system of the contents of the temporary file. */
@@ -930,11 +938,13 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
930 val = Qraw_text; 938 val = Qraw_text;
931 else 939 else
932 { 940 {
933 args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); 941 USE_SAFE_ALLOCA;
942 SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2);
934 args2[0] = Qcall_process_region; 943 args2[0] = Qcall_process_region;
935 for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; 944 for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
936 coding_systems = Ffind_operation_coding_system (nargs + 1, args2); 945 coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
937 val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil; 946 val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil;
947 SAFE_FREE ();
938 } 948 }
939 val = complement_process_encoding_system (val); 949 val = complement_process_encoding_system (val);
940 950
diff --git a/src/character.c b/src/character.c
index 41c692e7483..bac9f6af81e 100644
--- a/src/character.c
+++ b/src/character.c
@@ -890,9 +890,10 @@ DEFUN ("string", Fstring, Sstring, 0, MANY, 0,
890 doc: /* 890 doc: /*
891Concatenate all the argument characters and make the result a string. 891Concatenate all the argument characters and make the result a string.
892usage: (string &rest CHARACTERS) */) 892usage: (string &rest CHARACTERS) */)
893 (int n, Lisp_Object *args) 893 (size_t n, Lisp_Object *args)
894{ 894{
895 int i, c; 895 size_t i;
896 int c;
896 unsigned char *buf, *p; 897 unsigned char *buf, *p;
897 Lisp_Object str; 898 Lisp_Object str;
898 USE_SAFE_ALLOCA; 899 USE_SAFE_ALLOCA;
@@ -915,9 +916,10 @@ usage: (string &rest CHARACTERS) */)
915DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0, 916DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0,
916 doc: /* Concatenate all the argument bytes and make the result a unibyte string. 917 doc: /* Concatenate all the argument bytes and make the result a unibyte string.
917usage: (unibyte-string &rest BYTES) */) 918usage: (unibyte-string &rest BYTES) */)
918 (int n, Lisp_Object *args) 919 (size_t n, Lisp_Object *args)
919{ 920{
920 int i, c; 921 size_t i;
922 int c;
921 unsigned char *buf, *p; 923 unsigned char *buf, *p;
922 Lisp_Object str; 924 Lisp_Object str;
923 USE_SAFE_ALLOCA; 925 USE_SAFE_ALLOCA;
diff --git a/src/charset.c b/src/charset.c
index d82b29ae44b..32836d459f3 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -845,7 +845,7 @@ DEFUN ("define-charset-internal", Fdefine_charset_internal,
845 Sdefine_charset_internal, charset_arg_max, MANY, 0, 845 Sdefine_charset_internal, charset_arg_max, MANY, 0,
846 doc: /* For internal use only. 846 doc: /* For internal use only.
847usage: (define-charset-internal ...) */) 847usage: (define-charset-internal ...) */)
848 (int nargs, Lisp_Object *args) 848 (size_t nargs, Lisp_Object *args)
849{ 849{
850 /* Charset attr vector. */ 850 /* Charset attr vector. */
851 Lisp_Object attrs; 851 Lisp_Object attrs;
@@ -2171,11 +2171,12 @@ DEFUN ("set-charset-priority", Fset_charset_priority, Sset_charset_priority,
2171 1, MANY, 0, 2171 1, MANY, 0,
2172 doc: /* Assign higher priority to the charsets given as arguments. 2172 doc: /* Assign higher priority to the charsets given as arguments.
2173usage: (set-charset-priority &rest charsets) */) 2173usage: (set-charset-priority &rest charsets) */)
2174 (int nargs, Lisp_Object *args) 2174 (size_t nargs, Lisp_Object *args)
2175{ 2175{
2176 Lisp_Object new_head, old_list, arglist[2]; 2176 Lisp_Object new_head, old_list, arglist[2];
2177 Lisp_Object list_2022, list_emacs_mule; 2177 Lisp_Object list_2022, list_emacs_mule;
2178 int i, id; 2178 size_t i;
2179 int id;
2179 2180
2180 old_list = Fcopy_sequence (Vcharset_ordered_list); 2181 old_list = Fcopy_sequence (Vcharset_ordered_list);
2181 new_head = Qnil; 2182 new_head = Qnil;
diff --git a/src/chartab.c b/src/chartab.c
index 85aa5932ac3..9ad182131e9 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -215,7 +215,6 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
215 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 215 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
216 int depth = XINT (tbl->depth); 216 int depth = XINT (tbl->depth);
217 int min_char = XINT (tbl->min_char); 217 int min_char = XINT (tbl->min_char);
218 int max_char = min_char + chartab_chars[depth - 1] - 1;
219 int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx; 218 int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
220 Lisp_Object val; 219 Lisp_Object val;
221 220
@@ -244,8 +243,9 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp
244 break; 243 break;
245 } 244 }
246 } 245 }
247 while ((c = min_char + (chartab_idx + 1) * chartab_chars[depth]) <= max_char 246 while (((c = (chartab_idx + 1) * chartab_chars[depth])
248 && *to >= c) 247 < chartab_chars[depth - 1])
248 && (c += min_char) <= *to)
249 { 249 {
250 Lisp_Object this_val; 250 Lisp_Object this_val;
251 251
diff --git a/src/cm.c b/src/cm.c
index 6379955b48c..42f855f1694 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -214,8 +214,9 @@ calccost (struct tty_display_info *tty,
214 } 214 }
215 totalcost = c * deltay; 215 totalcost = c * deltay;
216 if (doit) 216 if (doit)
217 while (--deltay >= 0) 217 do
218 emacs_tputs (tty, p, 1, cmputc); 218 emacs_tputs (tty, p, 1, cmputc);
219 while (0 < --deltay);
219x: 220x:
220 if ((deltax = dstx - srcx) == 0) 221 if ((deltax = dstx - srcx) == 0)
221 goto done; 222 goto done;
@@ -296,8 +297,9 @@ fail:
296 } 297 }
297 totalcost += c * deltax; 298 totalcost += c * deltax;
298 if (doit) 299 if (doit)
299 while (--deltax >= 0) 300 do
300 emacs_tputs (tty, p, 1, cmputc); 301 emacs_tputs (tty, p, 1, cmputc);
302 while (0 < --deltax);
301done: 303done:
302 return totalcost; 304 return totalcost;
303} 305}
diff --git a/src/coding.c b/src/coding.c
index fd812148a26..9e28a1c9f9b 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -9299,7 +9299,7 @@ function to call for FILENAME, that function should examine the
9299contents of BUFFER instead of reading the file. 9299contents of BUFFER instead of reading the file.
9300 9300
9301usage: (find-operation-coding-system OPERATION ARGUMENTS...) */) 9301usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
9302 (int nargs, Lisp_Object *args) 9302 (size_t nargs, Lisp_Object *args)
9303{ 9303{
9304 Lisp_Object operation, target_idx, target, val; 9304 Lisp_Object operation, target_idx, target, val;
9305 register Lisp_Object chain; 9305 register Lisp_Object chain;
@@ -9308,17 +9308,17 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
9308 error ("Too few arguments"); 9308 error ("Too few arguments");
9309 operation = args[0]; 9309 operation = args[0];
9310 if (!SYMBOLP (operation) 9310 if (!SYMBOLP (operation)
9311 || !INTEGERP (target_idx = Fget (operation, Qtarget_idx))) 9311 || !NATNUMP (target_idx = Fget (operation, Qtarget_idx)))
9312 error ("Invalid first argument"); 9312 error ("Invalid first argument");
9313 if (nargs < 1 + XINT (target_idx)) 9313 if (nargs < 1 + XFASTINT (target_idx))
9314 error ("Too few arguments for operation: %s", 9314 error ("Too few arguments for operation: %s",
9315 SDATA (SYMBOL_NAME (operation))); 9315 SDATA (SYMBOL_NAME (operation)));
9316 target = args[XINT (target_idx) + 1]; 9316 target = args[XFASTINT (target_idx) + 1];
9317 if (!(STRINGP (target) 9317 if (!(STRINGP (target)
9318 || (EQ (operation, Qinsert_file_contents) && CONSP (target) 9318 || (EQ (operation, Qinsert_file_contents) && CONSP (target)
9319 && STRINGP (XCAR (target)) && BUFFERP (XCDR (target))) 9319 && STRINGP (XCAR (target)) && BUFFERP (XCDR (target)))
9320 || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) 9320 || (EQ (operation, Qopen_network_stream) && INTEGERP (target))))
9321 error ("Invalid %dth argument", XINT (target_idx) + 1); 9321 error ("Invalid %dth argument", XFASTINT (target_idx) + 1);
9322 if (CONSP (target)) 9322 if (CONSP (target))
9323 target = XCAR (target); 9323 target = XCAR (target);
9324 9324
@@ -9375,9 +9375,9 @@ If multiple coding systems belong to the same category,
9375all but the first one are ignored. 9375all but the first one are ignored.
9376 9376
9377usage: (set-coding-system-priority &rest coding-systems) */) 9377usage: (set-coding-system-priority &rest coding-systems) */)
9378 (int nargs, Lisp_Object *args) 9378 (size_t nargs, Lisp_Object *args)
9379{ 9379{
9380 int i, j; 9380 size_t i, j;
9381 int changed[coding_category_max]; 9381 int changed[coding_category_max];
9382 enum coding_category priorities[coding_category_max]; 9382 enum coding_category priorities[coding_category_max];
9383 9383
@@ -9420,7 +9420,7 @@ usage: (set-coding-system-priority &rest coding-systems) */)
9420 9420
9421 /* Update `coding-category-list'. */ 9421 /* Update `coding-category-list'. */
9422 Vcoding_category_list = Qnil; 9422 Vcoding_category_list = Qnil;
9423 for (i = coding_category_max - 1; i >= 0; i--) 9423 for (i = coding_category_max; i-- > 0; )
9424 Vcoding_category_list 9424 Vcoding_category_list
9425 = Fcons (AREF (Vcoding_category_table, priorities[i]), 9425 = Fcons (AREF (Vcoding_category_table, priorities[i]),
9426 Vcoding_category_list); 9426 Vcoding_category_list);
@@ -9481,7 +9481,7 @@ DEFUN ("define-coding-system-internal", Fdefine_coding_system_internal,
9481 Sdefine_coding_system_internal, coding_arg_max, MANY, 0, 9481 Sdefine_coding_system_internal, coding_arg_max, MANY, 0,
9482 doc: /* For internal use only. 9482 doc: /* For internal use only.
9483usage: (define-coding-system-internal ...) */) 9483usage: (define-coding-system-internal ...) */)
9484 (int nargs, Lisp_Object *args) 9484 (size_t nargs, Lisp_Object *args)
9485{ 9485{
9486 Lisp_Object name; 9486 Lisp_Object name;
9487 Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */ 9487 Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */
diff --git a/src/data.c b/src/data.c
index 36a64d888de..ba7ae58d7b2 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2474,13 +2474,13 @@ enum arithop
2474 Amin 2474 Amin
2475 }; 2475 };
2476 2476
2477static Lisp_Object float_arith_driver (double, int, enum arithop, 2477static Lisp_Object float_arith_driver (double, size_t, enum arithop,
2478 int, Lisp_Object *); 2478 size_t, Lisp_Object *);
2479static Lisp_Object 2479static Lisp_Object
2480arith_driver (enum arithop code, int nargs, register Lisp_Object *args) 2480arith_driver (enum arithop code, size_t nargs, register Lisp_Object *args)
2481{ 2481{
2482 register Lisp_Object val; 2482 register Lisp_Object val;
2483 register int argnum; 2483 register size_t argnum;
2484 register EMACS_INT accum = 0; 2484 register EMACS_INT accum = 0;
2485 register EMACS_INT next; 2485 register EMACS_INT next;
2486 2486
@@ -2562,7 +2562,8 @@ arith_driver (enum arithop code, int nargs, register Lisp_Object *args)
2562#define isnan(x) ((x) != (x)) 2562#define isnan(x) ((x) != (x))
2563 2563
2564static Lisp_Object 2564static Lisp_Object
2565float_arith_driver (double accum, register int argnum, enum arithop code, int nargs, register Lisp_Object *args) 2565float_arith_driver (double accum, register size_t argnum, enum arithop code,
2566 size_t nargs, register Lisp_Object *args)
2566{ 2567{
2567 register Lisp_Object val; 2568 register Lisp_Object val;
2568 double next; 2569 double next;
@@ -2624,7 +2625,7 @@ float_arith_driver (double accum, register int argnum, enum arithop code, int na
2624DEFUN ("+", Fplus, Splus, 0, MANY, 0, 2625DEFUN ("+", Fplus, Splus, 0, MANY, 0,
2625 doc: /* Return sum of any number of arguments, which are numbers or markers. 2626 doc: /* Return sum of any number of arguments, which are numbers or markers.
2626usage: (+ &rest NUMBERS-OR-MARKERS) */) 2627usage: (+ &rest NUMBERS-OR-MARKERS) */)
2627 (int nargs, Lisp_Object *args) 2628 (size_t nargs, Lisp_Object *args)
2628{ 2629{
2629 return arith_driver (Aadd, nargs, args); 2630 return arith_driver (Aadd, nargs, args);
2630} 2631}
@@ -2634,7 +2635,7 @@ DEFUN ("-", Fminus, Sminus, 0, MANY, 0,
2634With one arg, negates it. With more than one arg, 2635With one arg, negates it. With more than one arg,
2635subtracts all but the first from the first. 2636subtracts all but the first from the first.
2636usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */) 2637usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */)
2637 (int nargs, Lisp_Object *args) 2638 (size_t nargs, Lisp_Object *args)
2638{ 2639{
2639 return arith_driver (Asub, nargs, args); 2640 return arith_driver (Asub, nargs, args);
2640} 2641}
@@ -2642,7 +2643,7 @@ usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */)
2642DEFUN ("*", Ftimes, Stimes, 0, MANY, 0, 2643DEFUN ("*", Ftimes, Stimes, 0, MANY, 0,
2643 doc: /* Return product of any number of arguments, which are numbers or markers. 2644 doc: /* Return product of any number of arguments, which are numbers or markers.
2644usage: (* &rest NUMBERS-OR-MARKERS) */) 2645usage: (* &rest NUMBERS-OR-MARKERS) */)
2645 (int nargs, Lisp_Object *args) 2646 (size_t nargs, Lisp_Object *args)
2646{ 2647{
2647 return arith_driver (Amult, nargs, args); 2648 return arith_driver (Amult, nargs, args);
2648} 2649}
@@ -2651,9 +2652,9 @@ DEFUN ("/", Fquo, Squo, 2, MANY, 0,
2651 doc: /* Return first argument divided by all the remaining arguments. 2652 doc: /* Return first argument divided by all the remaining arguments.
2652The arguments must be numbers or markers. 2653The arguments must be numbers or markers.
2653usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */) 2654usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */)
2654 (int nargs, Lisp_Object *args) 2655 (size_t nargs, Lisp_Object *args)
2655{ 2656{
2656 int argnum; 2657 size_t argnum;
2657 for (argnum = 2; argnum < nargs; argnum++) 2658 for (argnum = 2; argnum < nargs; argnum++)
2658 if (FLOATP (args[argnum])) 2659 if (FLOATP (args[argnum]))
2659 return float_arith_driver (0, 0, Adiv, nargs, args); 2660 return float_arith_driver (0, 0, Adiv, nargs, args);
@@ -2735,7 +2736,7 @@ DEFUN ("max", Fmax, Smax, 1, MANY, 0,
2735 doc: /* Return largest of all the arguments (which must be numbers or markers). 2736 doc: /* Return largest of all the arguments (which must be numbers or markers).
2736The value is always a number; markers are converted to numbers. 2737The value is always a number; markers are converted to numbers.
2737usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) 2738usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2738 (int nargs, Lisp_Object *args) 2739 (size_t nargs, Lisp_Object *args)
2739{ 2740{
2740 return arith_driver (Amax, nargs, args); 2741 return arith_driver (Amax, nargs, args);
2741} 2742}
@@ -2744,7 +2745,7 @@ DEFUN ("min", Fmin, Smin, 1, MANY, 0,
2744 doc: /* Return smallest of all the arguments (which must be numbers or markers). 2745 doc: /* Return smallest of all the arguments (which must be numbers or markers).
2745The value is always a number; markers are converted to numbers. 2746The value is always a number; markers are converted to numbers.
2746usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) 2747usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2747 (int nargs, Lisp_Object *args) 2748 (size_t nargs, Lisp_Object *args)
2748{ 2749{
2749 return arith_driver (Amin, nargs, args); 2750 return arith_driver (Amin, nargs, args);
2750} 2751}
@@ -2753,7 +2754,7 @@ DEFUN ("logand", Flogand, Slogand, 0, MANY, 0,
2753 doc: /* Return bitwise-and of all the arguments. 2754 doc: /* Return bitwise-and of all the arguments.
2754Arguments may be integers, or markers converted to integers. 2755Arguments may be integers, or markers converted to integers.
2755usage: (logand &rest INTS-OR-MARKERS) */) 2756usage: (logand &rest INTS-OR-MARKERS) */)
2756 (int nargs, Lisp_Object *args) 2757 (size_t nargs, Lisp_Object *args)
2757{ 2758{
2758 return arith_driver (Alogand, nargs, args); 2759 return arith_driver (Alogand, nargs, args);
2759} 2760}
@@ -2762,7 +2763,7 @@ DEFUN ("logior", Flogior, Slogior, 0, MANY, 0,
2762 doc: /* Return bitwise-or of all the arguments. 2763 doc: /* Return bitwise-or of all the arguments.
2763Arguments may be integers, or markers converted to integers. 2764Arguments may be integers, or markers converted to integers.
2764usage: (logior &rest INTS-OR-MARKERS) */) 2765usage: (logior &rest INTS-OR-MARKERS) */)
2765 (int nargs, Lisp_Object *args) 2766 (size_t nargs, Lisp_Object *args)
2766{ 2767{
2767 return arith_driver (Alogior, nargs, args); 2768 return arith_driver (Alogior, nargs, args);
2768} 2769}
@@ -2771,7 +2772,7 @@ DEFUN ("logxor", Flogxor, Slogxor, 0, MANY, 0,
2771 doc: /* Return bitwise-exclusive-or of all the arguments. 2772 doc: /* Return bitwise-exclusive-or of all the arguments.
2772Arguments may be integers, or markers converted to integers. 2773Arguments may be integers, or markers converted to integers.
2773usage: (logxor &rest INTS-OR-MARKERS) */) 2774usage: (logxor &rest INTS-OR-MARKERS) */)
2774 (int nargs, Lisp_Object *args) 2775 (size_t nargs, Lisp_Object *args)
2775{ 2776{
2776 return arith_driver (Alogxor, nargs, args); 2777 return arith_driver (Alogxor, nargs, args);
2777} 2778}
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 2c8de20a4d4..8a6870555d0 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1051,7 +1051,7 @@ object is returned instead of a list containing this single Lisp object.
1051 => "i686" 1051 => "i686"
1052 1052
1053usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TIMEOUT &rest ARGS) */) 1053usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TIMEOUT &rest ARGS) */)
1054 (int nargs, register Lisp_Object *args) 1054 (size_t nargs, register Lisp_Object *args)
1055{ 1055{
1056 Lisp_Object bus, service, path, interface, method; 1056 Lisp_Object bus, service, path, interface, method;
1057 Lisp_Object result; 1057 Lisp_Object result;
@@ -1063,7 +1063,7 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
1063 DBusError derror; 1063 DBusError derror;
1064 unsigned int dtype; 1064 unsigned int dtype;
1065 int timeout = -1; 1065 int timeout = -1;
1066 int i = 5; 1066 size_t i = 5;
1067 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; 1067 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
1068 1068
1069 /* Check parameters. */ 1069 /* Check parameters. */
@@ -1116,7 +1116,7 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
1116 { 1116 {
1117 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1117 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1118 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); 1118 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]);
1119 XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, 1119 XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-4),
1120 SDATA (format2 ("%s", args[i], Qnil)), 1120 SDATA (format2 ("%s", args[i], Qnil)),
1121 SDATA (format2 ("%s", args[i+1], Qnil))); 1121 SDATA (format2 ("%s", args[i+1], Qnil)));
1122 ++i; 1122 ++i;
@@ -1124,7 +1124,7 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
1124 else 1124 else
1125 { 1125 {
1126 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1126 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1127 XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, 1127 XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-4),
1128 SDATA (format2 ("%s", args[i], Qnil))); 1128 SDATA (format2 ("%s", args[i], Qnil)));
1129 } 1129 }
1130 1130
@@ -1233,7 +1233,7 @@ Example:
1233 -| i686 1233 -| i686
1234 1234
1235usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLER &optional :timeout TIMEOUT &rest ARGS) */) 1235usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLER &optional :timeout TIMEOUT &rest ARGS) */)
1236 (int nargs, register Lisp_Object *args) 1236 (size_t nargs, register Lisp_Object *args)
1237{ 1237{
1238 Lisp_Object bus, service, path, interface, method, handler; 1238 Lisp_Object bus, service, path, interface, method, handler;
1239 Lisp_Object result; 1239 Lisp_Object result;
@@ -1243,7 +1243,7 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
1243 DBusMessageIter iter; 1243 DBusMessageIter iter;
1244 unsigned int dtype; 1244 unsigned int dtype;
1245 int timeout = -1; 1245 int timeout = -1;
1246 int i = 6; 1246 size_t i = 6;
1247 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; 1247 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
1248 1248
1249 /* Check parameters. */ 1249 /* Check parameters. */
@@ -1298,7 +1298,7 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
1298 { 1298 {
1299 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1299 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1300 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); 1300 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]);
1301 XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, 1301 XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-4),
1302 SDATA (format2 ("%s", args[i], Qnil)), 1302 SDATA (format2 ("%s", args[i], Qnil)),
1303 SDATA (format2 ("%s", args[i+1], Qnil))); 1303 SDATA (format2 ("%s", args[i+1], Qnil)));
1304 ++i; 1304 ++i;
@@ -1306,7 +1306,7 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
1306 else 1306 else
1307 { 1307 {
1308 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1308 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1309 XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, 1309 XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i - 4),
1310 SDATA (format2 ("%s", args[i], Qnil))); 1310 SDATA (format2 ("%s", args[i], Qnil)));
1311 } 1311 }
1312 1312
@@ -1357,7 +1357,7 @@ DEFUN ("dbus-method-return-internal", Fdbus_method_return_internal,
1357This is an internal function, it shall not be used outside dbus.el. 1357This is an internal function, it shall not be used outside dbus.el.
1358 1358
1359usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */) 1359usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
1360 (int nargs, register Lisp_Object *args) 1360 (size_t nargs, register Lisp_Object *args)
1361{ 1361{
1362 Lisp_Object bus, serial, service; 1362 Lisp_Object bus, serial, service;
1363 struct gcpro gcpro1, gcpro2, gcpro3; 1363 struct gcpro gcpro1, gcpro2, gcpro3;
@@ -1365,7 +1365,7 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
1365 DBusMessage *dmessage; 1365 DBusMessage *dmessage;
1366 DBusMessageIter iter; 1366 DBusMessageIter iter;
1367 unsigned int dtype; 1367 unsigned int dtype;
1368 int i; 1368 size_t i;
1369 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; 1369 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
1370 1370
1371 /* Check parameters. */ 1371 /* Check parameters. */
@@ -1405,7 +1405,7 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
1405 { 1405 {
1406 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1406 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1407 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); 1407 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]);
1408 XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-2, 1408 XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-2),
1409 SDATA (format2 ("%s", args[i], Qnil)), 1409 SDATA (format2 ("%s", args[i], Qnil)),
1410 SDATA (format2 ("%s", args[i+1], Qnil))); 1410 SDATA (format2 ("%s", args[i+1], Qnil)));
1411 ++i; 1411 ++i;
@@ -1413,7 +1413,7 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
1413 else 1413 else
1414 { 1414 {
1415 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1415 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1416 XD_DEBUG_MESSAGE ("Parameter%d %s", i-2, 1416 XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-2),
1417 SDATA (format2 ("%s", args[i], Qnil))); 1417 SDATA (format2 ("%s", args[i], Qnil)));
1418 } 1418 }
1419 1419
@@ -1445,7 +1445,7 @@ DEFUN ("dbus-method-error-internal", Fdbus_method_error_internal,
1445This is an internal function, it shall not be used outside dbus.el. 1445This is an internal function, it shall not be used outside dbus.el.
1446 1446
1447usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */) 1447usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1448 (int nargs, register Lisp_Object *args) 1448 (size_t nargs, register Lisp_Object *args)
1449{ 1449{
1450 Lisp_Object bus, serial, service; 1450 Lisp_Object bus, serial, service;
1451 struct gcpro gcpro1, gcpro2, gcpro3; 1451 struct gcpro gcpro1, gcpro2, gcpro3;
@@ -1453,7 +1453,7 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1453 DBusMessage *dmessage; 1453 DBusMessage *dmessage;
1454 DBusMessageIter iter; 1454 DBusMessageIter iter;
1455 unsigned int dtype; 1455 unsigned int dtype;
1456 int i; 1456 size_t i;
1457 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; 1457 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
1458 1458
1459 /* Check parameters. */ 1459 /* Check parameters. */
@@ -1494,7 +1494,7 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1494 { 1494 {
1495 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1495 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1496 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); 1496 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]);
1497 XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-2, 1497 XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-2),
1498 SDATA (format2 ("%s", args[i], Qnil)), 1498 SDATA (format2 ("%s", args[i], Qnil)),
1499 SDATA (format2 ("%s", args[i+1], Qnil))); 1499 SDATA (format2 ("%s", args[i+1], Qnil)));
1500 ++i; 1500 ++i;
@@ -1502,7 +1502,7 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1502 else 1502 else
1503 { 1503 {
1504 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1504 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1505 XD_DEBUG_MESSAGE ("Parameter%d %s", i-2, 1505 XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-2),
1506 SDATA (format2 ("%s", args[i], Qnil))); 1506 SDATA (format2 ("%s", args[i], Qnil)));
1507 } 1507 }
1508 1508
@@ -1557,7 +1557,7 @@ Example:
1557 "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs") 1557 "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs")
1558 1558
1559usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */) 1559usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1560 (int nargs, register Lisp_Object *args) 1560 (size_t nargs, register Lisp_Object *args)
1561{ 1561{
1562 Lisp_Object bus, service, path, interface, signal; 1562 Lisp_Object bus, service, path, interface, signal;
1563 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 1563 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
@@ -1565,7 +1565,7 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1565 DBusMessage *dmessage; 1565 DBusMessage *dmessage;
1566 DBusMessageIter iter; 1566 DBusMessageIter iter;
1567 unsigned int dtype; 1567 unsigned int dtype;
1568 int i; 1568 size_t i;
1569 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH]; 1569 char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
1570 1570
1571 /* Check parameters. */ 1571 /* Check parameters. */
@@ -1609,7 +1609,7 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1609 { 1609 {
1610 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1610 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1611 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); 1611 XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]);
1612 XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, 1612 XD_DEBUG_MESSAGE ("Parameter%lu %s %s", (unsigned long) (i-4),
1613 SDATA (format2 ("%s", args[i], Qnil)), 1613 SDATA (format2 ("%s", args[i], Qnil)),
1614 SDATA (format2 ("%s", args[i+1], Qnil))); 1614 SDATA (format2 ("%s", args[i+1], Qnil)));
1615 ++i; 1615 ++i;
@@ -1617,7 +1617,7 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1617 else 1617 else
1618 { 1618 {
1619 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); 1619 XD_DEBUG_VALID_LISP_OBJECT_P (args[i]);
1620 XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, 1620 XD_DEBUG_MESSAGE ("Parameter%lu %s", (unsigned long) (i-4),
1621 SDATA (format2 ("%s", args[i], Qnil))); 1621 SDATA (format2 ("%s", args[i], Qnil)));
1622 } 1622 }
1623 1623
@@ -1885,11 +1885,11 @@ Example:
1885 => :already-owner. 1885 => :already-owner.
1886 1886
1887usage: (dbus-register-service BUS SERVICE &rest FLAGS) */) 1887usage: (dbus-register-service BUS SERVICE &rest FLAGS) */)
1888 (int nargs, register Lisp_Object *args) 1888 (size_t nargs, register Lisp_Object *args)
1889{ 1889{
1890 Lisp_Object bus, service; 1890 Lisp_Object bus, service;
1891 DBusConnection *connection; 1891 DBusConnection *connection;
1892 unsigned int i; 1892 size_t i;
1893 unsigned int value; 1893 unsigned int value;
1894 unsigned int flags = 0; 1894 unsigned int flags = 0;
1895 int result; 1895 int result;
@@ -1985,13 +1985,13 @@ INTERFACE, SIGNAL and HANDLER must not be nil. Example:
1985`dbus-unregister-object' for removing the registration. 1985`dbus-unregister-object' for removing the registration.
1986 1986
1987usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARGS) */) 1987usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARGS) */)
1988 (int nargs, register Lisp_Object *args) 1988 (size_t nargs, register Lisp_Object *args)
1989{ 1989{
1990 Lisp_Object bus, service, path, interface, signal, handler; 1990 Lisp_Object bus, service, path, interface, signal, handler;
1991 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; 1991 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
1992 Lisp_Object uname, key, key1, value; 1992 Lisp_Object uname, key, key1, value;
1993 DBusConnection *connection; 1993 DBusConnection *connection;
1994 int i; 1994 size_t i;
1995 char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH]; 1995 char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH];
1996 char x[DBUS_MAXIMUM_MATCH_RULE_LENGTH]; 1996 char x[DBUS_MAXIMUM_MATCH_RULE_LENGTH];
1997 DBusError derror; 1997 DBusError derror;
@@ -2061,7 +2061,8 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
2061 if (!NILP (args[i])) 2061 if (!NILP (args[i]))
2062 { 2062 {
2063 CHECK_STRING (args[i]); 2063 CHECK_STRING (args[i]);
2064 sprintf (x, ",arg%d='%s'", i-6, SDATA (args[i])); 2064 sprintf (x, ",arg%lu='%s'", (unsigned long) (i-6),
2065 SDATA (args[i]));
2065 strcat (rule, x); 2066 strcat (rule, x);
2066 } 2067 }
2067 2068
diff --git a/src/dispnew.c b/src/dispnew.c
index a15b5f45e60..3a78845fa56 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3590,7 +3590,10 @@ update_window (struct window *w, int force_p)
3590 struct glyph_row *row, *end; 3590 struct glyph_row *row, *end;
3591 struct glyph_row *mode_line_row; 3591 struct glyph_row *mode_line_row;
3592 struct glyph_row *header_line_row; 3592 struct glyph_row *header_line_row;
3593 int yb, changed_p = 0, mouse_face_overwritten_p = 0, n_updated; 3593 int yb, changed_p = 0, mouse_face_overwritten_p = 0;
3594#if ! PERIODIC_PREEMPTION_CHECKING
3595 int n_updated = 0;
3596#endif
3594 3597
3595 rif->update_window_begin_hook (w); 3598 rif->update_window_begin_hook (w);
3596 yb = window_text_bottom_y (w); 3599 yb = window_text_bottom_y (w);
@@ -3643,7 +3646,7 @@ update_window (struct window *w, int force_p)
3643 } 3646 }
3644 3647
3645 /* Update the rest of the lines. */ 3648 /* Update the rest of the lines. */
3646 for (n_updated = 0; row < end && (force_p || !input_pending); ++row) 3649 for (; row < end && (force_p || !input_pending); ++row)
3647 if (row->enabled_p) 3650 if (row->enabled_p)
3648 { 3651 {
3649 int vpos = MATRIX_ROW_VPOS (row, desired_matrix); 3652 int vpos = MATRIX_ROW_VPOS (row, desired_matrix);
diff --git a/src/editfns.c b/src/editfns.c
index b04414e1ae6..d0f1df694d5 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -101,7 +101,7 @@ static void general_insert_function (void (*) (const char *, EMACS_INT),
101 void (*) (Lisp_Object, EMACS_INT, 101 void (*) (Lisp_Object, EMACS_INT,
102 EMACS_INT, EMACS_INT, 102 EMACS_INT, EMACS_INT,
103 EMACS_INT, int), 103 EMACS_INT, int),
104 int, int, Lisp_Object *); 104 int, size_t, Lisp_Object *);
105static Lisp_Object subst_char_in_region_unwind (Lisp_Object); 105static Lisp_Object subst_char_in_region_unwind (Lisp_Object);
106static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object); 106static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object);
107static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, 107static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
@@ -1871,7 +1871,7 @@ Years before 1970 are not guaranteed to work. On some systems,
1871year values as low as 1901 do work. 1871year values as low as 1901 do work.
1872 1872
1873usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) 1873usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1874 (int nargs, register Lisp_Object *args) 1874 (size_t nargs, register Lisp_Object *args)
1875{ 1875{
1876 time_t value; 1876 time_t value;
1877 struct tm tm; 1877 struct tm tm;
@@ -2207,9 +2207,9 @@ general_insert_function (void (*insert_func)
2207 void (*insert_from_string_func) 2207 void (*insert_from_string_func)
2208 (Lisp_Object, EMACS_INT, EMACS_INT, 2208 (Lisp_Object, EMACS_INT, EMACS_INT,
2209 EMACS_INT, EMACS_INT, int), 2209 EMACS_INT, EMACS_INT, int),
2210 int inherit, int nargs, Lisp_Object *args) 2210 int inherit, size_t nargs, Lisp_Object *args)
2211{ 2211{
2212 register int argnum; 2212 register size_t argnum;
2213 register Lisp_Object val; 2213 register Lisp_Object val;
2214 2214
2215 for (argnum = 0; argnum < nargs; argnum++) 2215 for (argnum = 0; argnum < nargs; argnum++)
@@ -2272,7 +2272,7 @@ buffer; to accomplish this, apply `string-as-multibyte' to the string
2272and insert the result. 2272and insert the result.
2273 2273
2274usage: (insert &rest ARGS) */) 2274usage: (insert &rest ARGS) */)
2275 (int nargs, register Lisp_Object *args) 2275 (size_t nargs, register Lisp_Object *args)
2276{ 2276{
2277 general_insert_function (insert, insert_from_string, 0, nargs, args); 2277 general_insert_function (insert, insert_from_string, 0, nargs, args);
2278 return Qnil; 2278 return Qnil;
@@ -2291,7 +2291,7 @@ If the current buffer is unibyte, multibyte strings are converted
2291to unibyte for insertion. 2291to unibyte for insertion.
2292 2292
2293usage: (insert-and-inherit &rest ARGS) */) 2293usage: (insert-and-inherit &rest ARGS) */)
2294 (int nargs, register Lisp_Object *args) 2294 (size_t nargs, register Lisp_Object *args)
2295{ 2295{
2296 general_insert_function (insert_and_inherit, insert_from_string, 1, 2296 general_insert_function (insert_and_inherit, insert_from_string, 1,
2297 nargs, args); 2297 nargs, args);
@@ -2308,7 +2308,7 @@ If the current buffer is unibyte, multibyte strings are converted
2308to unibyte for insertion. 2308to unibyte for insertion.
2309 2309
2310usage: (insert-before-markers &rest ARGS) */) 2310usage: (insert-before-markers &rest ARGS) */)
2311 (int nargs, register Lisp_Object *args) 2311 (size_t nargs, register Lisp_Object *args)
2312{ 2312{
2313 general_insert_function (insert_before_markers, 2313 general_insert_function (insert_before_markers,
2314 insert_from_string_before_markers, 0, 2314 insert_from_string_before_markers, 0,
@@ -2327,7 +2327,7 @@ If the current buffer is unibyte, multibyte strings are converted
2327to unibyte for insertion. 2327to unibyte for insertion.
2328 2328
2329usage: (insert-before-markers-and-inherit &rest ARGS) */) 2329usage: (insert-before-markers-and-inherit &rest ARGS) */)
2330 (int nargs, register Lisp_Object *args) 2330 (size_t nargs, register Lisp_Object *args)
2331{ 2331{
2332 general_insert_function (insert_before_markers_and_inherit, 2332 general_insert_function (insert_before_markers_and_inherit,
2333 insert_from_string_before_markers, 1, 2333 insert_from_string_before_markers, 1,
@@ -3399,7 +3399,7 @@ any existing message; this lets the minibuffer contents show. See
3399also `current-message'. 3399also `current-message'.
3400 3400
3401usage: (message FORMAT-STRING &rest ARGS) */) 3401usage: (message FORMAT-STRING &rest ARGS) */)
3402 (int nargs, Lisp_Object *args) 3402 (size_t nargs, Lisp_Object *args)
3403{ 3403{
3404 if (NILP (args[0]) 3404 if (NILP (args[0])
3405 || (STRINGP (args[0]) 3405 || (STRINGP (args[0])
@@ -3427,7 +3427,7 @@ If the first argument is nil or the empty string, clear any existing
3427message; let the minibuffer contents show. 3427message; let the minibuffer contents show.
3428 3428
3429usage: (message-box FORMAT-STRING &rest ARGS) */) 3429usage: (message-box FORMAT-STRING &rest ARGS) */)
3430 (int nargs, Lisp_Object *args) 3430 (size_t nargs, Lisp_Object *args)
3431{ 3431{
3432 if (NILP (args[0])) 3432 if (NILP (args[0]))
3433 { 3433 {
@@ -3444,12 +3444,12 @@ usage: (message-box FORMAT-STRING &rest ARGS) */)
3444 if (FRAME_WINDOW_P (XFRAME (selected_frame)) 3444 if (FRAME_WINDOW_P (XFRAME (selected_frame))
3445 || FRAME_MSDOS_P (XFRAME (selected_frame))) 3445 || FRAME_MSDOS_P (XFRAME (selected_frame)))
3446 { 3446 {
3447 Lisp_Object pane, menu, obj; 3447 Lisp_Object pane, menu;
3448 struct gcpro gcpro1; 3448 struct gcpro gcpro1;
3449 pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); 3449 pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil);
3450 GCPRO1 (pane); 3450 GCPRO1 (pane);
3451 menu = Fcons (val, pane); 3451 menu = Fcons (val, pane);
3452 obj = Fx_popup_dialog (Qt, menu, Qt); 3452 Fx_popup_dialog (Qt, menu, Qt);
3453 UNGCPRO; 3453 UNGCPRO;
3454 return val; 3454 return val;
3455 } 3455 }
@@ -3484,7 +3484,7 @@ If the first argument is nil or the empty string, clear any existing
3484message; let the minibuffer contents show. 3484message; let the minibuffer contents show.
3485 3485
3486usage: (message-or-box FORMAT-STRING &rest ARGS) */) 3486usage: (message-or-box FORMAT-STRING &rest ARGS) */)
3487 (int nargs, Lisp_Object *args) 3487 (size_t nargs, Lisp_Object *args)
3488{ 3488{
3489#ifdef HAVE_MENUS 3489#ifdef HAVE_MENUS
3490 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) 3490 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
@@ -3508,14 +3508,14 @@ First argument is the string to copy.
3508Remaining arguments form a sequence of PROPERTY VALUE pairs for text 3508Remaining arguments form a sequence of PROPERTY VALUE pairs for text
3509properties to add to the result. 3509properties to add to the result.
3510usage: (propertize STRING &rest PROPERTIES) */) 3510usage: (propertize STRING &rest PROPERTIES) */)
3511 (int nargs, Lisp_Object *args) 3511 (size_t nargs, Lisp_Object *args)
3512{ 3512{
3513 Lisp_Object properties, string; 3513 Lisp_Object properties, string;
3514 struct gcpro gcpro1, gcpro2; 3514 struct gcpro gcpro1, gcpro2;
3515 int i; 3515 size_t i;
3516 3516
3517 /* Number of args must be odd. */ 3517 /* Number of args must be odd. */
3518 if ((nargs & 1) == 0 || nargs < 1) 3518 if ((nargs & 1) == 0)
3519 error ("Wrong number of arguments"); 3519 error ("Wrong number of arguments");
3520 3520
3521 properties = string = Qnil; 3521 properties = string = Qnil;
@@ -3590,10 +3590,10 @@ decimal point itself is omitted. For %s and %S, the precision
3590specifier truncates the string to the given width. 3590specifier truncates the string to the given width.
3591 3591
3592usage: (format STRING &rest OBJECTS) */) 3592usage: (format STRING &rest OBJECTS) */)
3593 (int nargs, register Lisp_Object *args) 3593 (size_t nargs, register Lisp_Object *args)
3594{ 3594{
3595 register int n; /* The number of the next arg to substitute */ 3595 register size_t n; /* The number of the next arg to substitute */
3596 register EMACS_INT total; /* An estimate of the final length */ 3596 register size_t total; /* An estimate of the final length */
3597 char *buf, *p; 3597 char *buf, *p;
3598 register char *format, *end, *format_start; 3598 register char *format, *end, *format_start;
3599 int nchars; 3599 int nchars;
@@ -3669,8 +3669,8 @@ usage: (format STRING &rest OBJECTS) */)
3669 3669
3670 /* Allocate the info and discarded tables. */ 3670 /* Allocate the info and discarded tables. */
3671 { 3671 {
3672 int nbytes = (nargs+1) * sizeof *info; 3672 size_t nbytes = (nargs+1) * sizeof *info;
3673 int i; 3673 size_t i;
3674 if (!info) 3674 if (!info)
3675 info = (struct info *) alloca (nbytes); 3675 info = (struct info *) alloca (nbytes);
3676 memset (info, 0, nbytes); 3676 memset (info, 0, nbytes);
diff --git a/src/eval.c b/src/eval.c
index 75874367f2c..26aea3df5df 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -38,9 +38,9 @@ struct backtrace
38 struct backtrace *next; 38 struct backtrace *next;
39 Lisp_Object *function; 39 Lisp_Object *function;
40 Lisp_Object *args; /* Points to vector of args. */ 40 Lisp_Object *args; /* Points to vector of args. */
41 int nargs; /* Length of vector. 41 size_t nargs; /* Length of vector.
42 If nargs is UNEVALLED, args points to slot holding 42 If nargs is (size_t) UNEVALLED, args points
43 list of unevalled args. */ 43 to slot holding list of unevalled args. */
44 char evalargs; 44 char evalargs;
45 /* Nonzero means call value of debugger when done with this operation. */ 45 /* Nonzero means call value of debugger when done with this operation. */
46 char debug_on_exit; 46 char debug_on_exit;
@@ -111,7 +111,7 @@ Lisp_Object Vsignaling_function;
111 111
112int handling_signal; 112int handling_signal;
113 113
114static Lisp_Object funcall_lambda (Lisp_Object, int, Lisp_Object*); 114static Lisp_Object funcall_lambda (Lisp_Object, size_t, Lisp_Object*);
115static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN; 115static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN;
116static int interactive_p (int); 116static int interactive_p (int);
117static Lisp_Object apply_lambda (Lisp_Object, Lisp_Object, int); 117static Lisp_Object apply_lambda (Lisp_Object, Lisp_Object, int);
@@ -553,7 +553,7 @@ interactive_p (int exclude_subrs_p)
553 looking at several frames for special forms. Skip past them. */ 553 looking at several frames for special forms. Skip past them. */
554 while (btp 554 while (btp
555 && (EQ (*btp->function, Qbytecode) 555 && (EQ (*btp->function, Qbytecode)
556 || btp->nargs == UNEVALLED)) 556 || btp->nargs == (size_t) UNEVALLED))
557 btp = btp->next; 557 btp = btp->next;
558 558
559 /* `btp' now points at the frame of the innermost function that isn't 559 /* `btp' now points at the frame of the innermost function that isn't
@@ -959,7 +959,7 @@ usage: (let VARLIST BODY...) */)
959 Lisp_Object *temps, tem; 959 Lisp_Object *temps, tem;
960 register Lisp_Object elt, varlist; 960 register Lisp_Object elt, varlist;
961 int count = SPECPDL_INDEX (); 961 int count = SPECPDL_INDEX ();
962 register int argnum; 962 register size_t argnum;
963 struct gcpro gcpro1, gcpro2; 963 struct gcpro gcpro1, gcpro2;
964 USE_SAFE_ALLOCA; 964 USE_SAFE_ALLOCA;
965 965
@@ -1508,8 +1508,8 @@ internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object),
1508 and ARGS as second argument. */ 1508 and ARGS as second argument. */
1509 1509
1510Lisp_Object 1510Lisp_Object
1511internal_condition_case_n (Lisp_Object (*bfun) (int, Lisp_Object*), 1511internal_condition_case_n (Lisp_Object (*bfun) (size_t, Lisp_Object *),
1512 int nargs, 1512 size_t nargs,
1513 Lisp_Object *args, 1513 Lisp_Object *args,
1514 Lisp_Object handlers, 1514 Lisp_Object handlers,
1515 Lisp_Object (*hfun) (Lisp_Object)) 1515 Lisp_Object (*hfun) (Lisp_Object))
@@ -2201,7 +2201,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
2201 { 2201 {
2202 /* Pass a vector of evaluated arguments. */ 2202 /* Pass a vector of evaluated arguments. */
2203 Lisp_Object *vals; 2203 Lisp_Object *vals;
2204 register int argnum = 0; 2204 register size_t argnum = 0;
2205 USE_SAFE_ALLOCA; 2205 USE_SAFE_ALLOCA;
2206 2206
2207 SAFE_ALLOCA_LISP (vals, XINT (numargs)); 2207 SAFE_ALLOCA_LISP (vals, XINT (numargs));
@@ -2330,9 +2330,9 @@ DEFUN ("apply", Fapply, Sapply, 2, MANY, 0,
2330Then return the value FUNCTION returns. 2330Then return the value FUNCTION returns.
2331Thus, (apply '+ 1 2 '(3 4)) returns 10. 2331Thus, (apply '+ 1 2 '(3 4)) returns 10.
2332usage: (apply FUNCTION &rest ARGUMENTS) */) 2332usage: (apply FUNCTION &rest ARGUMENTS) */)
2333 (int nargs, Lisp_Object *args) 2333 (size_t nargs, Lisp_Object *args)
2334{ 2334{
2335 register int i, numargs; 2335 register size_t i, numargs;
2336 register Lisp_Object spread_arg; 2336 register Lisp_Object spread_arg;
2337 register Lisp_Object *funcall_args; 2337 register Lisp_Object *funcall_args;
2338 Lisp_Object fun, retval; 2338 Lisp_Object fun, retval;
@@ -2372,7 +2372,7 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2372 if (numargs < XSUBR (fun)->min_args 2372 if (numargs < XSUBR (fun)->min_args
2373 || (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs)) 2373 || (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs))
2374 goto funcall; /* Let funcall get the error. */ 2374 goto funcall; /* Let funcall get the error. */
2375 else if (XSUBR (fun)->max_args > numargs) 2375 else if (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args > numargs)
2376 { 2376 {
2377 /* Avoid making funcall cons up a yet another new vector of arguments 2377 /* Avoid making funcall cons up a yet another new vector of arguments
2378 by explicitly supplying nil's for optional values. */ 2378 by explicitly supplying nil's for optional values. */
@@ -2413,12 +2413,8 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2413 2413
2414/* Run hook variables in various ways. */ 2414/* Run hook variables in various ways. */
2415 2415
2416Lisp_Object run_hook_with_args (int, Lisp_Object *,
2417 Lisp_Object (*funcall)
2418 (int nargs, Lisp_Object *args));
2419
2420static Lisp_Object 2416static Lisp_Object
2421funcall_nil (int nargs, Lisp_Object *args) 2417funcall_nil (size_t nargs, Lisp_Object *args)
2422{ 2418{
2423 Ffuncall (nargs, args); 2419 Ffuncall (nargs, args);
2424 return Qnil; 2420 return Qnil;
@@ -2439,10 +2435,10 @@ hook; they should use `run-mode-hooks' instead.
2439Do not use `make-local-variable' to make a hook variable buffer-local. 2435Do not use `make-local-variable' to make a hook variable buffer-local.
2440Instead, use `add-hook' and specify t for the LOCAL argument. 2436Instead, use `add-hook' and specify t for the LOCAL argument.
2441usage: (run-hooks &rest HOOKS) */) 2437usage: (run-hooks &rest HOOKS) */)
2442 (int nargs, Lisp_Object *args) 2438 (size_t nargs, Lisp_Object *args)
2443{ 2439{
2444 Lisp_Object hook[1]; 2440 Lisp_Object hook[1];
2445 register int i; 2441 register size_t i;
2446 2442
2447 for (i = 0; i < nargs; i++) 2443 for (i = 0; i < nargs; i++)
2448 { 2444 {
@@ -2468,7 +2464,7 @@ as that may change.
2468Do not use `make-local-variable' to make a hook variable buffer-local. 2464Do not use `make-local-variable' to make a hook variable buffer-local.
2469Instead, use `add-hook' and specify t for the LOCAL argument. 2465Instead, use `add-hook' and specify t for the LOCAL argument.
2470usage: (run-hook-with-args HOOK &rest ARGS) */) 2466usage: (run-hook-with-args HOOK &rest ARGS) */)
2471 (int nargs, Lisp_Object *args) 2467 (size_t nargs, Lisp_Object *args)
2472{ 2468{
2473 return run_hook_with_args (nargs, args, funcall_nil); 2469 return run_hook_with_args (nargs, args, funcall_nil);
2474} 2470}
@@ -2488,13 +2484,13 @@ However, if they all return nil, we return nil.
2488Do not use `make-local-variable' to make a hook variable buffer-local. 2484Do not use `make-local-variable' to make a hook variable buffer-local.
2489Instead, use `add-hook' and specify t for the LOCAL argument. 2485Instead, use `add-hook' and specify t for the LOCAL argument.
2490usage: (run-hook-with-args-until-success HOOK &rest ARGS) */) 2486usage: (run-hook-with-args-until-success HOOK &rest ARGS) */)
2491 (int nargs, Lisp_Object *args) 2487 (size_t nargs, Lisp_Object *args)
2492{ 2488{
2493 return run_hook_with_args (nargs, args, Ffuncall); 2489 return run_hook_with_args (nargs, args, Ffuncall);
2494} 2490}
2495 2491
2496static Lisp_Object 2492static Lisp_Object
2497funcall_not (int nargs, Lisp_Object *args) 2493funcall_not (size_t nargs, Lisp_Object *args)
2498{ 2494{
2499 return NILP (Ffuncall (nargs, args)) ? Qt : Qnil; 2495 return NILP (Ffuncall (nargs, args)) ? Qt : Qnil;
2500} 2496}
@@ -2513,13 +2509,13 @@ Then we return nil. However, if they all return non-nil, we return non-nil.
2513Do not use `make-local-variable' to make a hook variable buffer-local. 2509Do not use `make-local-variable' to make a hook variable buffer-local.
2514Instead, use `add-hook' and specify t for the LOCAL argument. 2510Instead, use `add-hook' and specify t for the LOCAL argument.
2515usage: (run-hook-with-args-until-failure HOOK &rest ARGS) */) 2511usage: (run-hook-with-args-until-failure HOOK &rest ARGS) */)
2516 (int nargs, Lisp_Object *args) 2512 (size_t nargs, Lisp_Object *args)
2517{ 2513{
2518 return NILP (run_hook_with_args (nargs, args, funcall_not)) ? Qt : Qnil; 2514 return NILP (run_hook_with_args (nargs, args, funcall_not)) ? Qt : Qnil;
2519} 2515}
2520 2516
2521static Lisp_Object 2517static Lisp_Object
2522run_hook_wrapped_funcall (int nargs, Lisp_Object *args) 2518run_hook_wrapped_funcall (size_t nargs, Lisp_Object *args)
2523{ 2519{
2524 Lisp_Object tmp = args[0], ret; 2520 Lisp_Object tmp = args[0], ret;
2525 args[0] = args[1]; 2521 args[0] = args[1];
@@ -2537,11 +2533,11 @@ it calls WRAP-FUNCTION with arguments FUN and ARGS.
2537As soon as a call to WRAP-FUNCTION returns non-nil, `run-hook-wrapped' 2533As soon as a call to WRAP-FUNCTION returns non-nil, `run-hook-wrapped'
2538aborts and returns that value. 2534aborts and returns that value.
2539usage: (run-hook-wrapped HOOK WRAP-FUNCTION &rest ARGS) */) 2535usage: (run-hook-wrapped HOOK WRAP-FUNCTION &rest ARGS) */)
2540 (int nargs, Lisp_Object *args) 2536 (size_t nargs, Lisp_Object *args)
2541{ 2537{
2542 return run_hook_with_args (nargs, args, run_hook_wrapped_funcall); 2538 return run_hook_with_args (nargs, args, run_hook_wrapped_funcall);
2543} 2539}
2544 2540
2545/* ARGS[0] should be a hook symbol. 2541/* ARGS[0] should be a hook symbol.
2546 Call each of the functions in the hook value, passing each of them 2542 Call each of the functions in the hook value, passing each of them
2547 as arguments all the rest of ARGS (all NARGS - 1 elements). 2543 as arguments all the rest of ARGS (all NARGS - 1 elements).
@@ -2550,8 +2546,8 @@ usage: (run-hook-wrapped HOOK WRAP-FUNCTION &rest ARGS) */)
2550 except that it isn't necessary to gcpro ARGS[0]. */ 2546 except that it isn't necessary to gcpro ARGS[0]. */
2551 2547
2552Lisp_Object 2548Lisp_Object
2553run_hook_with_args (int nargs, Lisp_Object *args, 2549run_hook_with_args (size_t nargs, Lisp_Object *args,
2554 Lisp_Object (*funcall) (int nargs, Lisp_Object *args)) 2550 Lisp_Object (*funcall) (size_t nargs, Lisp_Object *args))
2555{ 2551{
2556 Lisp_Object sym, val, ret = Qnil; 2552 Lisp_Object sym, val, ret = Qnil;
2557 struct gcpro gcpro1, gcpro2, gcpro3; 2553 struct gcpro gcpro1, gcpro2, gcpro3;
@@ -2791,16 +2787,16 @@ DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0,
2791Return the value that function returns. 2787Return the value that function returns.
2792Thus, (funcall 'cons 'x 'y) returns (x . y). 2788Thus, (funcall 'cons 'x 'y) returns (x . y).
2793usage: (funcall FUNCTION &rest ARGUMENTS) */) 2789usage: (funcall FUNCTION &rest ARGUMENTS) */)
2794 (int nargs, Lisp_Object *args) 2790 (size_t nargs, Lisp_Object *args)
2795{ 2791{
2796 Lisp_Object fun, original_fun; 2792 Lisp_Object fun, original_fun;
2797 Lisp_Object funcar; 2793 Lisp_Object funcar;
2798 int numargs = nargs - 1; 2794 size_t numargs = nargs - 1;
2799 Lisp_Object lisp_numargs; 2795 Lisp_Object lisp_numargs;
2800 Lisp_Object val; 2796 Lisp_Object val;
2801 struct backtrace backtrace; 2797 struct backtrace backtrace;
2802 register Lisp_Object *internal_args; 2798 register Lisp_Object *internal_args;
2803 register int i; 2799 register size_t i;
2804 2800
2805 QUIT; 2801 QUIT;
2806 if ((consing_since_gc > gc_cons_threshold 2802 if ((consing_since_gc > gc_cons_threshold
@@ -2953,21 +2949,21 @@ static Lisp_Object
2953apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag) 2949apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag)
2954{ 2950{
2955 Lisp_Object args_left; 2951 Lisp_Object args_left;
2956 Lisp_Object numargs; 2952 size_t numargs;
2957 register Lisp_Object *arg_vector; 2953 register Lisp_Object *arg_vector;
2958 struct gcpro gcpro1, gcpro2, gcpro3; 2954 struct gcpro gcpro1, gcpro2, gcpro3;
2959 register int i; 2955 register size_t i;
2960 register Lisp_Object tem; 2956 register Lisp_Object tem;
2961 USE_SAFE_ALLOCA; 2957 USE_SAFE_ALLOCA;
2962 2958
2963 numargs = Flength (args); 2959 numargs = XINT (Flength (args));
2964 SAFE_ALLOCA_LISP (arg_vector, XINT (numargs)); 2960 SAFE_ALLOCA_LISP (arg_vector, numargs);
2965 args_left = args; 2961 args_left = args;
2966 2962
2967 GCPRO3 (*arg_vector, args_left, fun); 2963 GCPRO3 (*arg_vector, args_left, fun);
2968 gcpro1.nvars = 0; 2964 gcpro1.nvars = 0;
2969 2965
2970 for (i = 0; i < XINT (numargs);) 2966 for (i = 0; i < numargs; )
2971 { 2967 {
2972 tem = Fcar (args_left), args_left = Fcdr (args_left); 2968 tem = Fcar (args_left), args_left = Fcdr (args_left);
2973 if (eval_flag) tem = Feval (tem); 2969 if (eval_flag) tem = Feval (tem);
@@ -2983,7 +2979,7 @@ apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag)
2983 backtrace_list->nargs = i; 2979 backtrace_list->nargs = i;
2984 } 2980 }
2985 backtrace_list->evalargs = 0; 2981 backtrace_list->evalargs = 0;
2986 tem = funcall_lambda (fun, XINT (numargs), arg_vector); 2982 tem = funcall_lambda (fun, numargs, arg_vector);
2987 2983
2988 /* Do the debug-on-exit now, while arg_vector still exists. */ 2984 /* Do the debug-on-exit now, while arg_vector still exists. */
2989 if (backtrace_list->debug_on_exit) 2985 if (backtrace_list->debug_on_exit)
@@ -2999,11 +2995,13 @@ apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag)
2999 FUN must be either a lambda-expression or a compiled-code object. */ 2995 FUN must be either a lambda-expression or a compiled-code object. */
3000 2996
3001static Lisp_Object 2997static Lisp_Object
3002funcall_lambda (Lisp_Object fun, int nargs, register Lisp_Object *arg_vector) 2998funcall_lambda (Lisp_Object fun, size_t nargs,
2999 register Lisp_Object *arg_vector)
3003{ 3000{
3004 Lisp_Object val, syms_left, next; 3001 Lisp_Object val, syms_left, next;
3005 int count = SPECPDL_INDEX (); 3002 int count = SPECPDL_INDEX ();
3006 int i, optional, rest; 3003 size_t i;
3004 int optional, rest;
3007 3005
3008 if (CONSP (fun)) 3006 if (CONSP (fun))
3009 { 3007 {
@@ -3323,7 +3321,6 @@ Output stream used is value of `standard-output'. */)
3323 (void) 3321 (void)
3324{ 3322{
3325 register struct backtrace *backlist = backtrace_list; 3323 register struct backtrace *backlist = backtrace_list;
3326 register int i;
3327 Lisp_Object tail; 3324 Lisp_Object tail;
3328 Lisp_Object tem; 3325 Lisp_Object tem;
3329 struct gcpro gcpro1; 3326 struct gcpro gcpro1;
@@ -3338,7 +3335,7 @@ Output stream used is value of `standard-output'. */)
3338 while (backlist) 3335 while (backlist)
3339 { 3336 {
3340 write_string (backlist->debug_on_exit ? "* " : " ", 2); 3337 write_string (backlist->debug_on_exit ? "* " : " ", 2);
3341 if (backlist->nargs == UNEVALLED) 3338 if (backlist->nargs == (size_t) UNEVALLED)
3342 { 3339 {
3343 Fprin1 (Fcons (*backlist->function, *backlist->args), Qnil); 3340 Fprin1 (Fcons (*backlist->function, *backlist->args), Qnil);
3344 write_string ("\n", -1); 3341 write_string ("\n", -1);
@@ -3348,11 +3345,12 @@ Output stream used is value of `standard-output'. */)
3348 tem = *backlist->function; 3345 tem = *backlist->function;
3349 Fprin1 (tem, Qnil); /* This can QUIT. */ 3346 Fprin1 (tem, Qnil); /* This can QUIT. */
3350 write_string ("(", -1); 3347 write_string ("(", -1);
3351 if (backlist->nargs == MANY) 3348 if (backlist->nargs == (size_t) MANY)
3352 { 3349 {
3350 int i;
3353 for (tail = *backlist->args, i = 0; 3351 for (tail = *backlist->args, i = 0;
3354 !NILP (tail); 3352 !NILP (tail);
3355 tail = Fcdr (tail), i++) 3353 tail = Fcdr (tail), i = 1)
3356 { 3354 {
3357 if (i) write_string (" ", -1); 3355 if (i) write_string (" ", -1);
3358 Fprin1 (Fcar (tail), Qnil); 3356 Fprin1 (Fcar (tail), Qnil);
@@ -3360,6 +3358,7 @@ Output stream used is value of `standard-output'. */)
3360 } 3358 }
3361 else 3359 else
3362 { 3360 {
3361 size_t i;
3363 for (i = 0; i < backlist->nargs; i++) 3362 for (i = 0; i < backlist->nargs; i++)
3364 { 3363 {
3365 if (i) write_string (" ", -1); 3364 if (i) write_string (" ", -1);
@@ -3389,7 +3388,7 @@ If NFRAMES is more than the number of frames, the value is nil. */)
3389 (Lisp_Object nframes) 3388 (Lisp_Object nframes)
3390{ 3389{
3391 register struct backtrace *backlist = backtrace_list; 3390 register struct backtrace *backlist = backtrace_list;
3392 register int i; 3391 register EMACS_INT i;
3393 Lisp_Object tem; 3392 Lisp_Object tem;
3394 3393
3395 CHECK_NATNUM (nframes); 3394 CHECK_NATNUM (nframes);
@@ -3400,11 +3399,11 @@ If NFRAMES is more than the number of frames, the value is nil. */)
3400 3399
3401 if (!backlist) 3400 if (!backlist)
3402 return Qnil; 3401 return Qnil;
3403 if (backlist->nargs == UNEVALLED) 3402 if (backlist->nargs == (size_t) UNEVALLED)
3404 return Fcons (Qnil, Fcons (*backlist->function, *backlist->args)); 3403 return Fcons (Qnil, Fcons (*backlist->function, *backlist->args));
3405 else 3404 else
3406 { 3405 {
3407 if (backlist->nargs == MANY) 3406 if (backlist->nargs == (size_t) MANY)
3408 tem = *backlist->args; 3407 tem = *backlist->args;
3409 else 3408 else
3410 tem = Flist (backlist->nargs, backlist->args); 3409 tem = Flist (backlist->nargs, backlist->args);
@@ -3418,17 +3417,18 @@ void
3418mark_backtrace (void) 3417mark_backtrace (void)
3419{ 3418{
3420 register struct backtrace *backlist; 3419 register struct backtrace *backlist;
3421 register int i; 3420 register size_t i;
3422 3421
3423 for (backlist = backtrace_list; backlist; backlist = backlist->next) 3422 for (backlist = backtrace_list; backlist; backlist = backlist->next)
3424 { 3423 {
3425 mark_object (*backlist->function); 3424 mark_object (*backlist->function);
3426 3425
3427 if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) 3426 if (backlist->nargs == (size_t) UNEVALLED
3428 i = 0; 3427 || backlist->nargs == (size_t) MANY)
3428 i = 1;
3429 else 3429 else
3430 i = backlist->nargs - 1; 3430 i = backlist->nargs;
3431 for (; i >= 0; i--) 3431 while (i--)
3432 mark_object (backlist->args[i]); 3432 mark_object (backlist->args[i]);
3433 } 3433 }
3434} 3434}
diff --git a/src/fns.c b/src/fns.c
index 71f49b9cdae..95e8badbaa5 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -348,7 +348,7 @@ Symbols are also allowed; their print names are used instead. */)
348 return i1 < SCHARS (s2) ? Qt : Qnil; 348 return i1 < SCHARS (s2) ? Qt : Qnil;
349} 349}
350 350
351static Lisp_Object concat (int nargs, Lisp_Object *args, 351static Lisp_Object concat (size_t nargs, Lisp_Object *args,
352 enum Lisp_Type target_type, int last_special); 352 enum Lisp_Type target_type, int last_special);
353 353
354/* ARGSUSED */ 354/* ARGSUSED */
@@ -378,7 +378,7 @@ The result is a list whose elements are the elements of all the arguments.
378Each argument may be a list, vector or string. 378Each argument may be a list, vector or string.
379The last argument is not copied, just used as the tail of the new list. 379The last argument is not copied, just used as the tail of the new list.
380usage: (append &rest SEQUENCES) */) 380usage: (append &rest SEQUENCES) */)
381 (int nargs, Lisp_Object *args) 381 (size_t nargs, Lisp_Object *args)
382{ 382{
383 return concat (nargs, args, Lisp_Cons, 1); 383 return concat (nargs, args, Lisp_Cons, 1);
384} 384}
@@ -388,7 +388,7 @@ DEFUN ("concat", Fconcat, Sconcat, 0, MANY, 0,
388The result is a string whose elements are the elements of all the arguments. 388The result is a string whose elements are the elements of all the arguments.
389Each argument may be a string or a list or vector of characters (integers). 389Each argument may be a string or a list or vector of characters (integers).
390usage: (concat &rest SEQUENCES) */) 390usage: (concat &rest SEQUENCES) */)
391 (int nargs, Lisp_Object *args) 391 (size_t nargs, Lisp_Object *args)
392{ 392{
393 return concat (nargs, args, Lisp_String, 0); 393 return concat (nargs, args, Lisp_String, 0);
394} 394}
@@ -398,7 +398,7 @@ DEFUN ("vconcat", Fvconcat, Svconcat, 0, MANY, 0,
398The result is a vector whose elements are the elements of all the arguments. 398The result is a vector whose elements are the elements of all the arguments.
399Each argument may be a list, vector or string. 399Each argument may be a list, vector or string.
400usage: (vconcat &rest SEQUENCES) */) 400usage: (vconcat &rest SEQUENCES) */)
401 (int nargs, Lisp_Object *args) 401 (size_t nargs, Lisp_Object *args)
402{ 402{
403 return concat (nargs, args, Lisp_Vectorlike, 0); 403 return concat (nargs, args, Lisp_Vectorlike, 0);
404} 404}
@@ -446,7 +446,8 @@ struct textprop_rec
446}; 446};
447 447
448static Lisp_Object 448static Lisp_Object
449concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special) 449concat (size_t nargs, Lisp_Object *args,
450 enum Lisp_Type target_type, int last_special)
450{ 451{
451 Lisp_Object val; 452 Lisp_Object val;
452 register Lisp_Object tail; 453 register Lisp_Object tail;
@@ -455,7 +456,7 @@ concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_speci
455 EMACS_INT toindex_byte = 0; 456 EMACS_INT toindex_byte = 0;
456 register EMACS_INT result_len; 457 register EMACS_INT result_len;
457 register EMACS_INT result_len_byte; 458 register EMACS_INT result_len_byte;
458 register int argnum; 459 register size_t argnum;
459 Lisp_Object last_tail; 460 Lisp_Object last_tail;
460 Lisp_Object prev; 461 Lisp_Object prev;
461 int some_multibyte; 462 int some_multibyte;
@@ -2232,9 +2233,9 @@ DEFUN ("nconc", Fnconc, Snconc, 0, MANY, 0,
2232 doc: /* Concatenate any number of lists by altering them. 2233 doc: /* Concatenate any number of lists by altering them.
2233Only the last argument is not altered, and need not be a list. 2234Only the last argument is not altered, and need not be a list.
2234usage: (nconc &rest LISTS) */) 2235usage: (nconc &rest LISTS) */)
2235 (int nargs, Lisp_Object *args) 2236 (size_t nargs, Lisp_Object *args)
2236{ 2237{
2237 register int argnum; 2238 register size_t argnum;
2238 register Lisp_Object tail, tem, val; 2239 register Lisp_Object tail, tem, val;
2239 2240
2240 val = tail = Qnil; 2241 val = tail = Qnil;
@@ -2763,7 +2764,7 @@ DEFUN ("widget-apply", Fwidget_apply, Swidget_apply, 2, MANY, 0,
2763 doc: /* Apply the value of WIDGET's PROPERTY to the widget itself. 2764 doc: /* Apply the value of WIDGET's PROPERTY to the widget itself.
2764ARGS are passed as extra arguments to the function. 2765ARGS are passed as extra arguments to the function.
2765usage: (widget-apply WIDGET PROPERTY &rest ARGS) */) 2766usage: (widget-apply WIDGET PROPERTY &rest ARGS) */)
2766 (int nargs, Lisp_Object *args) 2767 (size_t nargs, Lisp_Object *args)
2767{ 2768{
2768 /* This function can GC. */ 2769 /* This function can GC. */
2769 Lisp_Object newargs[3]; 2770 Lisp_Object newargs[3];
@@ -3367,7 +3368,7 @@ Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value;
3367/* Function prototypes. */ 3368/* Function prototypes. */
3368 3369
3369static struct Lisp_Hash_Table *check_hash_table (Lisp_Object); 3370static struct Lisp_Hash_Table *check_hash_table (Lisp_Object);
3370static int get_key_arg (Lisp_Object, int, Lisp_Object *, char *); 3371static size_t get_key_arg (Lisp_Object, size_t, Lisp_Object *, char *);
3371static void maybe_resize_hash_table (struct Lisp_Hash_Table *); 3372static void maybe_resize_hash_table (struct Lisp_Hash_Table *);
3372static int cmpfn_eql (struct Lisp_Hash_Table *, Lisp_Object, unsigned, 3373static int cmpfn_eql (struct Lisp_Hash_Table *, Lisp_Object, unsigned,
3373 Lisp_Object, unsigned); 3374 Lisp_Object, unsigned);
@@ -3422,27 +3423,23 @@ next_almost_prime (int n)
3422/* Find KEY in ARGS which has size NARGS. Don't consider indices for 3423/* Find KEY in ARGS which has size NARGS. Don't consider indices for
3423 which USED[I] is non-zero. If found at index I in ARGS, set 3424 which USED[I] is non-zero. If found at index I in ARGS, set
3424 USED[I] and USED[I + 1] to 1, and return I + 1. Otherwise return 3425 USED[I] and USED[I + 1] to 1, and return I + 1. Otherwise return
3425 -1. This function is used to extract a keyword/argument pair from 3426 0. This function is used to extract a keyword/argument pair from
3426 a DEFUN parameter list. */ 3427 a DEFUN parameter list. */
3427 3428
3428static int 3429static size_t
3429get_key_arg (Lisp_Object key, int nargs, Lisp_Object *args, char *used) 3430get_key_arg (Lisp_Object key, size_t nargs, Lisp_Object *args, char *used)
3430{ 3431{
3431 int i; 3432 size_t i;
3432
3433 for (i = 0; i < nargs - 1; ++i)
3434 if (!used[i] && EQ (args[i], key))
3435 break;
3436 3433
3437 if (i >= nargs - 1) 3434 for (i = 1; i < nargs; i++)
3438 i = -1; 3435 if (!used[i - 1] && EQ (args[i - 1], key))
3439 else 3436 {
3440 { 3437 used[i - 1] = 1;
3441 used[i++] = 1; 3438 used[i] = 1;
3442 used[i] = 1; 3439 return i;
3443 } 3440 }
3444 3441
3445 return i; 3442 return 0;
3446} 3443}
3447 3444
3448 3445
@@ -4290,12 +4287,12 @@ WEAK. WEAK t is equivalent to `key-and-value'. Default value of WEAK
4290is nil. 4287is nil.
4291 4288
4292usage: (make-hash-table &rest KEYWORD-ARGS) */) 4289usage: (make-hash-table &rest KEYWORD-ARGS) */)
4293 (int nargs, Lisp_Object *args) 4290 (size_t nargs, Lisp_Object *args)
4294{ 4291{
4295 Lisp_Object test, size, rehash_size, rehash_threshold, weak; 4292 Lisp_Object test, size, rehash_size, rehash_threshold, weak;
4296 Lisp_Object user_test, user_hash; 4293 Lisp_Object user_test, user_hash;
4297 char *used; 4294 char *used;
4298 int i; 4295 size_t i;
4299 4296
4300 /* The vector `used' is used to keep track of arguments that 4297 /* The vector `used' is used to keep track of arguments that
4301 have been consumed. */ 4298 have been consumed. */
@@ -4304,7 +4301,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
4304 4301
4305 /* See if there's a `:test TEST' among the arguments. */ 4302 /* See if there's a `:test TEST' among the arguments. */
4306 i = get_key_arg (QCtest, nargs, args, used); 4303 i = get_key_arg (QCtest, nargs, args, used);
4307 test = i < 0 ? Qeql : args[i]; 4304 test = i ? args[i] : Qeql;
4308 if (!EQ (test, Qeq) && !EQ (test, Qeql) && !EQ (test, Qequal)) 4305 if (!EQ (test, Qeq) && !EQ (test, Qeql) && !EQ (test, Qequal))
4309 { 4306 {
4310 /* See if it is a user-defined test. */ 4307 /* See if it is a user-defined test. */
@@ -4321,7 +4318,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
4321 4318
4322 /* See if there's a `:size SIZE' argument. */ 4319 /* See if there's a `:size SIZE' argument. */
4323 i = get_key_arg (QCsize, nargs, args, used); 4320 i = get_key_arg (QCsize, nargs, args, used);
4324 size = i < 0 ? Qnil : args[i]; 4321 size = i ? args[i] : Qnil;
4325 if (NILP (size)) 4322 if (NILP (size))
4326 size = make_number (DEFAULT_HASH_SIZE); 4323 size = make_number (DEFAULT_HASH_SIZE);
4327 else if (!INTEGERP (size) || XINT (size) < 0) 4324 else if (!INTEGERP (size) || XINT (size) < 0)
@@ -4329,7 +4326,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
4329 4326
4330 /* Look for `:rehash-size SIZE'. */ 4327 /* Look for `:rehash-size SIZE'. */
4331 i = get_key_arg (QCrehash_size, nargs, args, used); 4328 i = get_key_arg (QCrehash_size, nargs, args, used);
4332 rehash_size = i < 0 ? make_float (DEFAULT_REHASH_SIZE) : args[i]; 4329 rehash_size = i ? args[i] : make_float (DEFAULT_REHASH_SIZE);
4333 if (!NUMBERP (rehash_size) 4330 if (!NUMBERP (rehash_size)
4334 || (INTEGERP (rehash_size) && XINT (rehash_size) <= 0) 4331 || (INTEGERP (rehash_size) && XINT (rehash_size) <= 0)
4335 || XFLOATINT (rehash_size) <= 1.0) 4332 || XFLOATINT (rehash_size) <= 1.0)
@@ -4337,7 +4334,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
4337 4334
4338 /* Look for `:rehash-threshold THRESHOLD'. */ 4335 /* Look for `:rehash-threshold THRESHOLD'. */
4339 i = get_key_arg (QCrehash_threshold, nargs, args, used); 4336 i = get_key_arg (QCrehash_threshold, nargs, args, used);
4340 rehash_threshold = i < 0 ? make_float (DEFAULT_REHASH_THRESHOLD) : args[i]; 4337 rehash_threshold = i ? args[i] : make_float (DEFAULT_REHASH_THRESHOLD);
4341 if (!FLOATP (rehash_threshold) 4338 if (!FLOATP (rehash_threshold)
4342 || XFLOATINT (rehash_threshold) <= 0.0 4339 || XFLOATINT (rehash_threshold) <= 0.0
4343 || XFLOATINT (rehash_threshold) > 1.0) 4340 || XFLOATINT (rehash_threshold) > 1.0)
@@ -4345,7 +4342,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
4345 4342
4346 /* Look for `:weakness WEAK'. */ 4343 /* Look for `:weakness WEAK'. */
4347 i = get_key_arg (QCweakness, nargs, args, used); 4344 i = get_key_arg (QCweakness, nargs, args, used);
4348 weak = i < 0 ? Qnil : args[i]; 4345 weak = i ? args[i] : Qnil;
4349 if (EQ (weak, Qt)) 4346 if (EQ (weak, Qt))
4350 weak = Qkey_and_value; 4347 weak = Qkey_and_value;
4351 if (!NILP (weak) 4348 if (!NILP (weak)
diff --git a/src/font.c b/src/font.c
index 9e8b7029c22..6b2e2f2712d 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3831,10 +3831,10 @@ be an OpenType font, and whose GPOS table of `thai' script's default
3831language system must contain `mark' feature. 3831language system must contain `mark' feature.
3832 3832
3833usage: (font-spec ARGS...) */) 3833usage: (font-spec ARGS...) */)
3834 (int nargs, Lisp_Object *args) 3834 (size_t nargs, Lisp_Object *args)
3835{ 3835{
3836 Lisp_Object spec = font_make_spec (); 3836 Lisp_Object spec = font_make_spec ();
3837 int i; 3837 size_t i;
3838 3838
3839 for (i = 0; i < nargs; i += 2) 3839 for (i = 0; i < nargs; i += 2)
3840 { 3840 {
diff --git a/src/frame.c b/src/frame.c
index cdcb313280b..1b6d36092ae 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2902,7 +2902,7 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist)
2902 /* Record in these vectors all the parms specified. */ 2902 /* Record in these vectors all the parms specified. */
2903 Lisp_Object *parms; 2903 Lisp_Object *parms;
2904 Lisp_Object *values; 2904 Lisp_Object *values;
2905 int i, p; 2905 size_t i, p;
2906 int left_no_change = 0, top_no_change = 0; 2906 int left_no_change = 0, top_no_change = 0;
2907 int icon_left_no_change = 0, icon_top_no_change = 0; 2907 int icon_left_no_change = 0, icon_top_no_change = 0;
2908 int size_changed = 0; 2908 int size_changed = 0;
@@ -2975,7 +2975,7 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist)
2975 } 2975 }
2976 2976
2977 /* Now process them in reverse of specified order. */ 2977 /* Now process them in reverse of specified order. */
2978 for (i--; i >= 0; i--) 2978 while (i-- != 0)
2979 { 2979 {
2980 Lisp_Object prop, val; 2980 Lisp_Object prop, val;
2981 2981
diff --git a/src/image.c b/src/image.c
index 04c6b1a2ad5..25929d1004c 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6753,7 +6753,7 @@ tiff_load (struct frame *f, struct image *img)
6753 TIFF *tiff; 6753 TIFF *tiff;
6754 int width, height, x, y, count; 6754 int width, height, x, y, count;
6755 uint32 *buf; 6755 uint32 *buf;
6756 int rc, rc2; 6756 int rc;
6757 XImagePtr ximg; 6757 XImagePtr ximg;
6758 tiff_memory_source memsrc; 6758 tiff_memory_source memsrc;
6759 Lisp_Object image; 6759 Lisp_Object image;
@@ -6841,8 +6841,8 @@ tiff_load (struct frame *f, struct image *img)
6841 rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0); 6841 rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0);
6842 6842
6843 /* Count the number of images in the file. */ 6843 /* Count the number of images in the file. */
6844 for (count = 1, rc2 = 1; rc2; count++) 6844 for (count = 1; fn_TIFFSetDirectory (tiff, count); count++)
6845 rc2 = fn_TIFFSetDirectory (tiff, count); 6845 continue;
6846 6846
6847 if (count > 1) 6847 if (count > 1)
6848 img->data.lisp_val = Fcons (Qcount, 6848 img->data.lisp_val = Fcons (Qcount,
diff --git a/src/keyboard.c b/src/keyboard.c
index 3fea3df07d5..86a2b3e8abd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -201,8 +201,8 @@ Lisp_Object unread_switch_frame;
201/* Last size recorded for a current buffer which is not a minibuffer. */ 201/* Last size recorded for a current buffer which is not a minibuffer. */
202static EMACS_INT last_non_minibuf_size; 202static EMACS_INT last_non_minibuf_size;
203 203
204/* Total number of times read_char has returned. */ 204/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */
205int num_input_events; 205size_t num_input_events;
206 206
207/* Value of num_nonmacro_input_events as of last auto save. */ 207/* Value of num_nonmacro_input_events as of last auto save. */
208 208
@@ -1269,7 +1269,7 @@ some_mouse_moved (void)
1269/* This is the actual command reading loop, 1269/* This is the actual command reading loop,
1270 sans error-handling encapsulation. */ 1270 sans error-handling encapsulation. */
1271 1271
1272static int read_key_sequence (Lisp_Object *, int, Lisp_Object, 1272static int read_key_sequence (Lisp_Object *, size_t, Lisp_Object,
1273 int, int, int); 1273 int, int, int);
1274void safe_run_hooks (Lisp_Object); 1274void safe_run_hooks (Lisp_Object);
1275static void adjust_point_for_property (EMACS_INT, int); 1275static void adjust_point_for_property (EMACS_INT, int);
@@ -1862,7 +1862,7 @@ safe_run_hooks_error (Lisp_Object error_data)
1862} 1862}
1863 1863
1864static Lisp_Object 1864static Lisp_Object
1865safe_run_hook_funcall (int nargs, Lisp_Object *args) 1865safe_run_hook_funcall (size_t nargs, Lisp_Object *args)
1866{ 1866{
1867 eassert (nargs == 1); 1867 eassert (nargs == 1);
1868 if (CONSP (Vinhibit_quit)) 1868 if (CONSP (Vinhibit_quit))
@@ -6004,10 +6004,10 @@ make_lispy_switch_frame (Lisp_Object frame)
6004 This doesn't use any caches. */ 6004 This doesn't use any caches. */
6005 6005
6006static int 6006static int
6007parse_modifiers_uncached (Lisp_Object symbol, int *modifier_end) 6007parse_modifiers_uncached (Lisp_Object symbol, EMACS_INT *modifier_end)
6008{ 6008{
6009 Lisp_Object name; 6009 Lisp_Object name;
6010 int i; 6010 EMACS_INT i;
6011 int modifiers; 6011 int modifiers;
6012 6012
6013 CHECK_SYMBOL (symbol); 6013 CHECK_SYMBOL (symbol);
@@ -6017,7 +6017,7 @@ parse_modifiers_uncached (Lisp_Object symbol, int *modifier_end)
6017 6017
6018 for (i = 0; i+2 <= SBYTES (name); ) 6018 for (i = 0; i+2 <= SBYTES (name); )
6019 { 6019 {
6020 int this_mod_end = 0; 6020 EMACS_INT this_mod_end = 0;
6021 int this_mod = 0; 6021 int this_mod = 0;
6022 6022
6023 /* See if the name continues with a modifier word. 6023 /* See if the name continues with a modifier word.
@@ -6214,7 +6214,7 @@ parse_modifiers (Lisp_Object symbol)
6214 return elements; 6214 return elements;
6215 else 6215 else
6216 { 6216 {
6217 int end; 6217 EMACS_INT end;
6218 int modifiers = parse_modifiers_uncached (symbol, &end); 6218 int modifiers = parse_modifiers_uncached (symbol, &end);
6219 Lisp_Object unmodified; 6219 Lisp_Object unmodified;
6220 Lisp_Object mask; 6220 Lisp_Object mask;
@@ -8793,7 +8793,7 @@ access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt,
8793 The return value is non-zero if the remapping actually took place. */ 8793 The return value is non-zero if the remapping actually took place. */
8794 8794
8795static int 8795static int
8796keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey, 8796keyremap_step (Lisp_Object *keybuf, size_t bufsize, volatile keyremap *fkey,
8797 int input, int doit, int *diff, Lisp_Object prompt) 8797 int input, int doit, int *diff, Lisp_Object prompt)
8798{ 8798{
8799 Lisp_Object next, key; 8799 Lisp_Object next, key;
@@ -8886,7 +8886,7 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
8886 from the selected window's buffer. */ 8886 from the selected window's buffer. */
8887 8887
8888static int 8888static int
8889read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, 8889read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt,
8890 int dont_downcase_last, int can_return_switch_frame, 8890 int dont_downcase_last, int can_return_switch_frame,
8891 int fix_current_buffer) 8891 int fix_current_buffer)
8892{ 8892{
@@ -9404,80 +9404,84 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9404 last_real_key_start = t - 1; 9404 last_real_key_start = t - 1;
9405 } 9405 }
9406 9406
9407 /* Key sequences beginning with mouse clicks are 9407 if (last_real_key_start == 0)
9408 read using the keymaps in the buffer clicked on,
9409 not the current buffer. If we're at the
9410 beginning of a key sequence, switch buffers. */
9411 if (last_real_key_start == 0
9412 && WINDOWP (window)
9413 && BUFFERP (XWINDOW (window)->buffer)
9414 && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
9415 { 9408 {
9416 XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; 9409 /* Key sequences beginning with mouse clicks are
9417 keybuf[t] = key; 9410 read using the keymaps in the buffer clicked on,
9418 mock_input = t + 1; 9411 not the current buffer. If we're at the
9419 9412 beginning of a key sequence, switch buffers. */
9420 /* Arrange to go back to the original buffer once we're 9413 if (WINDOWP (window)
9421 done reading the key sequence. Note that we can't 9414 && BUFFERP (XWINDOW (window)->buffer)
9422 use save_excursion_{save,restore} here, because they 9415 && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
9423 save point as well as the current buffer; we don't 9416 {
9424 want to save point, because redisplay may change it, 9417 XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key;
9425 to accommodate a Fset_window_start or something. We 9418 keybuf[t] = key;
9426 don't want to do this at the top of the function, 9419 mock_input = t + 1;
9427 because we may get input from a subprocess which 9420
9428 wants to change the selected window and stuff (say, 9421 /* Arrange to go back to the original buffer once we're
9429 emacsclient). */ 9422 done reading the key sequence. Note that we can't
9430 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); 9423 use save_excursion_{save,restore} here, because they
9431 9424 save point as well as the current buffer; we don't
9432 if (! FRAME_LIVE_P (XFRAME (selected_frame))) 9425 want to save point, because redisplay may change it,
9433 Fkill_emacs (Qnil); 9426 to accommodate a Fset_window_start or something. We
9434 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); 9427 don't want to do this at the top of the function,
9435 orig_local_map = get_local_map (PT, current_buffer, 9428 because we may get input from a subprocess which
9436 Qlocal_map); 9429 wants to change the selected window and stuff (say,
9437 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); 9430 emacsclient). */
9438 goto replay_sequence; 9431 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
9439 } 9432
9433 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
9434 Fkill_emacs (Qnil);
9435 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
9436 orig_local_map = get_local_map (PT, current_buffer,
9437 Qlocal_map);
9438 orig_keymap = get_local_map (PT, current_buffer,
9439 Qkeymap);
9440 goto replay_sequence;
9441 }
9440 9442
9441 /* For a mouse click, get the local text-property keymap 9443 /* For a mouse click, get the local text-property keymap
9442 of the place clicked on, rather than point. */ 9444 of the place clicked on, rather than point. */
9443 if (last_real_key_start == 0 9445 if (CONSP (XCDR (key))
9444 && CONSP (XCDR (key)) 9446 && ! localized_local_map)
9445 && ! localized_local_map) 9447 {
9446 { 9448 Lisp_Object map_here, start, pos;
9447 Lisp_Object map_here, start, pos;
9448 9449
9449 localized_local_map = 1; 9450 localized_local_map = 1;
9450 start = EVENT_START (key); 9451 start = EVENT_START (key);
9451 9452
9452 if (CONSP (start) && POSN_INBUFFER_P (start)) 9453 if (CONSP (start) && POSN_INBUFFER_P (start))
9453 {
9454 pos = POSN_BUFFER_POSN (start);
9455 if (INTEGERP (pos)
9456 && XINT (pos) >= BEGV
9457 && XINT (pos) <= ZV)
9458 { 9454 {
9459 map_here = get_local_map (XINT (pos), 9455 pos = POSN_BUFFER_POSN (start);
9460 current_buffer, Qlocal_map); 9456 if (INTEGERP (pos)
9461 if (!EQ (map_here, orig_local_map)) 9457 && XINT (pos) >= BEGV
9458 && XINT (pos) <= ZV)
9462 { 9459 {
9463 orig_local_map = map_here; 9460 map_here = get_local_map (XINT (pos),
9464 ++localized_local_map; 9461 current_buffer,
9465 } 9462 Qlocal_map);
9463 if (!EQ (map_here, orig_local_map))
9464 {
9465 orig_local_map = map_here;
9466 ++localized_local_map;
9467 }
9466 9468
9467 map_here = get_local_map (XINT (pos), 9469 map_here = get_local_map (XINT (pos),
9468 current_buffer, Qkeymap); 9470 current_buffer,
9469 if (!EQ (map_here, orig_keymap)) 9471 Qkeymap);
9470 { 9472 if (!EQ (map_here, orig_keymap))
9471 orig_keymap = map_here; 9473 {
9472 ++localized_local_map; 9474 orig_keymap = map_here;
9473 } 9475 ++localized_local_map;
9476 }
9474 9477
9475 if (localized_local_map > 1) 9478 if (localized_local_map > 1)
9476 { 9479 {
9477 keybuf[t] = key; 9480 keybuf[t] = key;
9478 mock_input = t + 1; 9481 mock_input = t + 1;
9479 9482
9480 goto replay_sequence; 9483 goto replay_sequence;
9484 }
9481 } 9485 }
9482 } 9486 }
9483 } 9487 }
@@ -11602,12 +11606,12 @@ syms_of_keyboard (void)
11602 last_point_position_window = Qnil; 11606 last_point_position_window = Qnil;
11603 11607
11604 { 11608 {
11605 const struct event_head *p; 11609 int i;
11610 int len = sizeof (head_table) / sizeof (head_table[0]);
11606 11611
11607 for (p = head_table; 11612 for (i = 0; i < len; i++)
11608 p < head_table + (sizeof (head_table) / sizeof (head_table[0]));
11609 p++)
11610 { 11613 {
11614 const struct event_head *p = &head_table[i];
11611 *p->var = intern_c_string (p->name); 11615 *p->var = intern_c_string (p->name);
11612 staticpro (p->var); 11616 staticpro (p->var);
11613 Fput (*p->var, Qevent_kind, *p->kind); 11617 Fput (*p->var, Qevent_kind, *p->kind);
diff --git a/src/keyboard.h b/src/keyboard.h
index 2ff370306b6..72bb821b2eb 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -194,8 +194,8 @@ extern KBOARD *all_kboards;
194/* Nonzero in the single-kboard state, 0 in the any-kboard state. */ 194/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
195extern int single_kboard; 195extern int single_kboard;
196 196
197/* Total number of times read_char has returned. */ 197/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */
198extern int num_input_events; 198extern size_t num_input_events;
199 199
200/* Nonzero means polling for input is temporarily suppressed. */ 200/* Nonzero means polling for input is temporarily suppressed. */
201extern int poll_suppress_count; 201extern int poll_suppress_count;
diff --git a/src/lisp.h b/src/lisp.h
index a3c4d48b49c..85838d111db 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -964,7 +964,7 @@ struct Lisp_Subr
964 Lisp_Object (*a7) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); 964 Lisp_Object (*a7) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
965 Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); 965 Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
966 Lisp_Object (*aUNEVALLED) (Lisp_Object args); 966 Lisp_Object (*aUNEVALLED) (Lisp_Object args);
967 Lisp_Object (*aMANY) (int, Lisp_Object *); 967 Lisp_Object (*aMANY) (size_t, Lisp_Object *);
968 } function; 968 } function;
969 short min_args, max_args; 969 short min_args, max_args;
970 const char *symbol_name; 970 const char *symbol_name;
@@ -1809,7 +1809,7 @@ typedef struct {
1809 1809
1810/* Note that the weird token-substitution semantics of ANSI C makes 1810/* Note that the weird token-substitution semantics of ANSI C makes
1811 this work for MANY and UNEVALLED. */ 1811 this work for MANY and UNEVALLED. */
1812#define DEFUN_ARGS_MANY (int, Lisp_Object *) 1812#define DEFUN_ARGS_MANY (size_t, Lisp_Object *)
1813#define DEFUN_ARGS_UNEVALLED (Lisp_Object) 1813#define DEFUN_ARGS_UNEVALLED (Lisp_Object)
1814#define DEFUN_ARGS_0 (void) 1814#define DEFUN_ARGS_0 (void)
1815#define DEFUN_ARGS_1 (Lisp_Object) 1815#define DEFUN_ARGS_1 (Lisp_Object)
@@ -2079,7 +2079,7 @@ struct gcpro
2079 volatile Lisp_Object *var; 2079 volatile Lisp_Object *var;
2080 2080
2081 /* Number of consecutive protected variables. */ 2081 /* Number of consecutive protected variables. */
2082 int nvars; 2082 size_t nvars;
2083 2083
2084#ifdef DEBUG_GCPRO 2084#ifdef DEBUG_GCPRO
2085 int level; 2085 int level;
@@ -2830,9 +2830,9 @@ EXFUN (Frun_hooks, MANY);
2830EXFUN (Frun_hook_with_args, MANY); 2830EXFUN (Frun_hook_with_args, MANY);
2831EXFUN (Frun_hook_with_args_until_failure, MANY); 2831EXFUN (Frun_hook_with_args_until_failure, MANY);
2832extern void run_hook_with_args_2 (Lisp_Object, Lisp_Object, Lisp_Object); 2832extern void run_hook_with_args_2 (Lisp_Object, Lisp_Object, Lisp_Object);
2833extern Lisp_Object run_hook_with_args (int nargs, Lisp_Object *args, 2833extern Lisp_Object run_hook_with_args (size_t nargs, Lisp_Object *args,
2834 Lisp_Object (*funcall) 2834 Lisp_Object (*funcall)
2835 (int nargs, Lisp_Object *args)); 2835 (size_t nargs, Lisp_Object *args));
2836EXFUN (Fprogn, UNEVALLED); 2836EXFUN (Fprogn, UNEVALLED);
2837EXFUN (Finteractive_p, 0); 2837EXFUN (Finteractive_p, 0);
2838EXFUN (Fthrow, 2) NO_RETURN; 2838EXFUN (Fthrow, 2) NO_RETURN;
@@ -2863,7 +2863,7 @@ extern Lisp_Object internal_lisp_condition_case (Lisp_Object, Lisp_Object, Lisp_
2863extern Lisp_Object internal_condition_case (Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)); 2863extern Lisp_Object internal_condition_case (Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object));
2864extern Lisp_Object internal_condition_case_1 (Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); 2864extern Lisp_Object internal_condition_case_1 (Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object));
2865extern Lisp_Object internal_condition_case_2 (Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); 2865extern Lisp_Object internal_condition_case_2 (Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object));
2866extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)); 2866extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (size_t, Lisp_Object *), size_t, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object));
2867extern void specbind (Lisp_Object, Lisp_Object); 2867extern void specbind (Lisp_Object, Lisp_Object);
2868extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); 2868extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object);
2869extern Lisp_Object unbind_to (int, Lisp_Object); 2869extern Lisp_Object unbind_to (int, Lisp_Object);
@@ -2873,7 +2873,7 @@ extern void do_autoload (Lisp_Object, Lisp_Object);
2873extern Lisp_Object un_autoload (Lisp_Object); 2873extern Lisp_Object un_autoload (Lisp_Object);
2874EXFUN (Ffetch_bytecode, 1); 2874EXFUN (Ffetch_bytecode, 1);
2875extern void init_eval_once (void); 2875extern void init_eval_once (void);
2876extern Lisp_Object safe_call (int, Lisp_Object *); 2876extern Lisp_Object safe_call (size_t, Lisp_Object *);
2877extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); 2877extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
2878extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); 2878extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
2879extern void init_eval (void); 2879extern void init_eval (void);
diff --git a/src/menu.c b/src/menu.c
index 851f1ac804b..a9098deed7e 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -662,13 +662,12 @@ digest_single_submenu (int start, int end, int top_level_items)
662 else if (EQ (XVECTOR (menu_items)->contents[i], Qt)) 662 else if (EQ (XVECTOR (menu_items)->contents[i], Qt))
663 { 663 {
664 /* Create a new pane. */ 664 /* Create a new pane. */
665 Lisp_Object pane_name, prefix; 665 Lisp_Object pane_name;
666 const char *pane_string; 666 const char *pane_string;
667 667
668 panes_seen++; 668 panes_seen++;
669 669
670 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; 670 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
671 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
672 671
673#ifdef HAVE_NTGUI 672#ifdef HAVE_NTGUI
674 if (STRINGP (pane_name)) 673 if (STRINGP (pane_name))
diff --git a/src/process.c b/src/process.c
index 148f5b59f8a..1abfbd3f2a4 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1512,11 +1512,11 @@ the command through a shell and redirect one of them using the shell
1512syntax. 1512syntax.
1513 1513
1514usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) 1514usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1515 (int nargs, register Lisp_Object *args) 1515 (size_t nargs, register Lisp_Object *args)
1516{ 1516{
1517 Lisp_Object buffer, name, program, proc, current_dir, tem; 1517 Lisp_Object buffer, name, program, proc, current_dir, tem;
1518 register unsigned char **new_argv; 1518 register unsigned char **new_argv;
1519 register int i; 1519 register size_t i;
1520 int count = SPECPDL_INDEX (); 1520 int count = SPECPDL_INDEX ();
1521 1521
1522 buffer = args[1]; 1522 buffer = args[1];
@@ -1722,7 +1722,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1722 new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); 1722 new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *));
1723 new_argv[nargs - 2] = 0; 1723 new_argv[nargs - 2] = 0;
1724 1724
1725 for (i = nargs - 3; i >= 0; i--) 1725 for (i = nargs - 2; i-- != 0; )
1726 { 1726 {
1727 new_argv[i] = SDATA (XCAR (tem)); 1727 new_argv[i] = SDATA (XCAR (tem));
1728 tem = XCDR (tem); 1728 tem = XCDR (tem);
@@ -2681,7 +2681,7 @@ Examples:
2681\(serial-process-configure :port "\\\\.\\COM13" :bytesize 7) 2681\(serial-process-configure :port "\\\\.\\COM13" :bytesize 7)
2682 2682
2683usage: (serial-process-configure &rest ARGS) */) 2683usage: (serial-process-configure &rest ARGS) */)
2684 (int nargs, Lisp_Object *args) 2684 (size_t nargs, Lisp_Object *args)
2685{ 2685{
2686 struct Lisp_Process *p; 2686 struct Lisp_Process *p;
2687 Lisp_Object contact = Qnil; 2687 Lisp_Object contact = Qnil;
@@ -2799,7 +2799,7 @@ Examples:
2799\(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil) 2799\(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil)
2800 2800
2801usage: (make-serial-process &rest ARGS) */) 2801usage: (make-serial-process &rest ARGS) */)
2802 (int nargs, Lisp_Object *args) 2802 (size_t nargs, Lisp_Object *args)
2803{ 2803{
2804 int fd = -1; 2804 int fd = -1;
2805 Lisp_Object proc, contact, port; 2805 Lisp_Object proc, contact, port;
@@ -3077,7 +3077,7 @@ The original argument list, modified with the actual connection
3077information, is available via the `process-contact' function. 3077information, is available via the `process-contact' function.
3078 3078
3079usage: (make-network-process &rest ARGS) */) 3079usage: (make-network-process &rest ARGS) */)
3080 (int nargs, Lisp_Object *args) 3080 (size_t nargs, Lisp_Object *args)
3081{ 3081{
3082 Lisp_Object proc; 3082 Lisp_Object proc;
3083 Lisp_Object contact; 3083 Lisp_Object contact;
@@ -3393,7 +3393,8 @@ usage: (make-network-process &rest ARGS) */)
3393 3393
3394 for (lres = res; lres; lres = lres->ai_next) 3394 for (lres = res; lres; lres = lres->ai_next)
3395 { 3395 {
3396 int optn, optbits; 3396 size_t optn;
3397 int optbits;
3397 3398
3398#ifdef WINDOWSNT 3399#ifdef WINDOWSNT
3399 retry_connect: 3400 retry_connect:
diff --git a/src/syntax.c b/src/syntax.c
index c1442c396c1..0a1525b54ea 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3265,9 +3265,9 @@ do { prev_from = from; \
3265 = (curlevel == levelstart) ? -1 : (curlevel - 1)->last; 3265 = (curlevel == levelstart) ? -1 : (curlevel - 1)->last;
3266 state.location = from; 3266 state.location = from;
3267 state.levelstarts = Qnil; 3267 state.levelstarts = Qnil;
3268 while (--curlevel >= levelstart) 3268 while (curlevel > levelstart)
3269 state.levelstarts = Fcons (make_number (curlevel->last), 3269 state.levelstarts = Fcons (make_number ((--curlevel)->last),
3270 state.levelstarts); 3270 state.levelstarts);
3271 immediate_quit = 0; 3271 immediate_quit = 0;
3272 3272
3273 *stateptr = state; 3273 *stateptr = state;
diff --git a/src/term.c b/src/term.c
index b3392df76fd..fc7726298c5 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1952,7 +1952,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1952 1952
1953 it->pixel_width = len; 1953 it->pixel_width = len;
1954 it->nglyphs = len; 1954 it->nglyphs = len;
1955 if (len > 0 && it->glyph_row) 1955 if (it->glyph_row)
1956 append_glyphless_glyph (it, face_id, str); 1956 append_glyphless_glyph (it, face_id, str);
1957} 1957}
1958 1958
diff --git a/src/unexelf.c b/src/unexelf.c
index b58c78501b8..8b45894f853 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -651,7 +651,9 @@ unexec (const char *new_name, const char *old_name)
651 int n, nn; 651 int n, nn;
652 int old_bss_index, old_sbss_index, old_plt_index; 652 int old_bss_index, old_sbss_index, old_plt_index;
653 int old_data_index, new_data2_index; 653 int old_data_index, new_data2_index;
654#if defined _SYSTYPE_SYSV || defined __sgi
654 int old_mdebug_index; 655 int old_mdebug_index;
656#endif
655 struct stat stat_buf; 657 struct stat stat_buf;
656 int old_file_size; 658 int old_file_size;
657 659
@@ -695,8 +697,10 @@ unexec (const char *new_name, const char *old_name)
695 697
696 /* Find the mdebug section, if any. */ 698 /* Find the mdebug section, if any. */
697 699
700#if defined _SYSTYPE_SYSV || defined __sgi
698 old_mdebug_index = find_section (".mdebug", old_section_names, 701 old_mdebug_index = find_section (".mdebug", old_section_names,
699 old_name, old_file_h, old_section_h, 1); 702 old_name, old_file_h, old_section_h, 1);
703#endif
700 704
701 /* Find the old .bss section. Figure out parameters of the new 705 /* Find the old .bss section. Figure out parameters of the new
702 data2 and bss sections. */ 706 data2 and bss sections. */
diff --git a/src/window.c b/src/window.c
index 9ab9fab2c13..b7747b5ad79 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2978,14 +2978,10 @@ shrink_windows (int total, int size, int nchildren, int shrinkable,
2978 while (total_shrink > total_removed) 2978 while (total_shrink > total_removed)
2979 { 2979 {
2980 int nonzero_sizes = 0; 2980 int nonzero_sizes = 0;
2981 int nonzero_idx = -1;
2982 2981
2983 for (i = 0; i < nchildren; ++i) 2982 for (i = 0; i < nchildren; ++i)
2984 if (new_sizes[i] > 0) 2983 if (new_sizes[i] > 0)
2985 { 2984 ++nonzero_sizes;
2986 ++nonzero_sizes;
2987 nonzero_idx = i;
2988 }
2989 2985
2990 for (i = 0; i < nchildren; ++i) 2986 for (i = 0; i < nchildren; ++i)
2991 if (new_sizes[i] > min_sizes[i]) 2987 if (new_sizes[i] > min_sizes[i])
diff --git a/src/xdisp.c b/src/xdisp.c
index 308588101e2..bbbf37b68ac 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2180,7 +2180,7 @@ safe_eval_handler (Lisp_Object arg)
2180 redisplay during the evaluation. */ 2180 redisplay during the evaluation. */
2181 2181
2182Lisp_Object 2182Lisp_Object
2183safe_call (int nargs, Lisp_Object *args) 2183safe_call (size_t nargs, Lisp_Object *args)
2184{ 2184{
2185 Lisp_Object val; 2185 Lisp_Object val;
2186 2186
@@ -14638,8 +14638,6 @@ try_window_reusing_current_matrix (struct window *w)
14638 14638
14639 if (CHARPOS (new_start) <= CHARPOS (start)) 14639 if (CHARPOS (new_start) <= CHARPOS (start))
14640 { 14640 {
14641 int first_row_y;
14642
14643 /* Don't use this method if the display starts with an ellipsis 14641 /* Don't use this method if the display starts with an ellipsis
14644 displayed for invisible text. It's not easy to handle that case 14642 displayed for invisible text. It's not easy to handle that case
14645 below, and it's certainly not worth the effort since this is 14643 below, and it's certainly not worth the effort since this is
@@ -14654,7 +14652,6 @@ try_window_reusing_current_matrix (struct window *w)
14654 text. Note that it.vpos == 0 if or if not there is a 14652 text. Note that it.vpos == 0 if or if not there is a
14655 header-line; it's not the same as the MATRIX_ROW_VPOS! */ 14653 header-line; it's not the same as the MATRIX_ROW_VPOS! */
14656 start_display (&it, w, new_start); 14654 start_display (&it, w, new_start);
14657 first_row_y = it.current_y;
14658 w->cursor.vpos = -1; 14655 w->cursor.vpos = -1;
14659 last_text_row = last_reused_text_row = NULL; 14656 last_text_row = last_reused_text_row = NULL;
14660 14657
@@ -16383,7 +16380,7 @@ With ARG, turn tracing on if and only if ARG is positive. */)
16383DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "", 16380DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "",
16384 doc: /* Like `format', but print result to stderr. 16381 doc: /* Like `format', but print result to stderr.
16385usage: (trace-to-stderr STRING &rest OBJECTS) */) 16382usage: (trace-to-stderr STRING &rest OBJECTS) */)
16386 (int nargs, Lisp_Object *args) 16383 (size_t nargs, Lisp_Object *args)
16387{ 16384{
16388 Lisp_Object s = Fformat (nargs, args); 16385 Lisp_Object s = Fformat (nargs, args);
16389 fprintf (stderr, "%s", SDATA (s)); 16386 fprintf (stderr, "%s", SDATA (s));
@@ -22751,7 +22748,6 @@ x_produce_glyphs (struct it *it)
22751 int ch = COMPOSITION_GLYPH (cmp, i); 22748 int ch = COMPOSITION_GLYPH (cmp, i);
22752 int face_id; 22749 int face_id;
22753 struct face *this_face; 22750 struct face *this_face;
22754 int this_boff;
22755 22751
22756 if (ch == '\t') 22752 if (ch == '\t')
22757 ch = ' '; 22753 ch = ' ';
@@ -22763,9 +22759,6 @@ x_produce_glyphs (struct it *it)
22763 pcm = NULL; 22759 pcm = NULL;
22764 else 22760 else
22765 { 22761 {
22766 this_boff = font->baseline_offset;
22767 if (font->vertical_centering)
22768 this_boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
22769 get_char_face_and_encoding (it->f, ch, face_id, 22762 get_char_face_and_encoding (it->f, ch, face_id,
22770 &char2b, it->multibyte_p, 0); 22763 &char2b, it->multibyte_p, 0);
22771 pcm = get_per_char_metric (it->f, font, &char2b); 22764 pcm = get_per_char_metric (it->f, font, &char2b);
@@ -24968,10 +24961,9 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
24968 CONSP (hotspot)) 24961 CONSP (hotspot))
24969 && (hotspot = XCDR (hotspot), CONSP (hotspot))) 24962 && (hotspot = XCDR (hotspot), CONSP (hotspot)))
24970 { 24963 {
24971 Lisp_Object area_id, plist; 24964 Lisp_Object plist;
24972 24965
24973 area_id = XCAR (hotspot); 24966 /* Could check XCAR (hotspot) to see if we enter/leave this hot-spot.
24974 /* Could check AREA_ID to see if we enter/leave this hot-spot.
24975 If so, we could look for mouse-enter, mouse-leave 24967 If so, we could look for mouse-enter, mouse-leave
24976 properties in PLIST (and do something...). */ 24968 properties in PLIST (and do something...). */
24977 hotspot = XCDR (hotspot); 24969 hotspot = XCDR (hotspot);
@@ -25306,10 +25298,10 @@ note_mouse_highlight (struct frame *f, int x, int y)
25306 CONSP (hotspot)) 25298 CONSP (hotspot))
25307 && (hotspot = XCDR (hotspot), CONSP (hotspot))) 25299 && (hotspot = XCDR (hotspot), CONSP (hotspot)))
25308 { 25300 {
25309 Lisp_Object area_id, plist; 25301 Lisp_Object plist;
25310 25302
25311 area_id = XCAR (hotspot); 25303 /* Could check XCAR (hotspot) to see if we enter/leave
25312 /* Could check AREA_ID to see if we enter/leave this hot-spot. 25304 this hot-spot.
25313 If so, we could look for mouse-enter, mouse-leave 25305 If so, we could look for mouse-enter, mouse-leave
25314 properties in PLIST (and do something...). */ 25306 properties in PLIST (and do something...). */
25315 hotspot = XCDR (hotspot); 25307 hotspot = XCDR (hotspot);
diff --git a/src/xselect.c b/src/xselect.c
index 5254fa96838..451b2a0b13f 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2190,7 +2190,8 @@ and t is the same as `SECONDARY'. */)
2190***********************************************************************/ 2190***********************************************************************/
2191/* Check that lisp values are of correct type for x_fill_property_data. 2191/* Check that lisp values are of correct type for x_fill_property_data.
2192 That is, number, string or a cons with two numbers (low and high 16 2192 That is, number, string or a cons with two numbers (low and high 16
2193 bit parts of a 32 bit number). */ 2193 bit parts of a 32 bit number). Return the number of items in DATA,
2194 or -1 if there is an error. */
2194 2195
2195int 2196int
2196x_check_property_data (Lisp_Object data) 2197x_check_property_data (Lisp_Object data)
@@ -2198,15 +2199,16 @@ x_check_property_data (Lisp_Object data)
2198 Lisp_Object iter; 2199 Lisp_Object iter;
2199 int size = 0; 2200 int size = 0;
2200 2201
2201 for (iter = data; CONSP (iter) && size != -1; iter = XCDR (iter), ++size) 2202 for (iter = data; CONSP (iter); iter = XCDR (iter))
2202 { 2203 {
2203 Lisp_Object o = XCAR (iter); 2204 Lisp_Object o = XCAR (iter);
2204 2205
2205 if (! NUMBERP (o) && ! STRINGP (o) && ! CONSP (o)) 2206 if (! NUMBERP (o) && ! STRINGP (o) && ! CONSP (o))
2206 size = -1; 2207 return -1;
2207 else if (CONSP (o) && 2208 else if (CONSP (o) &&
2208 (! NUMBERP (XCAR (o)) || ! NUMBERP (XCDR (o)))) 2209 (! NUMBERP (XCAR (o)) || ! NUMBERP (XCDR (o))))
2209 size = -1; 2210 return -1;
2211 size++;
2210 } 2212 }
2211 2213
2212 return size; 2214 return size;
diff --git a/src/xterm.c b/src/xterm.c
index 0b18356b0a3..dc1fd3cbbd1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9121,7 +9121,7 @@ x_make_frame_visible (struct frame *f)
9121 unknown reason, the call to XtMapWidget is completely ignored. 9121 unknown reason, the call to XtMapWidget is completely ignored.
9122 Mapping the widget a second time works. */ 9122 Mapping the widget a second time works. */
9123 9123
9124 if (!FRAME_VISIBLE_P (f) && --retry_count > 0) 9124 if (!FRAME_VISIBLE_P (f) && --retry_count != 0)
9125 goto retry; 9125 goto retry;
9126 } 9126 }
9127} 9127}
@@ -9726,7 +9726,7 @@ same_x_server (const char *name1, const char *name2)
9726 for (; *name1 != '\0' && *name1 == *name2; name1++, name2++) 9726 for (; *name1 != '\0' && *name1 == *name2; name1++, name2++)
9727 { 9727 {
9728 if (*name1 == ':') 9728 if (*name1 == ':')
9729 seen_colon++; 9729 seen_colon = 1;
9730 if (seen_colon && *name1 == '.') 9730 if (seen_colon && *name1 == '.')
9731 return 1; 9731 return 1;
9732 } 9732 }