guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, string_abstraction2, updated. release_


From: Michael Gran
Subject: [Guile-commits] GNU Guile branch, string_abstraction2, updated. release_1-9-1-140-gbff44e1
Date: Wed, 12 Aug 2009 05:02:37 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=bff44e1bf5f2257492d9d9c5a0264467fc785823

The branch, string_abstraction2 has been updated
       via  bff44e1bf5f2257492d9d9c5a0264467fc785823 (commit)
      from  765f1320806d7f9c7543e057657c766f32a03c40 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bff44e1bf5f2257492d9d9c5a0264467fc785823
Author: Michael Gran <address@hidden>
Date:   Tue Aug 11 22:01:20 2009 -0700

    Avoid unitialized and unused warnings in scm_string_append
    
    * libguile/strings.c (scm_string_append): avoid warnings

-----------------------------------------------------------------------

Summary of changes:
 libguile/strings.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/libguile/strings.c b/libguile/strings.c
index 37a27f0..17fddc8 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1372,9 +1372,12 @@ SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1,
   size_t len = 0;
   int wide = 0;
   SCM l, s;
-  char *data;
-  scm_t_wchar *wdata;
   int i;
+  union
+  {
+    char *narrow;
+    scm_t_wchar *wide;
+  } data;
 
   SCM_VALIDATE_REST_ARGUMENT (args);
   for (l = args; !scm_is_null (l); l = SCM_CDR (l))
@@ -1385,10 +1388,11 @@ SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1,
       if (!scm_i_is_narrow_string (s))
         wide = 1;
     }
+  data.narrow = NULL;
   if (!wide)
-    res = scm_i_make_string (len, &data);
+    res = scm_i_make_string (len, &data.narrow);
   else
-    res = scm_i_make_wide_string (len, &wdata);
+    res = scm_i_make_wide_string (len, &data.wide);
 
   for (l = args; !scm_is_null (l); l = SCM_CDR (l))
     {
@@ -1397,20 +1401,20 @@ SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1,
       len = scm_i_string_length (s);
       if (!wide)
         {
-          memcpy (data, scm_i_string_chars (s), len);
-          data += len;
+          memcpy (data.narrow, scm_i_string_chars (s), len);
+          data.narrow += len;
         }
       else
         {
           if (scm_i_is_narrow_string (s))
             {
               for (i = 0; i < scm_i_string_length (s); i++)
-                wdata[i] = (unsigned char) scm_i_string_chars (s)[i];
+                data.wide[i] = (unsigned char) scm_i_string_chars (s)[i];
             }
           else
-            u32_cpy ((scm_t_uint32 *) wdata,
+            u32_cpy ((scm_t_uint32 *) data.wide,
                      (scm_t_uint32 *) scm_i_string_wide_chars (s), len);
-          wdata += len;
+          data.wide += len;
         }
       scm_remember_upto_here_1 (s);
     }


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]