]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 5069: Avoid using void * as SCM
authorDavid Kastrup <dak@gnu.org>
Tue, 14 Feb 2017 12:41:52 +0000 (13:41 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 20 Feb 2017 14:35:17 +0000 (15:35 +0100)
This is not really type-safe.  Using an SCM * instead is unproblematic.

lily/module-scheme.cc

index 8ea17ddb26d6d434594ac59e4459669ed0972190..eda467fe68b259336663f08ccfaf72f1e2818afb 100644 (file)
@@ -33,7 +33,7 @@ module_define_closure_func (void *closure,
                             SCM val,
                             SCM /* result */)
 {
-  SCM module = (SCM) closure;
+  SCM module = *static_cast<SCM *> (closure);
   if (to_boolean (scm_variable_bound_p (val)))
     scm_module_define (module, key, scm_variable_ref (val));
   return SCM_EOL;
@@ -46,7 +46,7 @@ LY_DEFINE (ly_module_copy, "ly:module-copy",
 #define FUNC_NAME __FUNCTION__
   SCM_VALIDATE_MODULE (1, src);
   scm_internal_hash_fold ((scm_t_hash_fold_fn) &module_define_closure_func,
-                          (void *) dest,
+                          static_cast<void *> (&dest),
                           SCM_EOL, SCM_MODULE_OBARRAY (src));
   return SCM_UNSPECIFIED;
 }