From 456d544b1f6742dc444293d08f86251a61c1f4aa Mon Sep 17 00:00:00 2001 From: Rob Awles Date: Mon, 22 Dec 2003 19:28:08 +0000 Subject: [PATCH] Modified STATIC_INIT to accept a statically declared variable. This commit was SVN r10. --- src/lam/lfc/array.c | 1 + src/lam/lfc/object.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lam/lfc/array.c b/src/lam/lfc/array.c index 942479a253..2a75e6039a 100644 --- a/src/lam/lfc/array.c +++ b/src/lam/lfc/array.c @@ -27,6 +27,7 @@ * GNU Lesser General Public License for more details. */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ +#include #include "lam/base/array.h" lam_class_info_t array_cls = {"lam_array_t", &object_cls, diff --git a/src/lam/lfc/object.h b/src/lam/lfc/object.h index 0c431b1514..8f1d0117d2 100644 --- a/src/lam/lfc/object.h +++ b/src/lam/lfc/object.h @@ -84,8 +84,8 @@ extern lam_class_info_t object_cls; dynamically allocated. */ #define STATIC_INIT(obj, cls_ptr) \ do { \ - OBJECT(obj)->obj_class = cls_ptr; \ - OBJECT(obj)->obj_class->cls_init(obj); \ + OBJECT(&(obj))->obj_class = cls_ptr; \ + OBJECT(&(obj))->obj_class->cls_init(OBJECT(&(obj))); \ } while (0) /* super_cls should be the pointer to the obj's parent