1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

Parenthesize and type SCM_FRAME' macros; check layout of scm_vm_frame'.

* libguile/frames.c: Add compile-time assertions on the layout of
  `struct scm_vm_frame'.
  (RELOC): Parenthesize and type VAL.

* libguile/frames.h (SCM_FRAME_STRUCT): Write in terms of
  `SCM_FRAME_DATA_ADDRESS'.
  (SCM_FRAME_DATA_ADDRESS): Parenthesize and type FP.
  (SCM_FRAME_SET_DYNAMIC_LINK): Write in terms of
  `SCM_FRAME_DYNAMIC_LINK'.

* libguile/vm.c (RELOC): Parenthesize and type SCM_P.
This commit is contained in:
Ludovic Courtès 2012-01-22 23:20:50 +01:00
parent 17cc6e40a9
commit 0fc9040fa2
3 changed files with 16 additions and 7 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
/* Copyright (C) 2001, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -24,9 +24,16 @@
#include <string.h>
#include "_scm.h"
#include "frames.h"
#include <verify.h>
/* Make sure assumptions on the layout of `struct scm_vm_frame' hold. */
verify (sizeof (SCM) == sizeof (SCM *));
verify (sizeof (struct scm_vm_frame) == 5 * sizeof (SCM));
verify (offsetof (struct scm_vm_frame, dynamic_link) == 0);
#define RELOC(frame, val) (val + SCM_VM_FRAME_OFFSET (frame))
#define RELOC(frame, val) \
(((SCM *) (val)) + SCM_VM_FRAME_OFFSET (frame))
SCM
scm_c_make_frame (SCM stack_holder, SCM *fp, SCM *sp,