unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Andreas Vögele" <voegelas@gmx.net>
Cc: guile-devel@gnu.org
Subject: More C99isms
Date: Sun, 29 Aug 2004 11:33:55 +0200	[thread overview]
Message-ID: <8BA2884C-F99E-11D8-A510-000D93673682@gmx.net> (raw)

[-- 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

             reply	other threads:[~2004-08-29  9:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-29  9:33 Andreas Vögele [this message]
2004-09-20 21:48 ` More C99isms Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8BA2884C-F99E-11D8-A510-000D93673682@gmx.net \
    --to=voegelas@gmx.net \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).