guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-6-80-g9fd


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-6-80-g9fdee5b
Date: Thu, 07 Jan 2010 09:47:57 +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=9fdee5b40b190585f3fac949a366dfcf06ad202a

The branch, master has been updated
       via  9fdee5b40b190585f3fac949a366dfcf06ad202a (commit)
      from  fd629322442e3a7131d779a266745ffd05e83c56 (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 9fdee5b40b190585f3fac949a366dfcf06ad202a
Author: Andy Wingo <address@hidden>
Date:   Thu Jan 7 10:40:38 2010 +0100

    fix compiler warnings in foreign.c
    
    * libguile/foreign.c (scm_c_from_foreign, scm_c_take_foreign): Fix
      compiler warnings on 64-bit machines.

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

Summary of changes:
 libguile/foreign.c |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/libguile/foreign.c b/libguile/foreign.c
index cdf58b3..4a4b218 100644
--- a/libguile/foreign.c
+++ b/libguile/foreign.c
@@ -60,58 +60,59 @@ SCM
 scm_c_from_foreign (scm_t_foreign_type type, void *val, size_t size,
                     scm_t_foreign_finalizer finalizer)
 {
-  void *ret;
+  SCM ret;
   if (!size)
     size = sizeof_type (type);
     
-  ret = scm_gc_malloc_pointerless (sizeof (scm_t_bits) * 2 + size, "foreign");
-  SCM_SET_CELL_WORD_0 (PTR2SCM (ret), scm_tc7_foreign | (type<<8));
+  ret = PTR2SCM (scm_gc_malloc_pointerless (sizeof (scm_t_bits) * 2 + size,
+                                            "foreign"));
+  SCM_SET_CELL_WORD_0 (ret, (scm_t_bits)(scm_tc7_foreign | (type<<8)));
 
   /* set SCM_FOREIGN_OBJECT to point to the third word of the object, which 
will
      be 8-byte aligned. Then copy *val into that space. */
-  SCM_SET_CELL_WORD_1 (PTR2SCM (ret),
-                       (scm_t_bits)SCM_CELL_OBJECT_LOC (PTR2SCM (ret), 2));
-  memcpy (SCM_FOREIGN_OBJECT (PTR2SCM (ret), void), val, size);
+  SCM_SET_CELL_WORD_1 (ret, (scm_t_bits)SCM_CELL_OBJECT_LOC (ret, 2));
+  memcpy (SCM_FOREIGN_OBJECT (ret, void), val, size);
 
   if (finalizer)
     {
       /* Register a finalizer for the newly created instance.  */
       GC_finalization_proc prev_finalizer;
       GC_PTR prev_finalizer_data;
-      GC_REGISTER_FINALIZER_NO_ORDER (ret,
+      GC_REGISTER_FINALIZER_NO_ORDER (SCM2PTR (ret),
                                       foreign_finalizer_trampoline,
                                       finalizer,
                                       &prev_finalizer,
                                       &prev_finalizer_data);
     }
 
-  return PTR2SCM (ret);
+  return ret;
 }
 
 SCM
 scm_c_take_foreign (scm_t_foreign_type type, void *val,
                     scm_t_foreign_finalizer finalizer)
 {
-  void *ret;
+  SCM ret;
     
-  ret = scm_gc_malloc_pointerless (sizeof (scm_t_bits) * 2, "foreign");
-  SCM_SET_CELL_WORD_0 (PTR2SCM (ret), scm_tc7_foreign | (type<<8));
+  ret = PTR2SCM (scm_gc_malloc_pointerless (sizeof (scm_t_bits) * 2,
+                                            "foreign"));
+  SCM_SET_CELL_WORD_0 (ret, (scm_t_bits)(scm_tc7_foreign | (type<<8)));
   /* Set SCM_FOREIGN_OBJECT to the given pointer. */
-  SCM_SET_CELL_WORD_1 (PTR2SCM (ret), (scm_t_bits)val);
+  SCM_SET_CELL_WORD_1 (ret, (scm_t_bits)val);
 
   if (finalizer)
     {
       /* Register a finalizer for the newly created instance.  */
       GC_finalization_proc prev_finalizer;
       GC_PTR prev_finalizer_data;
-      GC_REGISTER_FINALIZER_NO_ORDER (ret,
+      GC_REGISTER_FINALIZER_NO_ORDER (SCM2PTR (ret),
                                       foreign_finalizer_trampoline,
                                       finalizer,
                                       &prev_finalizer,
                                       &prev_finalizer_data);
     }
 
-  return PTR2SCM (ret);
+  return ret;
 }
 
 SCM_DEFINE (scm_foreign_ref, "foreign-ref", 1, 0, 0,


hooks/post-receive
-- 
GNU Guile




reply via email to

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