comparison src/alloc.c @ 1737:68ed93de81b7

[xemacs-hg @ 2003-10-10 11:50:56 by stephent] E Benson bytecomp patch <87oewpmi1m.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Fri, 10 Oct 2003 11:51:05 +0000
parents a8d8f419b459
children 9ddedfc70c4a
comparison
equal deleted inserted replaced
1736:92dd8587c485 1737:68ed93de81b7
1503 f->flags.interactivep = 0; 1503 f->flags.interactivep = 0;
1504 f->flags.domainp = 0; /* I18N3 */ 1504 f->flags.domainp = 0; /* I18N3 */
1505 f->instructions = Qzero; 1505 f->instructions = Qzero;
1506 f->constants = Qzero; 1506 f->constants = Qzero;
1507 f->arglist = Qnil; 1507 f->arglist = Qnil;
1508 f->args = f->max_args = f->min_args = f->args_in_array = 0;
1508 f->doc_and_interactive = Qnil; 1509 f->doc_and_interactive = Qnil;
1509 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK 1510 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
1510 f->annotated = Qnil; 1511 f->annotated = Qnil;
1511 #endif 1512 #endif
1512 return wrap_compiled_function (f); 1513 return wrap_compiled_function (f);
1557 symbol, arglist); 1558 symbol, arglist);
1558 } 1559 }
1559 } 1560 }
1560 f->arglist = arglist; 1561 f->arglist = arglist;
1561 1562
1562 {
1563 int minargs = 0, maxargs = 0, totalargs = 0;
1564 int optional_p = 0, rest_p = 0, i = 0;
1565 {
1566 LIST_LOOP_2 (arg, arglist)
1567 {
1568 if (EQ (arg, Qand_optional))
1569 optional_p = 1;
1570 else if (EQ (arg, Qand_rest))
1571 rest_p = 1;
1572 else
1573 {
1574 if (rest_p)
1575 {
1576 maxargs = MANY;
1577 totalargs++;
1578 break;
1579 }
1580 if (!optional_p)
1581 minargs++;
1582 maxargs++;
1583 totalargs++;
1584 }
1585 }
1586 }
1587
1588 if (totalargs)
1589 f->args = xnew_array (Lisp_Object, totalargs);
1590
1591 {
1592 LIST_LOOP_2 (arg, arglist)
1593 {
1594 if (!EQ (arg, Qand_optional) && !EQ (arg, Qand_rest))
1595 f->args[i++] = arg;
1596 }
1597 }
1598
1599 f->max_args = maxargs;
1600 f->min_args = minargs;
1601 f->args_in_array = totalargs;
1602 }
1603
1604 /* `instructions' is a string or a cons (string . int) for a 1563 /* `instructions' is a string or a cons (string . int) for a
1605 lazy-loaded function. */ 1564 lazy-loaded function. */
1606 if (CONSP (instructions)) 1565 if (CONSP (instructions))
1607 { 1566 {
1608 CHECK_STRING (XCAR (instructions)); 1567 CHECK_STRING (XCAR (instructions));