* More C99isms
@ 2004-08-29 9:33 Andreas Vögele
2004-09-20 21:48 ` Marius Vollmer
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Vögele @ 2004-08-29 9:33 UTC (permalink / raw)
Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 319 bytes --]
Hi,
there are still C99isms in strings.c and threads.c. I've attached a
patch that changes the relevant code so that it can be compiled with
GCC 2.95. IMHO C99isms ought to be avoided as long as Debian Woody and
OpenBSD 3.5 are supported products since both distributions come with
GCC 2.95 as default compiler.
[-- Attachment #2: c99isms.diff --]
[-- Type: application/octet-stream, Size: 1964 bytes --]
Index: libguile/strings.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/strings.c,v
retrieving revision 1.89
diff -u -r1.89 strings.c
--- libguile/strings.c 27 Aug 2004 12:45:37 -0000 1.89
+++ libguile/strings.c 29 Aug 2004 09:11:43 -0000
@@ -215,10 +215,10 @@
scm_i_substring_copy (SCM str, size_t start, size_t end)
{
size_t len = end - start;
- SCM buf;
+ SCM buf, my_buf;
size_t str_start;
get_str_buf_start (&str, &buf, &str_start);
- SCM my_buf = make_stringbuf (len);
+ my_buf = make_stringbuf (len);
memcpy (STRINGBUF_CHARS (my_buf),
STRINGBUF_CHARS (buf) + str_start + start, len);
scm_remember_upto_here_1 (buf);
@@ -732,9 +732,11 @@
res = scm_i_make_string (i, &data);
for (l = args; !SCM_NULLP (l); l = SCM_CDR (l))
{
+ size_t len;
+
s = SCM_CAR (l);
SCM_VALIDATE_STRING (SCM_ARGn, s);
- size_t len = scm_i_string_length (s);
+ len = scm_i_string_length (s);
memcpy (data, scm_i_string_chars (s), len);
data += len;
scm_remember_upto_here_1 (s);
Index: libguile/threads.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/threads.c,v
retrieving revision 1.65
diff -u -r1.65 threads.c
--- libguile/threads.c 19 Aug 2004 17:16:01 -0000 1.65
+++ libguile/threads.c 29 Aug 2004 09:11:43 -0000
@@ -937,6 +937,7 @@
scm_threads_mark_stacks (void)
{
volatile SCM c;
+ long stack_len;
for (c = all_threads; !SCM_NULLP (c); c = SCM_CDR (c))
{
@@ -955,10 +956,10 @@
}
#if SCM_STACK_GROWS_UP
- long stack_len = t->top - t->base;
+ stack_len = t->top - t->base;
scm_mark_locations (t->base, stack_len);
#else
- long stack_len = t->base - t->top;
+ stack_len = t->base - t->top;
scm_mark_locations (t->top, stack_len);
#endif
scm_mark_locations ((SCM_STACKITEM *) t->regs,
[-- Attachment #3: Type: text/plain, Size: 137 bytes --]
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: More C99isms
2004-08-29 9:33 More C99isms Andreas Vögele
@ 2004-09-20 21:48 ` Marius Vollmer
0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2004-09-20 21:48 UTC (permalink / raw)
Cc: bug-guile, guile-devel
Andreas Vögele <voegelas@gmx.net> writes:
> there are still C99isms in strings.c and threads.c.
Fixed, thanks.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-20 21:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-29 9:33 More C99isms Andreas Vögele
2004-09-20 21:48 ` Marius Vollmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).