diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-08-28 19:01:19 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-08-28 19:16:46 +0200 |
commit | 7af531508c5931261ff8957708642cac67bf86a5 (patch) | |
tree | bd36d27d9f7a11d954093d4121ccb9e645f5c59f /libguile/deprecated.c | |
parent | f86f3b5b113b4cb383c531150b13bef9b2789221 (diff) | |
parent | ce3ed0125fcfb9ad09da815f133a2320102d164c (diff) | |
download | guile-7af531508c5931261ff8957708642cac67bf86a5.tar.gz |
Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
libguile/Makefile.am
libguile/bytevectors.c
libguile/gc-card.c
libguile/gc-mark.c
libguile/programs.c
libguile/srcprop.c
libguile/srfi-14.c
libguile/symbols.c
libguile/threads.c
libguile/unif.c
libguile/vm.c
Diffstat (limited to 'libguile/deprecated.c')
-rw-r--r-- | libguile/deprecated.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/libguile/deprecated.c b/libguile/deprecated.c index 57a2f0657..6ecef3b4b 100644 --- a/libguile/deprecated.c +++ b/libguile/deprecated.c @@ -34,6 +34,7 @@ #include "libguile/strings.h" #include "libguile/srfi-13.h" #include "libguile/modules.h" +#include "libguile/generalized-arrays.h" #include "libguile/eval.h" #include "libguile/smob.h" #include "libguile/procprop.h" @@ -749,17 +750,13 @@ scm_sym2ovcell (SCM sym, SCM obarray) return (SYMBOL . SCM_UNDEFINED). */ -SCM -scm_intern_obarray_soft (const char *name,size_t len,SCM obarray,unsigned int softness) +static SCM +intern_obarray_soft (SCM symbol, SCM obarray, unsigned int softness) { - SCM symbol = scm_from_locale_symboln (name, len); size_t raw_hash = scm_i_symbol_hash (symbol); size_t hash; SCM lsym; - scm_c_issue_deprecation_warning ("`scm_intern_obarray_soft' is deprecated. " - "Use hashtables instead."); - if (scm_is_false (obarray)) { if (softness) @@ -795,6 +792,18 @@ scm_intern_obarray_soft (const char *name,size_t len,SCM obarray,unsigned int so } +SCM +scm_intern_obarray_soft (const char *name, size_t len, SCM obarray, + unsigned int softness) +{ + SCM symbol = scm_from_locale_symboln (name, len); + + scm_c_issue_deprecation_warning ("`scm_intern_obarray_soft' is deprecated. " + "Use hashtables instead."); + + return intern_obarray_soft (symbol, obarray, softness); +} + SCM scm_intern_obarray (const char *name,size_t len,SCM obarray) { @@ -850,10 +859,7 @@ SCM_DEFINE (scm_string_to_obarray_symbol, "string->obarray-symbol", 2, 1, 0, else if (scm_is_eq (o, SCM_BOOL_T)) o = SCM_BOOL_F; - vcell = scm_intern_obarray_soft (scm_i_string_chars (s), - scm_i_string_length (s), - o, - softness); + vcell = intern_obarray_soft (scm_string_to_symbol (s), o, softness); if (scm_is_false (vcell)) return vcell; answer = SCM_CAR (vcell); @@ -1070,7 +1076,8 @@ SCM_DEFINE (scm_gentemp, "gentemp", 0, 2, 0, { char buf[MAX_PREFIX_LENGTH + SCM_INTBUFLEN]; char *name = buf; - int len, n_digits; + int n_digits; + size_t len; scm_c_issue_deprecation_warning ("`gentemp' is deprecated. " "Use `gensym' instead."); @@ -1084,9 +1091,8 @@ SCM_DEFINE (scm_gentemp, "gentemp", 0, 2, 0, { SCM_VALIDATE_STRING (1, prefix); len = scm_i_string_length (prefix); - if (len > MAX_PREFIX_LENGTH) - name = SCM_MUST_MALLOC (MAX_PREFIX_LENGTH + SCM_INTBUFLEN); - strncpy (name, scm_i_string_chars (prefix), len); + name = scm_to_locale_stringn (prefix, &len); + name = scm_realloc (name, len + SCM_INTBUFLEN); } if (SCM_UNBNDP (obarray)) @@ -1108,7 +1114,7 @@ SCM_DEFINE (scm_gentemp, "gentemp", 0, 2, 0, obarray, 0); if (name != buf) - scm_must_free (name); + free (name); return SCM_CAR (vcell); } } @@ -1309,7 +1315,7 @@ scm_i_arrayp (SCM a) { scm_c_issue_deprecation_warning ("SCM_ARRAYP is deprecated. Use scm_is_array instead."); - return SCM_I_ARRAYP(a) || SCM_I_ENCLOSED_ARRAYP(a); + return SCM_I_ARRAYP(a); } size_t |