lilypond-devel
[Top][All Lists]
Advanced

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

Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by add


From: hanwenn
Subject: Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden)
Date: Tue, 28 Jan 2020 14:06:32 -0800

https://codereview.appspot.com/577410045/diff/571430047/lily/include/parse-scm.hh
File lily/include/parse-scm.hh (right):

https://codereview.appspot.com/577410045/diff/571430047/lily/include/parse-scm.hh#newcode30
lily/include/parse-scm.hh:30: SCM parse_embedded_scheme (Input *i, bool
safe, Lily_parser *parser);
On 2020/01/27 13:39:31, Dan Eble wrote:
> Changing Input& to Input* is more than cosmetic.  Input& requires an
object, but
> Input* admits a nullptr.  I'm concerned that I don't see that any
checks have
> been added before the pointer is dereferenced.

This code stores a reference, which is completely out of style in
LilyPond.

In general, pointers are preferred in function signatures, so you can
see that the value is mutated in the call site. See also
https://google.github.io/styleguide/cppguide.html#Reference_Arguments

What would we do in a check? Passing a null input is a programming
error; if we don't check, we'll generate a segfault and that seems
appropriate for a programming error.

https://codereview.appspot.com/577410045/



reply via email to

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