(array-fill!): Exercise byte range and type checks.
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
bcb88c93
KR
12004-08-06 Kevin Ryde <user42@zip.com.au>
2
3 * unif.c (scm_uniform_vector_ref, scm_array_set_x): For byvect, force
4 signed byte range checks by using scm_to_schar and scm_from_schar,
5 don't want to depend on signedness of C char.
6
29e61124
KR
72004-08-05 Kevin Ryde <user42@zip.com.au>
8
9 * arbiters.c (scm_try_arbiter): Use scm_i_misc_mutex instead of
10 SCM_DEFER_INTS.
11 (scm_release_arbiter): Use scm_i_misc_mutex so return value can be
12 guaranteed if multiple threads compete to unlock.
13 Update docstrings per doc/ref/api-scheduling.texi.
14
99de794f
KR
15 * filesys.c (scm_copy_file): Use fstat on the input fd rather than
16 stat on the filename, to be certain a file rename can't mean we get
17 info on one filesystem object but open another. This fstat usage is
18 similar to Emacs copy-file.
19
29e61124
KR
20 * posix.c (scm_setgroups): Enhance docstring, per doc/ref/posix.texi.
21
22 * simpos.c (scm_system_star): Change scm_from_long to scm_from_int on
23 SIGINT and SIGQUIT, since those values are ints.
24
759aa8f9
MV
252004-08-03 Marius Vollmer <marius.vollmer@uni-dortmund.de>
26
7241f213
MV
27 * num2integral.i.c, num2float.i.c: Removed.
28 * Makefile.am (noinst_HEADERS): Updated.
29
f9656a9f
MV
30 * numbers.h. numbers.c (scm_make_ratio): Renamed to
31 scm_i_make_ratio and made static, replaced uses with scm_divide.
96d8c217
MV
32 (scm_complex_p): New, export as "complex?" to Scheme.
33 (scm_number_p): Export as "number?" to Scheme.
34 (scm_is_complex, scm_is_number): New.
35 (scm_c_make_rectangular, scm_c_make_polar): New.
36 (scm_make_rectangular, scm_make_polar): Use above.
37 (scm_c_real_part, scm_c_imag_part, scm_c_magnitude, scm_c_angle):
38 New.
39 (scm_make_complex): Discouraged by moving to discouraged.h and
40 discouraged.c. Replaced all uses with scm_c_make_rectangular.
41
759aa8f9
MV
42 * discouraged.h, discouraged.c, numbers.c, numbers.h
43 (scm_is_rational): New.
44 (scm_i_short2big, scm_i_int2big, scm_i_uint2big, scm_i_size2big,
45 scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big):
46 Removed prototypes.
47 (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
48 Discouraged by moving to discouraged.h and discouraged.c.
49 Replaced all uses with scm_from_double.
50 (scm_num2float, scm_num2double): Discouraged by moving prototype
51 to discouraged.h and rewriting in terms of scm_to_double.
52 Replaced all uses with scm_to_double.
53 (scm_to_double): Do not implement in terms of scm_num2dbl, use
54 explicit code.
55 (scm_from_double): Do not implement in terms of scm_make_real, use
56 explicit code.
57
531bf3e6
MV
582004-08-02 Marius Vollmer <marius.vollmer@uni-dortmund.de>
59
759aa8f9
MV
60 * init.c (scm_init_guile_1): Call scm_i_init_discouraged.
61
531bf3e6
MV
62 * gen-scmconfig.h.in (SCM_I_GSC_ENABLE_DISCOURAGED): New.
63 * gen-scmconfig.c (SCM_ENABLE_DISCOURAGED): Emit based on above.
64
65 * eval.c (SCM_EVALIM, SCM_EVALIM2, SCM_XEVAL, SCM_XEVALCAR):
66 Renamed to SCM_I_* in order to avoid collisions with the versions
67 defined in deprecated.h.
68
69 * discouraged.h, discouraged.c: New files.
70
71 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_EQ_P,
72 SCM_NEGATE_BOOL, SCM_BOOL, SCM_BOOT_NOT): Promoted from being
73 deprecated to being discouraged by moving to discouraged.h.
74
75 * numbers.h, numbers.c, discouraged.h, discouraged.c
76 (scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num,
77 scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num,
78 scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint,
79 scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff,
80 scm_long_long2num, scm_ulong_long2num, scm_num2long_long,
81 scm_num2ulong_long): Discouraged by moving to discouraged.h and
82 discouraged.c and reimplementing in terms of scm_from_* and
83 scm_to_*. Changed all uses to the new scm_from_* and scm_to_*
84 functions.
85
86 * numbers.h, numbers.c: Removed GUILE_DEBUG code.
87 (scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big,
88 scm_i_size2big, scm_i_ptrdiff2big): Removed.
89 (scm_i_long2big, scm_i_ulong2big): New, explicit definitions.
90 * conv-integer.i.c, conv-uinteger.i.c: Use them instead of
91 explicit code.
92
5ec82e96
KR
932004-08-02 Kevin Ryde <user42@zip.com.au>
94
95 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Add comments about past
96 and current usage and migration.
97
58f28989
KR
982004-07-31 Kevin Ryde <user42@zip.com.au>
99
100 * error.c (scm_strerror): Use scm_i_misc_mutex around strerror since
101 it's not thread safe.
102 (scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take
103 advantage of this.
104 * fports.c (scm_open_file): Use scm_strerror likewise.
105 * filesys.c (scm_stat, scm_lstat): Ditto.
106
107 * filesys.c (scm_copy_file): Avoid fd leak when destination file
108 cannot be opened.
109
110 * symbols.c (scm_gensym): Use scm_i_misc_mutex around gensym_counter
111 update, for thread safety.
112 (gensym_counter): Move into scm_gensym which is its only user.
113 (scm_init_symbols): No need to explicitly initialize gensym_counter.
114
03696aab
MV
1152004-07-29 Marius Vollmer <marius.vollmer@uni-dortmund.de>
116
51fdb325
MV
117 * numbers.h (scm_to_schar, scm_to_uchar, scm_to_char,
118 scm_to_short, scm_to_ushort, scm_to_int, scm_to_uint, scm_to_long,
119 scm_to_ulong, scm_to_long_long, scm_to_ulong_long, scm_to_intmax,
120 scm_to_uintmax, scm_to_size_t, scm_to_ssize_t scm_from_schar,
121 scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort,
122 scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong,
123 scm_from_long_long, scm_from_ulong_long, scm_from_intmax,
124 scm_from_uintmax, scm_from_size_t, scm_from_ssize_t): No longer
125 defined in terms of scm_to_signed_integer, etc, but in terms of
126 scm_to_int8, etc.
127
128 * gen-scmconfig.c (SCM_SIZEOF_INTMAX, SCM_SIZEOF_SIZE_T): New.
129
03696aab
MV
130 * gen-scmconfig.h.in: Removed SCM_I_GSC_*_LIMITS macros, they are
131 no longer used.
132
133 * __scm.h (SCM_I_UTYPE_MAX, SCM_I_TYPE_MAX, SCM_I_TYPE_MIN,
134 SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX): New.
135
136 * __scm.h, gen-scmconfig.c (SCM_I_LLONG_MAX, SCM_I_LLONG_MIN,
137 SCM_I_ULLONG_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT8_MAX,
138 SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT16_MAX,
139 SCM_T_INT32_MIN, SCM_T_INT32_MAX, SCM_T_UINT32_MAX,
140 SCM_T_INT64_MIN, SCM_T_INT64_MAX, SCM_T_UINT64_MAX,
141 SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX, SCM_T_UINTMAX_MAX): Moved
142 definition into __scm.h, using new SCM_I_TYPE_MIN, etc.
143
144 * conv-integer.i.c, conv-uinteger.i.c: New files, used to generate
145 the functions below.
146
147 * Makefile.am (noinst_HEADERS): Added conv-integer.i.c and
148 conv-uinteger.i.c.
149
150 * numbers.c, numbers.h (scm_to_int8, scm_to_uint8, scm_to_int16,
151 scm_to_uint16, scm_to_int32, scm_to_uint32, scm_to_int64,
152 scm_to_uint64, scm_from_int8, scm_from_uint8, scm_from_int16,
153 scm_from_uint16, scm_from_int32, scm_from_uint32, scm_from_int64,
154 scm_from_uint64): Turned from macros into proper functions.
155 (scm_to_signed_integer, scm_to_unsigned_integer,
156 scm_from_signed_integer, scm_from_unsigned_integer): Generate via
157 conv-integer.i.c and conv-uinteger.i.c, as well.
158
159 * number.h (scm_to_ssize_t, scm_to_size_t): Use the new
160 SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX, and SCM_I_SIZE_MAX macros for
161 the limits. Those are always defined.
162
1f15779e
KR
1632004-07-29 Kevin Ryde <user42@zip.com.au>
164
165 * posix.c (scm_ttyname): Use scm_i_misc_mutex for thread safety.
166
48360eb3
KR
1672004-07-28 Kevin Ryde <user42@zip.com.au>
168
169 * posix.c (scm_ctermid): Use an L_ctermid buf on the stack, for thread
170 safety.
171
c3f3c841
KR
172 * unif.c (scm_array_set_x): For svect, use scm_num2short for
173 consistency with other vector types and to get arg and func name into
174 error message.
175
c82f8ed6
MV
1762004-07-27 Marius Vollmer <marius.vollmer@uni-dortmund.de>
177
178 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL):
179 Reimplement using scm_is_false, scm_is_true, scm_is_bool, and
180 scm_from_bool, respectively.
181 (SCM_NINUMP): Added.
182
183 * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
184 deprecated.h. Replaced all uses with scm_is_eq.
185
317b4c4a
KR
1862004-07-24 Kevin Ryde <user42@zip.com.au>
187
188 * threads.c, threads.h (scm_i_misc_mutex): New SCM_GLOBAL_MUTEX.
189 * posix.c (scm_crypt): Use it to protect static data in crypt().
190
e11e83f3
MV
1912004-07-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
192
193 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
c82f8ed6 194 SCM_INUM): Deprecated by renaming them to SCM_I_INUMP,
e11e83f3
MV
195 SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated
196 versions to deprecated.h and deprecated.c. Changed all uses to
197 either use the SCM_I_ variants or scm_is_*, scm_to_*, or
198 scm_from_*, as appropriate.
199
200 * dynwind.c (scm_i_dowinds): Removed unused code that would call
201 the unexisting scm_cross_dynwind_binding_scope for inums on the
202 windlist.
203
a55c2b68
MV
2042004-07-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
205
206 * socket.c (ipv6_net_to_num, scm_from_ipv6): Renamed
e11e83f3 207 ipv6_net_to_num to scm_from_ipv6, for converting from an IPv6
a55c2b68
MV
208 byte-wise address to a SCM integer. Changed all uses.
209 (ipv6_num_to_net, scm_to_ipv6): Renamed ipv6_num_to_net to
210 scm_to_ipv6 and added type and range checking, for converting from
211 an IPv& byte-wise address to a SCM integer. Changed all uses.
212 (bignum_in_ipv6_range_p, VALIDATE_INET6): Removed, their function
213 is now done by scm_to_ipv6.
214
215 * numbers.c (scm_to_signed_integer, scm_to_unsigned_integer): dot
216 not accept inexact integers.
217
218 * validate.h, deprecated.h (SCM_VALIDATE_INUM,
219 SCM_VALIDATE_INUM_COPY, SCM_VALIDATE_BIGINT,
220 SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY,
221 SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
222 SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
223 SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
224 fixnum/bignum distinction visible. Changed all uses to
225 scm_to_size_t or similar.
226
2272004-07-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
228
229 * cpp_cnvt.awk: Use scm_from_int instead of SCM_MAKINUM.
230
48a06bd5
KR
2312004-07-10 Kevin Ryde <user42@zip.com.au>
232
233 * hash.c (scm_hashq, scm_hashv, scm_hash): Restrict to size>=1 rather
234 than size>=0, since 0<=hash<size cannot be satisfied for size==0, and
235 such a size causes divide-by-zeros in scm_hasher.
236
052fbfd9
KR
237 * regex-posix.c (scm_make_regexp): Free rx on error, to avoid memory
238 leak.
239
43240c9c
MV
2402004-07-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
241
242 * numbers.c (scm_is_signed_integer, scm_is_unsigned_integer):
243 Rewritten using the same logic as scm_to_signed_integer and
244 scm_to_unsigned_integer, respectively, which is better(tm). Also,
245 use CHAR_BIT instead of hardcoding 8.
246 (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Removed and used
247 SCM_I_LLONG_MIN etc. instead.
248
249 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
250 SCM_I_MAKINUM and changed all uses.
251 * deprecated.h, deprecated.c (SCM_MAKINUM): Newly deprecated.
252
a3de8e7b
MV
253 * gen-scmconfig.c (SCM_I_LLONG_MIN, SCM_I_LLONG_MAX,
254 SCM_I_ULLONG_MAX): Instead of hard-coding the numbers, compute
43240c9c
MV
255 them by assuming twos-complement.
256
c9eb03bb
MV
2572004-07-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
258
259 * gen-scmconfig.h.in: Added all the new SCM_I_GSC_*_LIMITS that
260 configure now produces.
261 * gen-scmconfig.c: Use them to output SCM_T_INT8_MIN, etc
262 definitions, giving the limits of the integer types defined by
263 Guile. Also, output a hard coded SCM_I_LLONG_MIN, etc since
264 LLONG_MIN or LONG_LONG_MIN is hard to get at.
265
266 * numbers.h (scm_to_short, scm_to_ushort): It's SHRT_MIN, etc, not
267 SHORT_MIN.
268 (scm_to_size_t): Use SIZE_MAX instead of cooking our own.
269 (scm_to_long_long, scm_to_ulong_long, scm_to_int8, scm_to_uint8,
270 scm_to_int16, scm_to_uint16, scm_to_int32, scm_to_uint32,
271 scm_to_int64, scm_to_uint64, scm_to_intmax, scm_to_uintmax,
272 scm_from_long_long, scm_from_ulong_long, scm_from_int8,
273 scm_from_uint8, scm_from_int16, scm_from_uint16, scm_from_int32,
274 scm_from_uint32, scm_from_int64, scm_from_uint64, scm_from_intmax,
275 scm_from_uintmax): New.
276
7888309b
MV
2772004-07-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
278
279 * tags.h (scm_is_eq): New.
280
281 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
282 SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into
283 "deprecated.h". Replaced all uses with scm_is_false, scm_is_true,
284 scm_from_bool, and scm_is_bool, respectively.
285
286 * boolean.h (scm_is_bool): Fix bug in prototype.
287 (scm_from_bool): The argument is "x" not "f", stupid.
288
289 * boolean.c (scm_is_bool): Fix typo.
290
291 * numbers.h, numbers.c (scm_is_integer, scm_is_signed_integer,
292 scm_is_unsigned_integer, scm_to_signed_integer,
293 scm_to_unsigned_integer, scm_to_schar, scm_to_uchar, scm_to_char,
294 scm_to_short, scm_to_ushort, scm_to_long, scm_to_ulong,
295 scm_to_size_t, scm_to_ssize_t, scm_from_schar, scm_from_uchar,
296 scm_from_char, scm_from_short, scm_from_ushort, scm_from_int,
297 scm_from_uint, scm_from_long, scm_from_ulong, scm_from_size_t,
298 scm_from_ssize_t, scm_is_real, scm_to_double, scm_from_double):
299 New.
300
800570a6
MV
3012004-07-05 Marius Vollmer <marius.vollmer@uni-dortmund.de>
302
303 * boolean.h, boolean.c (scm_is_true, scm_is_false, scm_from_bool,
304 scm_to_bool): New.
305
9fcf3cbb
DH
3062004-06-27 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
307
308 * backtrace.c (display_expression, display_frame): Call
309 scm_i_unmemoize_expr for unmemoizing a memoized object holding a
310 single memoized expression.
311
312 * debug.c (memoized_print): Don't try to unmemoize the memoized
313 object, since we can't know whether it holds a single expression
314 or a body.
315
316 (scm_mem_to_proc): Removed check for lambda expression, since it
317 was moot anyway. Whoever uses these functions for debugging
318 purposes should know what they do: Creating invalid memoized code
319 will cause crashes, independent of whether this check is present
320 or not.
321
322 (scm_proc_to_mem): Take the closure's code as it is and don't
323 append a SCM_IM_LAMBDA isym. To allow easier debugging, the
324 memoized code should not be modified.
325
326 * debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed
327 scm_unmemoize from public use, but made scm_i_unmemoize_expr
328 available as a guile internal function instead. However,
329 scm_i_unmemoize_expr will only work on memoized objects that hold
330 a single memoized expression. It won't work with bodies.
331
332 * debug.c (scm_procedure_source), macros.c (macro_print), print.c
333 (scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body,
334 i. e. a list of expressions.
335
336 * eval.c (unmemoize_exprs): Drop internal body markers from the
337 output during unmemoization.
338
339 * eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr,
340 scm_i_unmemocopy_body): Removed scm_unmemocopy from public use,
341 but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available
342 as guile internal functions instead. scm_i_unmemoize_expr will
343 only work on a single memoized expression, while
344 scm_i_unmemocopy_body will only work on bodies.
345
90df793f
DH
3462004-06-21 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
347
348 * eval.c (unmemoize_exprs): Handle semi-memoized code.
349
350 (scm_cons_source, scm_primitive_eval): Prefer higher level
351 predicate SCM_FALSEP over SCM_IMP.
352
8048c00b
RB
3532004-06-15 Rob Browning <rlb@defaultvalue.org>
354
355 * script.c (scm_shell_usage): minor phrasing change.
356
357 * gc_os_dep.c: update ifdefery for macosx.
358 (scm_get_stack_base): separate result initialization from
359 declaration to slience warnings with macosx and hp-ux using gcc
360