summaryrefslogtreecommitdiff
path: root/libguile/struct.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-08-12 17:45:03 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-08-12 17:45:03 +0000
commit8824ac88f08cffc954a907b85858ccd5b3c9843f (patch)
treec96fa1d142124eaf6f030adbc4ec2eb040b612b0 /libguile/struct.c
parent70f7ee4188c0a752154d8cc63daf5a99ba89951f (diff)
downloadguile-8824ac88f08cffc954a907b85858ccd5b3c9843f.tar.gz
* socket.c, rw.c, deprecated.h, validate.h
(SCM_VALIDATE_STRING_COPY): Deprecated. Replaced all uses with SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or scm_to_locale_string, etc. (SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated. Replaced as above, plus scm_i_get_substring_spec. * regex-posix.c, read.c, random.c, ramap.c, print.c, numbers.c, hash.c, gc.c, gc-card.c, convert.i.c, backtrace.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, ports.c: Use SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS, SCM_STRING_UCHARS, and SCM_STRING_LENGTH, respectively. Also, replaced scm_return_first with more explicit scm_remember_upto_here_1, etc, or introduced them in the first place.
Diffstat (limited to 'libguile/struct.c')
-rw-r--r--libguile/struct.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libguile/struct.c b/libguile/struct.c
index dac3ae5ab..efb17d3a4 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -63,12 +63,12 @@ SCM_DEFINE (scm_make_struct_layout, "make-struct-layout", 1, 0, 0,
size_t len;
int x;
- len = SCM_STRING_LENGTH (fields);
+ len = SCM_I_STRING_LENGTH (fields);
if (len % 2 == 1)
SCM_MISC_ERROR ("odd length field specification: ~S",
scm_list_1 (fields));
- field_desc = SCM_STRING_CHARS (fields);
+ field_desc = SCM_I_STRING_CHARS (fields);
for (x = 0; x < len; x += 2)
{
@@ -122,7 +122,8 @@ SCM_DEFINE (scm_make_struct_layout, "make-struct-layout", 1, 0, 0,
}
new_sym = scm_mem2symbol (field_desc, len);
}
- return scm_return_first (new_sym, fields);
+ scm_remember_upto_here_1 (fields);
+ return new_sym;
}
#undef FUNC_NAME
@@ -231,17 +232,22 @@ SCM_DEFINE (scm_struct_vtable_p, "struct-vtable?", 1, 0, 0,
{
SCM layout;
scm_t_bits * mem;
+ int tmp;
if (!SCM_STRUCTP (x))
return SCM_BOOL_F;
layout = SCM_STRUCT_LAYOUT (x);
- if (SCM_SYMBOL_LENGTH (layout) < SCM_STRING_LENGTH (required_vtable_fields))
+ if (SCM_SYMBOL_LENGTH (layout)
+ < SCM_I_STRING_LENGTH (required_vtable_fields))
return SCM_BOOL_F;
- if (strncmp (SCM_SYMBOL_CHARS (layout), SCM_STRING_CHARS (required_vtable_fields),
- SCM_STRING_LENGTH (required_vtable_fields)))
+ tmp = strncmp (SCM_SYMBOL_CHARS (layout),
+ SCM_I_STRING_CHARS (required_vtable_fields),
+ SCM_I_STRING_LENGTH (required_vtable_fields));
+ scm_remember_upto_here_1 (required_vtable_fields);
+ if (tmp)
return SCM_BOOL_F;
mem = SCM_STRUCT_DATA (x);