From 1fdbd49dca572d670bce4b0e0caa285932be9ca3 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 21 Feb 2010 23:13:31 -0800 Subject: [PATCH] specialized-arrays: fix underlying-type so it always returns void* for pointer types --- basis/specialized-arrays/specialized-arrays.factor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/basis/specialized-arrays/specialized-arrays.factor b/basis/specialized-arrays/specialized-arrays.factor index 992dbac6d6..97ce2ed1ff 100644 --- a/basis/specialized-arrays/specialized-arrays.factor +++ b/basis/specialized-arrays/specialized-arrays.factor @@ -116,7 +116,8 @@ M: A v*high [ * \ T heap-size neg shift ] 2map ; inline ;FUNCTOR -: underlying-type ( c-type -- c-type' ) +GENERIC: underlying-type ( c-type -- c-type' ) +M: c-type-word underlying-type dup "c-type" word-prop { { [ dup not ] [ drop no-c-type ] } { [ dup pointer? ] [ 2drop void* ] } @@ -124,6 +125,9 @@ M: A v*high [ * \ T heap-size neg shift ] 2map ; inline [ drop ] } cond ; +M: pointer underlying-type + drop void* ; + : specialized-array-vocab ( c-type -- vocab ) [ "specialized-arrays.instances." %