[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 11/88: Remove unused %fast-slot-ref / %fast-slot-set! fr
From: |
Andy Wingo |
Subject: |
[Guile-commits] 11/88: Remove unused %fast-slot-ref / %fast-slot-set! from GOOPS |
Date: |
Fri, 23 Jan 2015 15:25:23 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 8906f23dedf2ee2bdef6a4d4b150c4ee3f853af3
Author: Andy Wingo <address@hidden>
Date: Sun Jan 4 13:19:50 2015 -0500
Remove unused %fast-slot-ref / %fast-slot-set! from GOOPS
* libguile/goops.h:
* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x):
Remove these unused, unsafe functions. They were publically available
only to C.
* module/oop/goops/active-slot.scm (compute-get-n-set): Update to use
struct-ref / struct-set! instead of %fast-slot-ref / %fast-slot-set!
from (oop goops internal).
---
libguile/goops.c | 36 ------------------------------------
libguile/goops.h | 2 --
module/oop/goops/active-slot.scm | 10 +++++-----
3 files changed, 5 insertions(+), 43 deletions(-)
diff --git a/libguile/goops.c b/libguile/goops.c
index e12b580..56365ea 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -1169,42 +1169,6 @@ SCM_DEFINE (scm_at_assert_bound_ref,
"@assert-bound-ref", 2, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_sys_fast_slot_ref, "%fast-slot-ref", 2, 0, 0,
- (SCM obj, SCM index),
- "Return the slot value with index @var{index} from @var{obj}.")
-#define FUNC_NAME s_scm_sys_fast_slot_ref
-{
- scm_t_bits i;
-
- SCM_VALIDATE_INSTANCE (1, obj);
- i = scm_to_unsigned_integer (index, 0,
- SCM_I_INUM (SCM_SLOT (SCM_CLASS_OF (obj),
- scm_si_nfields))
- - 1);
- return SCM_SLOT (obj, i);
-}
-#undef FUNC_NAME
-
-SCM_DEFINE (scm_sys_fast_slot_set_x, "%fast-slot-set!", 3, 0, 0,
- (SCM obj, SCM index, SCM value),
- "Set the slot with index @var{index} in @var{obj} to\n"
- "@var{value}.")
-#define FUNC_NAME s_scm_sys_fast_slot_set_x
-{
- scm_t_bits i;
-
- SCM_VALIDATE_INSTANCE (1, obj);
- i = scm_to_unsigned_integer (index, 0,
- SCM_I_INUM (SCM_SLOT (SCM_CLASS_OF (obj),
- scm_si_nfields))
- - 1);
-
- SCM_SET_SLOT (obj, i, value);
-
- return SCM_UNSPECIFIED;
-}
-#undef FUNC_NAME
-
/** Utilities **/
diff --git a/libguile/goops.h b/libguile/goops.h
index 5a9e2f0..b80fa73 100644
--- a/libguile/goops.h
+++ b/libguile/goops.h
@@ -272,8 +272,6 @@ SCM_API SCM scm_generic_function_methods (SCM obj);
SCM_API SCM scm_method_generic_function (SCM obj);
SCM_API SCM scm_method_specializers (SCM obj);
SCM_API SCM scm_method_procedure (SCM obj);
-SCM_API SCM scm_sys_fast_slot_ref (SCM obj, SCM index);
-SCM_API SCM scm_sys_fast_slot_set_x (SCM obj, SCM index, SCM value);
SCM_API SCM scm_slot_ref_using_class (SCM cls, SCM obj, SCM slot_name);
SCM_API SCM scm_slot_set_using_class_x (SCM cls, SCM obj, SCM slot_name, SCM
value);
SCM_API SCM scm_slot_bound_using_class_p (SCM cls, SCM obj, SCM slot_name);
diff --git a/module/oop/goops/active-slot.scm b/module/oop/goops/active-slot.scm
index 4d3bbf7..83517c6 100644
--- a/module/oop/goops/active-slot.scm
+++ b/module/oop/goops/active-slot.scm
@@ -1,6 +1,6 @@
;;; installed-scm-file
-;;;; Copyright (C) 1999, 2001, 2006, 2009 Free Software Foundation, Inc.
+;;;; Copyright (C) 1999, 2001, 2006, 2009, 2015 Free Software Foundation, Inc.
;;;; Copyright (C) 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <address@hidden>
;;;;
;;;; This library is free software; you can redistribute it and/or
@@ -43,11 +43,11 @@
(list (lambda (o)
(if before-ref
(if (before-ref o)
- (let ((res (%fast-slot-ref o index)))
+ (let ((res (struct-ref o index)))
(and after-ref (not (eqv? res unbound)) (after-ref o))
res)
(make-unbound))
- (let ((res (%fast-slot-ref o index)))
+ (let ((res (struct-ref o index)))
(and after-ref (not (eqv? res unbound)) (after-ref o))
res)))
@@ -55,9 +55,9 @@
(if before-set!
(if (before-set! o v)
(begin
- (%fast-slot-set! o index v)
+ (struct-set! o index v)
(and after-set! (after-set! o v))))
(begin
- (%fast-slot-set! o index v)
+ (struct-set! o index v)
(and after-set! (after-set! o v)))))))
(next-method)))
- [Guile-commits] 08/88: compute-cpl implementation only in Scheme, (continued)
- [Guile-commits] 08/88: compute-cpl implementation only in Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 14/88: Deprecate scm_basic_make_class, Andy Wingo, 2015/01/23
- [Guile-commits] 16/88: define-generic, define-extended-generic are hygienic syntax, Andy Wingo, 2015/01/23
- [Guile-commits] 12/88: Remove declarations without definitions, Andy Wingo, 2015/01/23
- [Guile-commits] 17/88: Remove unused *goops-module* definition., Andy Wingo, 2015/01/23
- [Guile-commits] 20/88: Deprecate scm_no_applicable_method C export, Andy Wingo, 2015/01/23
- [Guile-commits] 23/88: Remove unused `default-slot-definition-class' <class> slot, Andy Wingo, 2015/01/23
- [Guile-commits] 24/88: Remove unused CPP defines naming <method> slots, Andy Wingo, 2015/01/23
- [Guile-commits] 15/88: `class' is a hygienic macro, Andy Wingo, 2015/01/23
- [Guile-commits] 22/88: Remove useless scm_s_slot_set_x export, Andy Wingo, 2015/01/23
- [Guile-commits] 11/88: Remove unused %fast-slot-ref / %fast-slot-set! from GOOPS,
Andy Wingo <=
- [Guile-commits] 27/88: Remove hashset slots from GOOPS classes, Andy Wingo, 2015/01/23
- [Guile-commits] 25/88: Generics with setters have <applicable-struct-with-setter> layout, Andy Wingo, 2015/01/23
- [Guile-commits] 13/88: Move GOOPS boot to Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 31/88: More unused code removal in GOOPS, Andy Wingo, 2015/01/23
- [Guile-commits] 29/88: Remove scm_assert_bound, Andy Wingo, 2015/01/23
- [Guile-commits] 19/88: Remove unused scm_t_method and SCM_METHOD, Andy Wingo, 2015/01/23
- [Guile-commits] 32/88: Remove unused union scm_t_debug_info, Andy Wingo, 2015/01/23
- [Guile-commits] 28/88: Remove scm_at_assert_bound_ref, Andy Wingo, 2015/01/23
- [Guile-commits] 33/88: More goops.c cleanups, and fix a security issue, Andy Wingo, 2015/01/23
- [Guile-commits] 34/88: Remove GOOPS random state, Andy Wingo, 2015/01/23