On 3 nov. 2012, at 12:26, d...@gnu.org wrote: > http://codereview.appspot.com/6584045/diff/12001/lily/stem.cc#newcode812 > lily/stem.cc:812: Real beg = robust_scm2double (me->get_pure_property > ("stem-begin-position", 0, INT_MAX), 0.0); > Using robust_scm2double does not help when me is 0. This still needs > LY_ASSERT_TYPE or similar. >
Hey David, I finally had a chance to read these over - many thanks! For LY_ASSERT_TYPE, I agree with you that this should be used all over the place. Unfortunately, it is not. If you read the code base, you will see that almost every single callback leaves grobs untested, which would cause segfaults for null pointers. I think the best idea would be to open up a separate tracker issue that talks about this problem. Given how often the first argument of scheme callbacks is a grob, it may be worth it to create macros MAKE_SCHEME_GROB_CALLBACK, MAKE_SCHEME_ITEM_CALLBACK, and MAKE_SCHEME_SPANNER_CALLBACK. The macros would roll in a LY_ASSERT_TYPE, thus avoiding writing it out in every function. I'll make sure to fix everything in your other comments, but stuff pertaining to LY_ASSERT_TYPE should wait until we figure out a policy on how this should be handled across all callbacks. While we wait for that to get sorted out, we could create a moratorium on pushing any patches that create new callbacks, although I think that'd be a bit excessive. Cheers, MS _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel