1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

* threads.c (s_scm_lock_mutex): Don't declare msg in middle of

code.

* gc.c (s_scm_gc_live_object_stats): Don't declare alist in middle
of code.

* gc-card.c (scm_i_card_statistics): Don't declare tag in middle
of code.
(scm_i_card_statistics): Add block for declarations of tag_as_scm
and current.
This commit is contained in:
Neil Jerram 2005-05-11 07:41:36 +00:00
parent 229a07109c
commit b01532af77
4 changed files with 29 additions and 8 deletions

View file

@ -1,3 +1,18 @@
2005-05-11 Neil Jerram <neil@ossau.uklinux.net>
Fix C99isms reported by Ludovic Courtès:
* threads.c (s_scm_lock_mutex): Don't declare msg in middle of
code.
* gc.c (s_scm_gc_live_object_stats): Don't declare alist in middle
of code.
* gc-card.c (scm_i_card_statistics): Don't declare tag in middle
of code.
(scm_i_card_statistics): Add block for declarations of tag_as_scm
and current.
2005-05-10 Neil Jerram <neil@ossau.uklinux.net>
* scmsigs.c (signal_delivery_thread): Return a value, to avoid

View file

@ -308,11 +308,13 @@ scm_i_card_statistics (scm_t_cell *p, SCM hashtab, scm_t_heap_segment *seg)
for (p += offset; p < end; p += span, offset += span)
{
scm_t_bits tag;
SCM scmptr = PTR2SCM (p);
if (!SCM_C_BVEC_GET (bitvec, offset))
continue;
scm_t_bits tag = SCM_TYP7 (scmptr);
tag = SCM_TYP7 (scmptr);
if (tag == scm_tc7_smob)
{
tag = SCM_TYP16(scmptr);
@ -337,12 +339,14 @@ scm_i_card_statistics (scm_t_cell *p, SCM hashtab, scm_t_heap_segment *seg)
tag = scm_tc7_asubr;
break;
}
SCM tag_as_scm = scm_from_int (tag);
SCM current = scm_hashq_ref (hashtab, tag_as_scm, SCM_I_MAKINUM (0));
scm_hashq_set_x (hashtab, tag_as_scm,
scm_from_int (scm_to_int (current) + 1));
{
SCM tag_as_scm = scm_from_int (tag);
SCM current = scm_hashq_ref (hashtab, tag_as_scm, SCM_I_MAKINUM (0));
scm_hashq_set_x (hashtab, tag_as_scm,
scm_from_int (scm_to_int (current) + 1));
}
}
}

View file

@ -277,9 +277,11 @@ SCM_DEFINE (scm_gc_live_object_stats, "gc-live-object-stats", 0, 0, 0,
#define FUNC_NAME s_scm_gc_live_object_stats
{
SCM tab = scm_make_hash_table (scm_from_int (57));
SCM alist;
scm_i_all_segments_statistics (tab);
SCM alist
alist
= scm_internal_hash_fold (&tag_table_to_type_alist, NULL, SCM_EOL, tab);
return alist;

View file

@ -883,9 +883,9 @@ SCM_DEFINE (scm_lock_mutex, "lock-mutex", 1, 0, 0,
"thread. That is, Guile's mutexes are @emph{recursive}. ")
#define FUNC_NAME s_scm_lock_mutex
{
SCM_VALIDATE_MUTEX (1, mx);
char *msg;
SCM_VALIDATE_MUTEX (1, mx);
msg = fat_mutex_lock (mx);
if (msg)
scm_misc_error (NULL, msg, SCM_EOL);