(scm_lookupcar1): Report "Variable used before given a value" insetad
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
2146fdeb
MV
12004-08-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2
3 * eval.c (scm_lookupcar1): Report an "Undefined variable" insetad
4 of an "Unbound" one for variables that are found but still contain
5 SCM_UNDEFINED.
6
7 * posix.c (scm_mkstemp): Correction to the correction, mkstemp
8 expects a null-terminated string in the locale encoding, but
9 scm_i_string_writable_chars doesn't give that. Fixed by letting
10 mkstemp modify a locale version of the tmpl argument and copying
11 the result back into tmpl.
12
13 * strop.c (scm_substring_move_x): Store into str2, not str1.
14
d4f76919
KR
152004-08-20 Kevin Ryde <user42@zip.com.au>
16
17 * posix.c (scm_mkstemp): Correction to new locale_string stuff, need
18 to modify the input string.
19
b5247a6b
MV
202004-08-19 Marius Vollmer <mvo@zagadka.de>
21
22 * deprecated.c (SCM_SYMBOL_CHARS): Cast away const in return.
23 (SCM_SYMBOL_LENGTH): It's scm_i_symbol_length, not
24 scm_c_symbol_length.
25
f26b9395
MV
262004-08-19 Marius Vollmer <marius.vollmer@uni-dortmund.de>
27
28 New string implementation, with copy-on-write strings and
29 mutation-sharing substrings, and a new internal string API.
30 Symbols can now share memory with strings.
31
32 * tags.h (scm_tc7_stringbuf): New tag.
33
34 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
35 scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
36 replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH. Updated all
37 uses.
38 (scm_i_make_string, scm_c_make_string): New, to replace
39 scm_allocate_string. Updated all uses.
40 (SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
41 SCM_STRING_LENGTH): Deprecated.
42 (scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
43 scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
44 Discouraged. Replaced all uses with scm_from_locale_string or
45 similar, as appropriate.
46 (scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
47 scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
48 scm_substring_shared, scm_substring_copy): New.
49
50 * symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
51 SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
52 SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
53 scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
54 (SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
55 Deprecated.
56 (SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
57 SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
58 (scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
59 New, to replace scm_str2symbol and scm_mem2symbol, respectively.
60 Updated all uses.
61 (scm_gensym): Generate only the number suffix in the buffer, just
62 string-append the prefix.
63
64 * error.c (scm_memory_error): Do not try to throw, just abort.
65 Throwing will not work anyway.
66
67 * gh.h, gh-data.c (gh_set_substr): Made src const.
68
69 * ports.c (scm_i_mode_bits_n): New, for counted strings.
70 (scm_mode_bits): Use it.
71 (scm_c_port_for_each): Blocking GC does not seem to work, allocate
72 a vector normally and fill that instead of consing a list with a
73 blocked GC.
74
75 * read.c (scm_i_casei_streq): New, for counted strings.
76
77 * threads.c (gc_section_count): Removed, thread-sleeping can not
78 be nested.
79 (scm_i_thread_put_to_sleep): Call scm_i_leave_guile before locking
80 admin mutex so that we can be put to sleep by other threads while
81 blocking on that mutex. Lock all the heap mutex of all threads,
82 including ourselves.
83 (scm_i_thread_wake_up): Unlock all threads, including ourselves,
84 call scm_i_enter_guile.
85 (scm_thread_mark_stacks): Expect all threads to be suspended.
86
87 * gc.h, gc.c (scm_i_gc_admin_mutex): New, to protect
88 scm_gc_mallocated, for now.
89 (scm_init_storage): Initialize it.
90 * gc-malloc.c (descrease_mtrigger, increase_mtrigger): Use it.
91
92 * gc-mark.c (scm_gc_mark_dependencies): Call scm_i_string_mark,
93 scm_i_stringbuf_mark and scm_i_symbol_mark, as appropriate.
94 * gc-card.c (scm_i_sweep_card): Call scm_i_string_free,
95 scm_i_stringbuf_free and scm_i_symbol_free, as appropriate.
96
cd505b38
MV
97 * strop.c (scm_string_copy): Use scm_c_substring to get a
98 copy-on-write string.
99
8a807b26
KR
1002004-08-18 Kevin Ryde <user42@zip.com.au>
101
102 * arbiters.c (FETCH_STORE): New macro.
103 (SCM_LOCK_VAL, SCM_UNLOCK_VAL): New constants.
104 (SCM_LOCK_ARB, SCM_UNLOCK_ARB): Remove, effectively absorbed into
105 scm_try_arbiter and scm_release_arbiter.
106 (scm_try_arbiter, scm_release_arbiter): Use FETCH_STORE to get xchg
107 for speed on i386, otherwise using mutex.
108
109 * eq.c (scm_equal_p): Remove real==fraction and fraction==real, they
110 must be #f according to R5RS. (equal? follows eqv?, and for eqv? an
111 exact and inexact is #f.)
112
113 * fports.c (fport_print): Use scm_ttyname instead of ttyname directly,
114 to get thread safety of scm_ttyname.
115
116 * ports.c (ttyname): Remove prototype, unused.
117
d6cd4c36 118 * socket.c (scm_init_socket): Add SOCK_SEQPACKET and SOCK_RDM.
1f3cc0d3 119 Reported by Michael Tuexen.
d6cd4c36 120
fa0c0a4b
MV
1212004-08-13 Marius Vollmer <marius.vollmer@uni-dortmund.de>
122
123 * load.c (scm_init_load_path): Do not pass NULL to
124 scm_to_locale_string, which would happen when GUILE_LOAD_PATH is
125 not set. Thanks to Bill Schottstaedt.
126
70f7ee41
MV
1272004-08-12 Marius Vollmer <marius.vollmer@uni-dortmund.de>
128
129 * socket.c (scm_inet_aton, scm_inet_pton): Convert SCM strings to
130 locale strings instead of accessing their internals.
131 (scm_recv, scm_send, scm_recvfrom, scm_sendto): Use
132 SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH instead of
133 SCM_STRING_CHARS and SCM_STRING_LENGTH.
134
135 * simpos.c (scm_system): Convert SCM strings to locale strings
136 instead of accessing their internals.
137
138 * script.c (scm_compile_shell_switches): Convert version to locale
139 string before printing it.
140
141 * rdelim.c (scm_read_delimited_x): Avoid
142 SCM_VALIDATE_SUBSTRING_SPEC_COPY and use scm_from_size_t instead
143 of scm_from_long for the returned number of read characters.
144
145 * ioext.c (scm_fdopen): Use scm_i_fdes_to_port together with
146 scm_i_mode_bits to avoid accessing internals of SCM string from C.
147
148 * filesys.c (STRING_SYSCALL, STRING2_SYSCALL): New helper macros.
149 Use them instead of SCM_SYSCALL when one or two strings need to be
150 converted into locale strings.
151 (my_rename): New, gathers platform dependent code for renaming.
152 (scm_rename): Use it.
153 (scm_readlink, scm_copy_file): Convert SCM strings to locale
154 strings instead of accessing their internals.
155 (scm_basename, scm_dirname): Use SCM_I_STRING_CHARS and
156 SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS and
157 SCM_STRING_LENGTH.
158
159 * extensions.c (load_extension): Convert lib and init to locale
160 strings instead of accessing the internals directly.
161 (scm_c_load_extension): Use scm_from_locale_string instead of
162 scm_makfrom0str.
163
164 * fports.h, fports.c (scm_i_fdes_to_port): New, like
165 scm_fdes_to_port, but take mode bits directly instead of as a C
166 string.
167 (scm_i_fdes_to_port): Implement using above.
168 (scm_open_file): Use scm_i_fdes_to_port together with
169 scm_i_mode_bits to avoid accessing internals of SCM string from C.
170 * vports.c (scm_make_soft_port): Use scm_i_fdes_to_port together
171 with scm_i_mode_bits to avoid accessing internals of SCM string
172 from C.
173
174 * ports.h (scm_i_mode_bits): New, same as scm_mode_bits but with a
175 SCM string as argument.
176
177 * ports.c (scm_i_void_port): New, like scm_void_port but take mode
178 bits directly instead of C string.
179 (scm_void_port): Implement using above.
180 (scm_sys_make_void_port): Use scm_i_void_port together with
181 scm_i_mode_bits to avoid accessing internals of SCM string.
182
183 * strings.h, strings.c (scm_i_get_substring_spec): New.
184
185 * socket.c, rw.c, deprecated.h, validate.h
186 (SCM_VALIDATE_STRING_COPY): Deprecated. Replaced all uses with
187 SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or
188 scm_to_locale_string, etc.
189 (SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated. Replaced as
190 above, plus scm_i_get_substring_spec.
191
192 * regex-posix.c, read.c, random.c, ramap.c, print.c, numbers.c,
193 hash.c, gc.c, gc-card.c, convert.i.c, backtrace.c, strop.c,
194 strorder.c, strports.c, struct.c, symbols.c, unif.c, ports.c: Use
195 SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH
196 instead of SCM_STRING_CHARS, SCM_STRING_UCHARS, and
197 SCM_STRING_LENGTH, respectively. Also, replaced scm_return_first
198 with more explicit scm_remember_upto_here_1, etc, or introduced
199 them in the first place.
200
201 * posix.c (WITH_STRING): New helper macro. Use it where one
202 locale string is needed for a short piece of code.
203 (STRING_SYSCALL): New helper macro. Use it instead of SCM_SYSCALL
204 when one locale string is needed.
205 (scm_mkstemp): Convert tmpl to a locale string.
206 (scm_putenv): Rewritten to use only C strings.
207 (scm_setlocale, scm_crpt): Convert argument strings to locale
208 strings.
209
2102004-08-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
211
212 * load.c (scm_primitive_load_path): Do not check for absolute
213 filenames when scm_sys_search_load_path returns false, which will
214 return absolute filenames unchanged.
215
bb26cc2d
MV
2162004-08-11 Marius Vollmer <mvo@zagadka.de>
217
218 * gc.c, procprop.c (scm_init_storage, scm_stand_in_procs,
219 scm_stand_in_proc): Use a hastable for scm_stand_in_procs instead
220 of an alist. Thanks to Matthias Koeppe!
221
02573e4c
MV
2222004-08-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
223
224 * strings.h, deprecated.h (SCM_STRING_COERCE_0TERMINATION_X):
225 Moved from string.h to deprecated.h.
226
227 * deprecated.c, deprecated.h (SCM_CHARS, SCM_LENGTH): Removed.
228
f9751e86 229 * strings.h, strings.c (SCM_MAKE_STRING_TAG): Renamed to
02573e4c
MV
230 SCM_I_MAKE_STRING_TAG, changed all uses.
231 (SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Renamed
232 to SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_LENGTH
233 respectively. For a short time, the old names are still there as
234 aliases. Not all uses have been changed yet, but the ones in
235 strings.c have.
236 (SCM_STRING_MAX_LEN): Do not hardcode to 24 bits, compute from
237 SCM_T_BITS_MAX.
238 (scm_is_string, scm_from_locale_string, scm_from_locale_stringn,
239 scm_take_locale_string, scm_take_locale_stringn,
240 scm_to_locale_string, scm_to_locale_stringn,
241 scm_to_locale_stringbuf): New.
242 (scm_c_string2str, scm_c_substring2str): Deprecated by moving to
243 deprecated.[hc]. Implemented in terms of the new functions above.
244 (scm_take_str, scm_take0str, scm_mem2string, scm_str2string,
245 scm_makfrom0str): Reimplemented in terms of the new functions from
246 above. They will be discouraged shortly.
247 (scm_substring): Do not use scm_mem2string.
248 (scm_i_allocate_string_pointers, scm_i_free_string_pointers): New,
249 to replace similar code from posix.c, simpos.c, and dynl.c.
250 (scm_string_append): Use memcpy instead of explicit loop. Do not
251 use register keyword. Use plain 'char' instead of 'unsigned
252 char'.
253
254 * strports.c (scm_mkstrport): Use SCM_I_STRING_UCHARS instead of
255 SCM_STRING_UCHARS. Use SCM_I_STRINGP instead of SCM_STRINGP.
256
257 * strop.c (scm_i_index): Replaced SCM_STRINGP, SCM_STRING_CHARS,
258 and SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and
259 SCM_I_STRING_LENGTH, respectively. Pass string object directly,
260 not as a pointer. Use scm_remember_upto_here_1 to protect it.
261
262 * read.c (scm_input_error): Use a SCM value for 'fn', not a C
263 string. This avoids a conversion round-trip.
264
265 * gh_data.c: Replaced SCM_STRINGP, SCM_STRING_CHARS, and
266 SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and
267 SCM_I_STRING_LENGTH, respectively.
268 (gh_scm2newstr): Implement in terms of scm_to_locale_string.
269
270 * environments.c: Instead calling scm_puts on the SCM_STRING_CHARS
271 of a string, call scm_display on the string itself.
272
273 * dynwind.c, dynwind.h (scm_frame_free): New.
274
275 * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,
276 net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c:
277 Replaced uses of SCM_STRING_CHARS with proper uses of
278 scm_to_locale_string. Replaced SCM_STRINGP with scm_is_string.
279 Replaced scm_mem2string with scm_from_locale_string.
280
281 * simpos.c, posix.c (allocate_string_pointers, environ_list_to_c):
282 Removed, replaced all uses with scm_i_allocate_string_pointers.
283
284 * load.h, load.c (scm_internal_parse_path): Removed.
285 (scm_parse_path): Use scm_string_split to do the work.
286 (scm_init_load_path): Use scm_parse_path instead of
287 scm_internal_parse_path.
288 (scm_search_path): Rewritten string handling part of the code in
289 terms of scm_to_locale_stringbuf and so that it is thread safe.
290
291 * error.c (scm_error_scm): Throw directly instead of calling
292 scm_error, this avoids the back and forth conversion of SUBR and
293 MESSAGE and also plugs a memory leak.
294 (scm_error): Call scm_error_scm.
295
296 * backtrace.c: Replaced SCM_STRINGP with scm_is_string.
297 (display_header): Print FNAME when it is true, not
298 merely when it is a string.
299
300 * strings.h (SCM_SET_STRING_LENGTH, SCM_SET_STRING_CHARS): Removed
301 unceremoniously. They were unused by Guile itself, and external
302 use should stop immediately.
303
304
409eb4e5
MV
3052004-08-10 Marius Vollmer <mvo@zagadka.de>
306
307 * numbers.h, number.c, deprecated.h, deprecated.c (scm_round,
308 scm_truncate): Renamed to scm_c_round and scm_c_truncate;
309 deprecated versions installed in deprecated.h and deprecated.c.
310 Changed all uses.
311
a00eaf19
RB
3122004-08-06 Rob Browning <rlb@defaultvalue.org>
313
314 * net_db.c (scm_resolv_error): don't cause an exception while
315 trying to throw an exception -- call scm_misc_error with correct
316 arguments. The previous arguments needed a format escape that
317 wasn't in any of the format strings.
318
bcb88c93
KR
3192004-08-06 Kevin Ryde <user42@zip.com.au>
320
8f094b97
KR
321 * ramap.c (scm_array_fill_x): For byvect char fill, force signed char
322 so as not to depend on signedness of plain char. For byvect range
323 check, throw out-of-range rather than wrong-type-arg.
324
bcb88c93
KR
325 * unif.c (scm_uniform_vector_ref, scm_array_set_x): For byvect, force
326 signed byte range checks by using scm_to_schar and scm_from_schar,
327 don't want to depend on signedness of C char.
328
29e61124
KR
3292004-08-05 Kevin Ryde <user42@zip.com.au>
330
331 * arbiters.c (scm_try_arbiter): Use scm_i_misc_mutex instead of
332 SCM_DEFER_INTS.
333 (scm_release_arbiter): Use scm_i_misc_mutex so return value can be
334 guaranteed if multiple threads compete to unlock.
335 Update docstrings per doc/ref/api-scheduling.texi.
336
99de794f
KR
337 * filesys.c (scm_copy_file): Use fstat on the input fd rather than
338 stat on the filename, to be certain a file rename can't mean we get
339 info on one filesystem object but open another. This fstat usage is
340 similar to Emacs copy-file.
341
29e61124
KR
342 * posix.c (scm_setgroups): Enhance docstring, per doc/ref/posix.texi.
343
344 * simpos.c (scm_system_star): Change scm_from_long to scm_from_int on
345 SIGINT and SIGQUIT, since those values are ints.
346
759aa8f9
MV
3472004-08-03 Marius Vollmer <marius.vollmer@uni-dortmund.de>
348
7241f213
MV
349 * num2integral.i.c, num2float.i.c: Removed.
350 * Makefile.am (noinst_HEADERS): Updated.
351
f9656a9f
MV
352 * numbers.h. numbers.c (scm_make_ratio): Renamed to
353 scm_i_make_ratio and made static, replaced uses with scm_divide.
96d8c217
MV
354 (scm_complex_p): New, export as "complex?" to Scheme.
355 (scm_number_p): Export as "number?" to Scheme.
356 (scm_is_complex, scm_is_number): New.
357 (scm_c_make_rectangular, scm_c_make_polar): New.
358 (scm_make_rectangular, scm_make_polar): Use above.
359 (scm_c_real_part, scm_c_imag_part, scm_c_magnitude, scm_c_angle):
360 New.
361 (scm_make_complex): Discouraged by moving to discouraged.h and
362 discouraged.c. Replaced all uses with scm_c_make_rectangular.
363
759aa8f9
MV
364 * discouraged.h, discouraged.c, numbers.c, numbers.h
365 (scm_is_rational): New.
366 (scm_i_short2big, scm_i_int2big, scm_i_uint2big, scm_i_size2big,
367 scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big):
368 Removed prototypes.
369 (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
370 Discouraged by moving to discouraged.h and discouraged.c.
371 Replaced all uses with scm_from_double.
372 (scm_num2float, scm_num2double): Discouraged by moving prototype
373 to discouraged.h and rewriting in terms of scm_to_double.
374 Replaced all uses with scm_to_double.
375 (scm_to_double): Do not implement in terms of scm_num2dbl, use
376 explicit code.
377 (scm_from_double): Do not implement in terms of scm_make_real, use
378 explicit code.
379
531bf3e6
MV
3802004-08-02 Marius Vollmer <marius.vollmer@uni-dortmund.de>
381
759aa8f9
MV
382 * init.c (scm_init_guile_1): Call scm_i_init_discouraged.
383
531bf3e6
MV
384 * gen-scmconfig.h.in (SCM_I_GSC_ENABLE_DISCOURAGED): New.
385 * gen-scmconfig.c (SCM_ENABLE_DISCOURAGED): Emit based on above.
386
387 * eval.c (SCM_EVALIM, SCM_EVALIM2, SCM_XEVAL, SCM_XEVALCAR):
388 Renamed to SCM_I_* in order to avoid collisions with the versions
389 defined in deprecated.h.
390
391 * discouraged.h, discouraged.c: New files.
392
393 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_EQ_P,
394 SCM_NEGATE_BOOL, SCM_BOOL, SCM_BOOT_NOT): Promoted from being
395 deprecated to being discouraged by moving to discouraged.h.
396
397 * numbers.h, numbers.c, discouraged.h, discouraged.c
398 (scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num,
399 scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num,
400 scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint,
401 scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff,
402 scm_long_long2num, scm_ulong_long2num, scm_num2long_long,
403 scm_num2ulong_long): Discouraged by moving to discouraged.h and
404 discouraged.c and reimplementing in terms of scm_from_* and
405 scm_to_*. Changed all uses to the new scm_from_* and scm_to_*
406 functions.
407
408 * numbers.h, numbers.c: Removed GUILE_DEBUG code.
409 (scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big,
410 scm_i_size2big, scm_i_ptrdiff2big): Removed.
411 (scm_i_long2big, scm_i_ulong2big): New, explicit definitions.
412 * conv-integer.i.c, conv-uinteger.i.c: Use them instead of
413 explicit code.
414
5ec82e96
KR
4152004-08-02 Kevin Ryde <user42@zip.com.au>
416
417 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Add comments about past
418 and current usage and migration.
419
58f28989
KR
4202004-07-31 Kevin Ryde <user42@zip.com.au>
421
422 * error.c (scm_strerror): Use scm_i_misc_mutex around strerror since
423 it's not thread safe.
424 (scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take
425 advantage of this.
426 * fports.c (scm_open_file): Use scm_strerror likewise.
427 * filesys.c (scm_stat, scm_lstat): Ditto.
428
429 * filesys.c (scm_copy_file): Avoid fd leak when destination file
430 cannot be opened.
431
432 * symbols.c (scm_gensym): Use scm_i_misc_mutex around gensym_counter
433 update, for thread safety.
434 (gensym_counter): Move into scm_gensym which is its only user.
435 (scm_init_symbols): No need to explicitly initialize gensym_counter.
436
03696aab
MV
4372004-07-29 Marius Vollmer <marius.vollmer@uni-dortmund.de>
438
51fdb325
MV
439 * numbers.h (scm_to_schar, scm_to_uchar, scm_to_char,
440 scm_to_short, scm_to_ushort, scm_to_int, scm_to_uint, scm_to_long,
441 scm_to_ulong, scm_to_long_long, scm_to_ulong_long, scm_to_intmax,
442 scm_to_uintmax, scm_to_size_t, scm_to_ssize_t scm_from_schar,
443 scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort,
444 scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong,
445 scm_from_long_long, scm_from_ulong_long, scm_from_intmax,
446 scm_from_uintmax, scm_from_size_t, scm_from_ssize_t): No longer
447 defined in terms of scm_to_signed_integer, etc, but in terms of
448 scm_to_int8, etc.
449
450 * gen-scmconfig.c (SCM_SIZEOF_INTMAX, SCM_SIZEOF_SIZE_T): New.
451
03696aab
MV
452 * gen-scmconfig.h.in: Removed SCM_I_GSC_*_LIMITS macros, they are
453 no longer used.
454
455 * __scm.h (SCM_I_UTYPE_MAX, SCM_I_TYPE_MAX, SCM_I_TYPE_MIN,
456 SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX): New.
457
458 * __scm.h, gen-scmconfig.c (SCM_I_LLONG_MAX, SCM_I_LLONG_MIN,
459 SCM_I_ULLONG_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT8_MAX,
460 SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT16_MAX,
461 SCM_T_INT32_MIN, SCM_T_INT32_MAX, SCM_T_UINT32_MAX,
462 SCM_T_INT64_MIN, SCM_T_INT64_MAX, SCM_T_UINT64_MAX,
463 SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX, SCM_T_UINTMAX_MAX): Moved
464 definition into __scm.h, using new SCM_I_TYPE_MIN, etc.
465
466 * conv-integer.i.c, conv-uinteger.i.c: New files, used to generate
467 the functions below.
468
469 * Makefile.am (noinst_HEADERS): Added conv-integer.i.c and
470 conv-uinteger.i.c.
471
472 * numbers.c, numbers.h (scm_to_int8, scm_to_uint8, scm_to_int16,
473 scm_to_uint16, scm_to_int32, scm_to_uint32, scm_to_int64,
474 scm_to_uint64, scm_from_int8, scm_from_uint8, scm_from_int16,
475 scm_from_uint16, scm_from_int32, scm_from_uint32, scm_from_int64,
476 scm_from_uint64): Turned from macros into proper functions.
477 (scm_to_signed_integer, scm_to_unsigned_integer,
478 scm_from_signed_integer, scm_from_unsigned_integer): Generate via
479 conv-integer.i.c and conv-uinteger.i.c, as well.
480
481 * number.h (scm_to_ssize_t, scm_to_size_t): Use the new
482 SCM_I_SSIZE_MIN, SCM_I_SSIZE_MAX, and SCM_I_SIZE_MAX macros for
483 the limits. Those are always defined.
484
1f15779e
KR
4852004-07-29 Kevin Ryde <user42@zip.com.au>
486
487 * posix.c (scm_ttyname): Use scm_i_misc_mutex for thread safety.
488
48360eb3
KR
4892004-07-28 Kevin Ryde <user42@zip.com.au>
490
491 * posix.c (scm_ctermid): Use an L_ctermid buf on the stack, for thread
492 safety.
493
c3f3c841
KR
494 * unif.c (scm_array_set_x): For svect, use scm_num2short for
495 consistency with other vector types and to get arg and func name into
496 error message.
497
c82f8ed6
MV
4982004-07-27 Marius Vollmer <marius.vollmer@uni-dortmund.de>
499
500 * deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL):
501 Reimplement using scm_is_false, scm_is_true, scm_is_bool, and
502 scm_from_bool, respectively.
503 (SCM_NINUMP): Added.
504
505 * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
506 deprecated.h. Replaced all uses with scm_is_eq.
507
317b4c4a
KR
5082004-07-24 Kevin Ryde <user42@zip.com.au>
509
510 * threads.c, threads.h (scm_i_misc_mutex): New SCM_GLOBAL_MUTEX.
511 * posix.c (scm_crypt): Use it to protect static data in crypt().
512
e11e83f3
MV
5132004-07-23 Marius Vollmer <marius.vollmer@uni-dortmund.de>
514
515 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
c82f8ed6 516 SCM_INUM): Deprecated by renaming them to SCM_I_INUMP,
e11e83f3
MV
517 SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated
518 versions to deprecated.h and deprecated.c. Changed all uses to
519 either use the SCM_I_ variants or scm_is_*, scm_to_*, or
520 scm_from_*, as appropriate.
521
522 * dynwind.c (scm_i_dowinds): Removed unused code that would call
523 the unexisting scm_cross_dynwind_binding_scope for inums on the
524 windlist.
525
a55c2b68
MV
5262004-07-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
527
528 * socket.c (ipv6_net_to_num, scm_from_ipv6): Renamed
e11e83f3 529 ipv6_net_to_num to scm_from_ipv6, for converting from an IPv6
a55c2b68
MV
530 byte-wise address to a SCM integer. Changed all uses.
531 (ipv6_num_to_net, scm_to_ipv6): Renamed ipv6_num_to_net to
532 scm_to_ipv6 and added type and range checking, for converting from
533 an IPv& byte-wise address to a SCM integer. Changed all uses.
534 (bignum_in_ipv6_range_p, VALIDATE_INET6): Removed, their function
535 is now done by scm_to_ipv6.
536
537 * numbers.c (scm_to_signed_integer, scm_to_unsigned_integer): dot
538 not accept inexact integers.
539
540 * validate.h, deprecated.h (SCM_VALIDATE_INUM,
541 SCM_VALIDATE_INUM_COPY, SCM_VALIDATE_BIGINT,
542 SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY,
543 SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
544 SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
545 SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
546 fixnum/bignum distinction visible. Changed all uses to
547 scm_to_size_t or similar.
548
5492004-07-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
550
551 * cpp_cnvt.awk: Use scm_from_int instead of SCM_MAKINUM.
552
48a06bd5
KR
5532004-07-10 Kevin Ryde <user42@zip.com.au>
554
555 * hash.c (scm_hashq, scm_hashv, scm_hash): Restrict to size>=1 rather
556 than size>=0, since 0<=hash<size cannot be satisfied for size==0, and
557 such a size causes divide-by-zeros in scm_hasher.
558
052fbfd9
KR
559 * regex-posix.c (scm_make_regexp): Free rx on error, to avoid memory
560 leak.
561
43240c9c
MV
5622004-07-08 Marius Vollmer <marius.vollmer@uni-dortmund.de>
563
564 * numbers.c (scm_is_signed_integer, scm_is_unsigned_integer):
565 Rewritten using the same logic as scm_to_signed_integer and
566 scm_to_unsigned_integer, respectively, which is better(tm). Also,
567 use CHAR_BIT instead of hardcoding 8.
568 (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Removed and used
569 SCM_I_LLONG_MIN etc. instead.
570
571 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
572 SCM_I_MAKINUM and changed all uses.
573 * deprecated.h, deprecated.c (SCM_MAKINUM): Newly deprecated.
574
a3de8e7b
MV
575 * gen-scmconfig.c (SCM_I_LLONG_MIN, SCM_I_LLONG_MAX,
576 SCM_I_ULLONG_MAX): Instead of hard-coding the numbers, compute
43240c9c
MV
577 them by assuming twos-complement.
578
c9eb03bb
MV
5792004-07-07 Marius Vollmer <marius.vollmer@uni-dortmund.de>
580
581 * gen-scmconfig.h.in: Added all the new SCM_I_GSC_*_LIMITS that
582 configure now produces.
583 * gen-scmconfig.c: Use them to output SCM_T_INT8_MIN, etc
584 definitions, giving the limits of the integer types defined by
585 Guile. Also, output a hard coded SCM_I_LLONG_MIN, etc since
586 LLONG_MIN or LONG_LONG_MIN is hard to get at.
587
588 * numbers.h (scm_to_short, scm_to_ushort): It's SHRT_MIN, etc, not
589 SHORT_MIN.
590 (scm_to_size_t): Use SIZE_MAX instead of cooking our own.
591 (scm_to_long_long, scm_to_ulong_long, scm_to_int8, scm_to_uint8,
592 scm_to_int16, scm_to_uint16, scm_to_int32, scm_to_uint32,
593 scm_to_int64, scm_to_uint64, scm_to_intmax, scm_to_uintmax,
594 scm_from_long_long, scm_from_ulong_long, scm_from_int8,
595 scm_from_uint8, scm_from_int16, scm_from_uint16, scm_from_int32,
596 scm_from_uint32, scm_from_int64, scm_from_uint64, scm_from_intmax,
597 scm_from_uintmax): New.
598
7888309b
MV
5992004-07-06 Marius Vollmer <marius.vollmer@uni-dortmund.de>
600
601 * tags.h (scm_is_eq): New.
602
603 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
604 SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into
605 "deprecated.h". Replaced all uses with scm_is_false, scm_is_true,
606 scm_from_bool, and scm_is_bool, respectively.
607
608 * boolean.h (scm_is_bool): Fix bug in prototype.
609 (scm_from_bool): The argument is "x" not "f", stupid.
610
611 * boolean.c (scm_is_bool): Fix typo.
612
613 * numbers.h, numbers.c (scm_is_integer, scm_is_signed_integer,
614 scm_is_unsigned_integer, scm_to_signed_integer,
615 scm_to_unsigned_integer, scm_to_schar, scm_to_uchar, scm_to_char,
616 scm_to_short, scm_to_ushort, scm_to_long, scm_to_ulong,
617 scm_to_size_t, scm_to_ssize_t, scm_from_schar, scm_from_uchar,
618 scm_from_char, scm_from_short, scm_from_ushort, scm_from_int,
619 scm_from_uint, scm_from_long, scm_from_ulong, scm_from_size_t,
620 scm_from_ssize_t, scm_is_real, scm_to_double, scm_from_double):
621 New.
622
800570a6
MV
6232004-07-05 Marius Vollmer <marius.vollmer@uni-dortmund.de>
624
625 * boolean.h, boolean.c (scm_is_true, scm_is_false, scm_from_bool,
626 scm_to_bool): New.
627
9fcf3cbb
DH
6282004-06-27 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
629
630 * backtrace.c (display_expression, display_frame): Call
631 scm_i_unmemoize_expr for unmemoizing a memoized object holding a
632 single memoized expression.
633
634 * debug.c (memoized_print): Don't try to unmemoize the memoized
635 object, since we can't know whether it holds a single expression
636 or a body.
637
638 (scm_mem_to_proc): Removed check for lambda expression, since it
639 was moot anyway. Whoever uses these functions for debugging
640 purposes should know what they do: Creating invalid memoized code
641 will cause crashes, independent of whether this check is present
642 or not.
643
644 (scm_proc_to_mem): Take the closure's code as it is and don't
645 append a SCM_IM_LAMBDA isym. To allow easier debugging, the
646 memoized code should not be modified.
647
648 * debug.[ch] (scm_unmemoize, scm_i_unmemoize_expr): Removed
649 scm_unmemoize from public use, but made scm_i_unmemoize_expr
650 available as a guile internal function instead. However,
651 scm_i_unmemoize_expr will only work on memoized objects that hold
652 a single memoized expression. It won't work with bodies.
653
654 * debug.c (scm_procedure_source), macros.c (macro_print), print.c
655 (scm_iprin1): Call scm_i_unmemocopy_body for unmemoizing a body,
656 i. e. a list of expressions.
657
658 * eval.c (unmemoize_exprs): Drop internal body markers from the
659 output during unmemoization.
660
661 * eval.[ch] (scm_unmemocopy, scm_i_unmemocopy_expr,
662 scm_i_unmemocopy_body): Removed scm_unmemocopy from public use,
663 but made scm_i_unmemocopy_expr and scm_i_unmemocopy_body available
664 as guile internal functions instead. scm_i_unmemoize_expr will
665 only work on a single memoized expression, while
666 scm_i_unmemocopy_body will only work on bodies.
667
90df793f
DH
6682004-06-21 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
669
670 * eval.c (unmemoize_exprs): Handle semi-memoized code.
671
672 (scm_cons_source, scm_primitive_eval): Prefer higher level
673 predicate SCM_FALSEP over SCM_IMP.
674
8048c00b
RB
6752004-06-15 Rob Browning <rlb@defaultvalue.org>
676
677 * script.c (scm_shell_usage): minor phrasing change.
678
679 * gc_os_dep.c: update ifdefery for macosx.
680 (scm_get_stack_base): separate result initialization from
681 declaration to slience warnings with macosx and hp-ux using gcc
682