summaryrefslogtreecommitdiff
path: root/libguile
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-09-29 18:02:28 +0200
committerAndy Wingo <wingo@pobox.com>2011-09-29 18:02:28 +0200
commitca128245811fab5abcf02756cd7a322a3a40d192 (patch)
tree9138f716f1617f391d2b5f88802b2c6605dd79d2 /libguile
parent25f4a88032f51cecdf8b0147c8a2d0a4574972fa (diff)
parent014de9e25d87b7d3a13566aee4c271c1a11ea0b7 (diff)
downloadguile-ca128245811fab5abcf02756cd7a322a3a40d192.tar.gz
Merge remote-tracking branch 'origin/stable-2.0'
This was a pretty big merge involving a fair amount of porting, especially to peval and its tests. I did not update psyntax-pp.scm, that comes in the next commit. Conflicts: module/ice-9/boot-9.scm module/ice-9/psyntax-pp.scm module/language/ecmascript/compile-tree-il.scm module/language/tree-il.scm module/language/tree-il/analyze.scm module/language/tree-il/inline.scm test-suite/tests/tree-il.test
Diffstat (limited to 'libguile')
-rw-r--r--libguile/numbers.c14
-rw-r--r--libguile/snarf.h2
-rw-r--r--libguile/strings.c8
3 files changed, 19 insertions, 5 deletions
diff --git a/libguile/numbers.c b/libguile/numbers.c
index 235bbbb83..a278ed5b9 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -5436,6 +5436,9 @@ char_decimal_value (scm_t_uint32 c)
return d;
}
+/* Parse the substring of MEM starting at *P_IDX for an unsigned integer
+ in base RADIX. Upon success, return the unsigned integer and update
+ *P_IDX and *P_EXACTNESS accordingly. Return #f on failure. */
static SCM
mem2uinteger (SCM mem, unsigned int *p_idx,
unsigned int radix, enum t_exactness *p_exactness)
@@ -5707,7 +5710,16 @@ mem2ureal (SCM mem, unsigned int *p_idx,
/* Cobble up the fractional part. We might want to set the
NaN's mantissa from it. */
idx += 4;
- mem2uinteger (mem, &idx, 10, &implicit_x);
+ if (!scm_is_eq (mem2uinteger (mem, &idx, 10, &implicit_x), SCM_INUM0))
+ {
+#if SCM_ENABLE_DEPRECATED == 1
+ scm_c_issue_deprecation_warning
+ ("Non-zero suffixes to `+nan.' are deprecated. Use `+nan.0'.");
+#else
+ return SCM_BOOL_F;
+#endif
+ }
+
*p_idx = idx;
return scm_nan ();
}
diff --git a/libguile/snarf.h b/libguile/snarf.h
index b0800c42c..1c072babb 100644
--- a/libguile/snarf.h
+++ b/libguile/snarf.h
@@ -372,7 +372,7 @@ SCM_SNARF_INIT(scm_set_smob_apply((tag), (c_name), (req), (opt), (rest));)
SCM_PACK (0), \
foreign, \
SCM_BOOL_F, /* the name */ \
- }; \
+ }
#define SCM_STATIC_PROGRAM(c_name, objcode, objtable, freevars) \
static SCM_ALIGNED (8) SCM_UNUSED SCM \
diff --git a/libguile/strings.c b/libguile/strings.c
index dd859c4d3..2de003514 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1779,14 +1779,16 @@ scm_to_latin1_stringn (SCM str, size_t *lenp)
if (scm_i_is_narrow_string (str))
{
+ size_t len = scm_i_string_length (str);
+
if (lenp)
- *lenp = scm_i_string_length (str);
+ *lenp = len;
- result = scm_strdup (scm_i_string_data (str));
+ result = scm_strndup (scm_i_string_data (str), len);
}
else
result = scm_to_stringn (str, lenp, NULL,
- SCM_FAILED_CONVERSION_ERROR);
+ SCM_FAILED_CONVERSION_ERROR);
return result;
}