From: David Kastrup Date: Tue, 14 Feb 2017 12:41:52 +0000 (+0100) Subject: Issue 5069: Avoid using void * as SCM X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=3fc70e3e7dfb3c26cb3e5bb9dcabc87cc758c24d;p=lilypond.git Issue 5069: Avoid using void * as SCM This is not really type-safe. Using an SCM * instead is unproblematic. --- diff --git a/lily/module-scheme.cc b/lily/module-scheme.cc index 8ea17ddb26..eda467fe68 100644 --- a/lily/module-scheme.cc +++ b/lily/module-scheme.cc @@ -33,7 +33,7 @@ module_define_closure_func (void *closure, SCM val, SCM /* result */) { - SCM module = (SCM) closure; + SCM module = *static_cast (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 (&dest), SCM_EOL, SCM_MODULE_OBARRAY (src)); return SCM_UNSPECIFIED; }