aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog5
-rw-r--r--src/callint.c35
2 files changed, 22 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c8811f7708b..86dec69e094 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
12011-04-09 Paul Eggert <eggert@cs.ucla.edu> 12011-04-09 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * callint.c (Fcall_interactively): <, not <=, for optimization.
4 (Fcall_interactively): Count the number of arguments produced,
5 not the number of arguments given. This is simpler and lets GCC
6 4.6.0 generate slightly better code.
7
3 * ftfont.c: Distingish more carefully between FcChar8 and char. 8 * ftfont.c: Distingish more carefully between FcChar8 and char.
4 The previous code passed unsigned char * to a functions like 9 The previous code passed unsigned char * to a functions like
5 strlen and xstrcasecmp that expect char *, which does not 10 strlen and xstrcasecmp that expect char *, which does not
diff --git a/src/callint.c b/src/callint.c
index 60570369d9e..047fbcdb467 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -269,8 +269,8 @@ invoke it. If KEYS is omitted or nil, the return value of
269 recorded as a call to the function named callint_argfuns[varies[i]]. */ 269 recorded as a call to the function named callint_argfuns[varies[i]]. */
270 int *varies; 270 int *varies;
271 271
272 register size_t i, j; 272 register size_t i;
273 size_t count; 273 size_t nargs;
274 int foo; 274 int foo;
275 char prompt1[100]; 275 char prompt1[100];
276 char *tem1; 276 char *tem1;
@@ -445,30 +445,29 @@ invoke it. If KEYS is omitted or nil, the return value of
445 else break; 445 else break;
446 } 446 }
447 447
448 /* Count the number of arguments the interactive spec would have 448 /* Count the number of arguments, which is one plus the number of arguments
449 us give to the function. */ 449 the interactive spec would have us give to the function. */
450 tem = string; 450 tem = string;
451 for (j = 0; *tem;) 451 for (nargs = 1; *tem; )
452 { 452 {
453 /* 'r' specifications ("point and mark as 2 numeric args") 453 /* 'r' specifications ("point and mark as 2 numeric args")
454 produce *two* arguments. */ 454 produce *two* arguments. */
455 if (*tem == 'r') 455 if (*tem == 'r')
456 j += 2; 456 nargs += 2;
457 else 457 else
458 j++; 458 nargs++;
459 tem = strchr (tem, '\n'); 459 tem = strchr (tem, '\n');
460 if (tem) 460 if (tem)
461 ++tem; 461 ++tem;
462 else 462 else
463 break; 463 break;
464 } 464 }
465 count = j;
466 465
467 args = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object)); 466 args = (Lisp_Object *) alloca (nargs * sizeof (Lisp_Object));
468 visargs = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object)); 467 visargs = (Lisp_Object *) alloca (nargs * sizeof (Lisp_Object));
469 varies = (int *) alloca ((count + 1) * sizeof (int)); 468 varies = (int *) alloca (nargs * sizeof (int));
470 469
471 for (i = 0; i < (count + 1); i++) 470 for (i = 0; i < nargs; i++)
472 { 471 {
473 args[i] = Qnil; 472 args[i] = Qnil;
474 visargs[i] = Qnil; 473 visargs[i] = Qnil;
@@ -476,8 +475,8 @@ invoke it. If KEYS is omitted or nil, the return value of
476 } 475 }
477 476
478 GCPRO5 (prefix_arg, function, *args, *visargs, up_event); 477 GCPRO5 (prefix_arg, function, *args, *visargs, up_event);
479 gcpro3.nvars = (count + 1); 478 gcpro3.nvars = nargs;
480 gcpro4.nvars = (count + 1); 479 gcpro4.nvars = nargs;
481 480
482 if (!NILP (enable)) 481 if (!NILP (enable))
483 specbind (Qenable_recursive_minibuffers, Qt); 482 specbind (Qenable_recursive_minibuffers, Qt);
@@ -809,14 +808,14 @@ invoke it. If KEYS is omitted or nil, the return value of
809 if (arg_from_tty || !NILP (record_flag)) 808 if (arg_from_tty || !NILP (record_flag))
810 { 809 {
811 visargs[0] = function; 810 visargs[0] = function;
812 for (i = 1; i < count + 1; i++) 811 for (i = 1; i < nargs; i++)
813 { 812 {
814 if (varies[i] > 0) 813 if (varies[i] > 0)
815 visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil); 814 visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil);
816 else 815 else
817 visargs[i] = quotify_arg (args[i]); 816 visargs[i] = quotify_arg (args[i]);
818 } 817 }
819 Vcommand_history = Fcons (Flist (count + 1, visargs), 818 Vcommand_history = Fcons (Flist (nargs, visargs),
820 Vcommand_history); 819 Vcommand_history);
821 /* Don't keep command history around forever. */ 820 /* Don't keep command history around forever. */
822 if (INTEGERP (Vhistory_length) && XINT (Vhistory_length) > 0) 821 if (INTEGERP (Vhistory_length) && XINT (Vhistory_length) > 0)
@@ -829,7 +828,7 @@ invoke it. If KEYS is omitted or nil, the return value of
829 828
830 /* If we used a marker to hold point, mark, or an end of the region, 829 /* If we used a marker to hold point, mark, or an end of the region,
831 temporarily, convert it to an integer now. */ 830 temporarily, convert it to an integer now. */
832 for (i = 1; i <= count; i++) 831 for (i = 1; i < nargs; i++)
833 if (varies[i] >= 1 && varies[i] <= 4) 832 if (varies[i] >= 1 && varies[i] <= 4)
834 XSETINT (args[i], marker_position (args[i])); 833 XSETINT (args[i], marker_position (args[i]));
835 834
@@ -846,7 +845,7 @@ invoke it. If KEYS is omitted or nil, the return value of
846 specbind (Qcommand_debug_status, Qnil); 845 specbind (Qcommand_debug_status, Qnil);
847 846
848 temporarily_switch_to_single_kboard (NULL); 847 temporarily_switch_to_single_kboard (NULL);
849 val = Ffuncall (count + 1, args); 848 val = Ffuncall (nargs, args);
850 UNGCPRO; 849 UNGCPRO;
851 return unbind_to (speccount, val); 850 return unbind_to (speccount, val);
852 } 851 }