From: Han-Wen Nienhuys Date: Tue, 23 Jan 2007 02:50:54 +0000 (+0100) Subject: don't change signatures depending on NDEBUG X-Git-Tag: release/2.11.14-1~63 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d6266e3ac49a9ab150eeec69d87b355dc685c510;p=lilypond.git don't change signatures depending on NDEBUG --- diff --git a/lily/context.cc b/lily/context.cc index 15bd3c5fb8..7e5ea8ae2a 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -461,18 +461,8 @@ Context::add_alias (SCM sym) } void -Context::internal_set_property (SCM sym, SCM val -#ifndef NDEBUG - , char const *file, int line, char const *fun -#endif - ) +Context::internal_set_property (SCM sym, SCM val) { -#ifndef NDEBUG - (void) file; - (void) line; - (void) fun; -#endif - if (do_internal_type_checking_global) assert (type_check_assignment (sym, val, ly_symbol2scm ("translation-type?"))); diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 5e49d8e8ec..b62a6bb9f9 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -53,7 +53,13 @@ Grob::get_property_alist_chain (SCM def) const extern void check_interfaces_for_property (Grob const *me, SCM sym); -#ifndef NDEBUG +#if 0 + +/* + We can't change signatures depending on NDEBUG, since NDEBUG comes + over the command line and may be different per .cc file. This + should be done through the macro expansion of get_property(). + */ void Grob::internal_set_property (SCM sym, SCM v, char const *file, int line, char const *fun) { @@ -82,6 +88,8 @@ Grob::internal_set_property (SCM sym, SCM v, char const *file, int line, char co sym, v, SCM_UNDEFINED)); } #else + + void Grob::internal_set_property (SCM sym, SCM v) { diff --git a/lily/include/context.hh b/lily/include/context.hh index 2cb0280ea1..39babf7b66 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -85,11 +85,7 @@ public: Context *where_defined (SCM name_sym, SCM *value) const; void unset_property (SCM var_sym); -#ifndef NDEBUG - void internal_set_property (SCM var_sym, SCM value, char const *file, int line, char const *fun); -#else void internal_set_property (SCM var_sym, SCM value); -#endif Context *create_context (Context_def *, string, SCM); DECLARE_LISTENER (create_context_from_event); diff --git a/lily/include/grob.hh b/lily/include/grob.hh index c66c58f2dd..bcd101b98e 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -83,12 +83,7 @@ public: SCM internal_get_object (SCM symbol) const; void internal_set_object (SCM sym, SCM val); void internal_del_property (SCM symbol); - -#ifndef NDEBUG - void internal_set_property (SCM sym, SCM val, char const *file, int line, char const *fun); -#else void internal_set_property (SCM sym, SCM val); -#endif /* messages */ void warning (string) const; diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index dec12d19bd..555d65bfd3 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -169,7 +169,11 @@ ly_add_function_documentation (SCM proc, char const *fname, #define del_property(x) internal_del_property (ly_symbol2scm (x)) #ifndef NDEBUG -#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y, __FILE__, __LINE__, __FUNCTION__) +/* + TODO: include modification callback support here, perhaps + through intermediate Grob::instrumented_set_property( .. __LINE__ ). + */ +#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y) #else #define set_property(x, y) internal_set_property (ly_symbol2scm (x), y) #endif diff --git a/lily/include/prob.hh b/lily/include/prob.hh index 136dd3c9d6..839edd4aba 100644 --- a/lily/include/prob.hh +++ b/lily/include/prob.hh @@ -42,12 +42,7 @@ public: SCM type () const { return type_; } SCM get_property_alist (bool mutble) const; SCM internal_get_property (SCM sym) const; - -#ifndef NDEBUG - void internal_set_property (SCM sym, SCM val, const char *file, int line, char const *fun); -#else void internal_set_property (SCM sym, SCM val); -#endif }; DECLARE_UNSMOB(Prob,prob); SCM ly_prob_set_property_x (SCM system, SCM sym, SCM value); diff --git a/lily/prob.cc b/lily/prob.cc index 7438de3dcb..e6facbddc5 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -158,18 +158,8 @@ Prob::internal_get_property (SCM sym) const } void -Prob::internal_set_property (SCM sym, SCM val -#ifndef NDEBUG - , char const *file, int line, char const *fun -#endif - ) +Prob::internal_set_property (SCM sym, SCM val) { -#ifndef NDEBUG - (void) file; - (void) line; - (void) fun; -#endif - if (do_internal_type_checking_global) type_check_assignment (sym, val);