/[emacs]/emacs/src/eval.c
ViewVC logotype

Diff of /emacs/src/eval.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.204 by monnier, Thu Apr 17 22:25:43 2003 UTC revision 1.205 by monnier, Sat Apr 19 18:58:56 2003 UTC
# Line 2161  usage: (apply FUNCTION &rest ARGUMENTS) Line 2161  usage: (apply FUNCTION &rest ARGUMENTS)
2161    register Lisp_Object spread_arg;    register Lisp_Object spread_arg;
2162    register Lisp_Object *funcall_args;    register Lisp_Object *funcall_args;
2163    Lisp_Object fun;    Lisp_Object fun;
2164    int nvars;    struct gcpro gcpro1;
2165    
2166    fun = args [0];    fun = args [0];
2167    funcall_args = 0;    funcall_args = 0;
# Line 2201  usage: (apply FUNCTION &rest ARGUMENTS) Line 2201  usage: (apply FUNCTION &rest ARGUMENTS)
2201                                                   * sizeof (Lisp_Object));                                                   * sizeof (Lisp_Object));
2202            for (i = numargs; i < XSUBR (fun)->max_args;)            for (i = numargs; i < XSUBR (fun)->max_args;)
2203              funcall_args[++i] = Qnil;              funcall_args[++i] = Qnil;
2204            nvars = 1 + XSUBR (fun)->max_args;            GCPRO1 (*funcall_args);
2205              gcpro1.nvars = 1 + XSUBR (fun)->max_args;
2206          }          }
2207      }      }
2208   funcall:   funcall:
# Line 2211  usage: (apply FUNCTION &rest ARGUMENTS) Line 2212  usage: (apply FUNCTION &rest ARGUMENTS)
2212      {      {
2213        funcall_args = (Lisp_Object *) alloca ((1 + numargs)        funcall_args = (Lisp_Object *) alloca ((1 + numargs)
2214                                               * sizeof (Lisp_Object));                                               * sizeof (Lisp_Object));
2215        nvars = 1 + numargs;        GCPRO1 (*funcall_args);
2216          gcpro1.nvars = 1 + numargs;
2217      }      }
2218    
2219    bcopy (args, funcall_args, nargs * sizeof (Lisp_Object));    bcopy (args, funcall_args, nargs * sizeof (Lisp_Object));
# Line 2224  usage: (apply FUNCTION &rest ARGUMENTS) Line 2226  usage: (apply FUNCTION &rest ARGUMENTS)
2226        spread_arg = XCDR (spread_arg);        spread_arg = XCDR (spread_arg);
2227      }      }
2228    
2229    return Ffuncall (nvars, funcall_args);    /* By convention, the caller needs to gcpro Ffuncall's args.  */
2230      RETURN_UNGCPRO (Ffuncall (gcpro1.nvars, funcall_args));
2231  }  }
2232    
2233  /* Run hook variables in various ways.  */  /* Run hook variables in various ways.  */

Legend:
Removed from v.1.204  
changed lines
  Added in v.1.205

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26