From 2d0bfa1171eaf2bf81fbba086ab9771a5f989b28 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 2 Mar 2006 21:07:01 +0000 Subject: [PATCH] * src/proc.c: store function pointers in typed variables before calling them. git-svn-id: svn://svn.zoy.org/elk/trunk@261 55e467fa-43c5-0310-a8a2-de718669efc6 --- src/proc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/proc.c b/src/proc.c index d49cf85..3fc9a88 100644 --- a/src/proc.c +++ b/src/proc.c @@ -274,11 +274,17 @@ Object Funcall_Primitive (Object fun, Object argl, int eval) { prim = PRIM(fun); /* fun has possibly been moved during gc */ } if (prim->disc == VARARGS) { - r = (prim->fun)(argc, argv); + Object (*varfun) (int, Object *); + varfun = (Object (*) (int, Object *))prim->fun; + r = varfun(argc, argv); } else { switch (argc) { - case 0: - r = (prim->fun)(); break; + case 0: { + Object (*myfun) (void); + myfun = (Object (*) (void))prim->fun; + r = myfun(); + break; + } case 1: TC_Disable; r = eval ? Eval (Car (argl)) : Car (argl);