1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 16:30:19 +02:00

* goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for

slots with instance allocation.
This commit is contained in:
Mikael Djurfeldt 2003-01-08 18:47:31 +00:00
parent 498e468490
commit 37b15e9c00
2 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
slots with instance allocation.
2002-12-15 Rob Browning <rlb@defaultvalue.org> 2002-12-15 Rob Browning <rlb@defaultvalue.org>
* Makefile.am (EXTRA_DIST): add version.h.in to EXTRA_DIST. * Makefile.am (EXTRA_DIST): add version.h.in to EXTRA_DIST.

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1998,1999,2000,2001 Free Software Foundation, Inc. /* Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -473,6 +473,8 @@ SCM_DEFINE (scm_sys_initialize_object, "%initialize-object", 2, 0, 0,
SCM_KEYWORD (k_class, "class"); SCM_KEYWORD (k_class, "class");
SCM_KEYWORD (k_allocation, "allocation");
SCM_KEYWORD (k_instance, "instance");
SCM_DEFINE (scm_sys_prep_layout_x, "%prep-layout!", 1, 0, 0, SCM_DEFINE (scm_sys_prep_layout_x, "%prep-layout!", 1, 0, 0,
(SCM class), (SCM class),
@ -481,7 +483,7 @@ SCM_DEFINE (scm_sys_prep_layout_x, "%prep-layout!", 1, 0, 0,
{ {
long i, n, len; long i, n, len;
char *s, p, a; char *s, p, a;
SCM nfields, slots, type; SCM nfields, slots, type, allocation;
SCM_VALIDATE_INSTANCE (1, class); SCM_VALIDATE_INSTANCE (1, class);
slots = SCM_SLOT (class, scm_si_slots); slots = SCM_SLOT (class, scm_si_slots);
@ -501,8 +503,17 @@ SCM_DEFINE (scm_sys_prep_layout_x, "%prep-layout!", 1, 0, 0,
if (!SCM_CONSP (slots)) if (!SCM_CONSP (slots))
SCM_MISC_ERROR ("to few slot definitions", SCM_EOL); SCM_MISC_ERROR ("to few slot definitions", SCM_EOL);
len = scm_ilength (SCM_CDAR (slots)); len = scm_ilength (SCM_CDAR (slots));
type = scm_i_get_keyword (k_class, SCM_CDAR (slots), len, SCM_BOOL_F, allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots),
FUNC_NAME); len, k_instance, FUNC_NAME);
while (!SCM_EQ_P (allocation, k_instance))
{
slots = SCM_CDR (slots);
len = scm_ilength (SCM_CDAR (slots));
allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots),
len, k_instance, FUNC_NAME);
}
type = scm_i_get_keyword (k_class, SCM_CDAR (slots),
len, SCM_BOOL_F, FUNC_NAME);
if (SCM_NIMP (type) && SCM_SUBCLASSP (type, scm_class_foreign_slot)) if (SCM_NIMP (type) && SCM_SUBCLASSP (type, scm_class_foreign_slot))
{ {
if (SCM_SUBCLASSP (type, scm_class_self)) if (SCM_SUBCLASSP (type, scm_class_self))