lilypond-devel
[Top][All Lists]
Advanced

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

Re: lily: fix some type conversion warnings (issue 557190043 by address@


From: nine . fierce . ballads
Subject: Re: lily: fix some type conversion warnings (issue 557190043 by address@hidden)
Date: Tue, 21 Jan 2020 07:21:56 -0800


https://codereview.appspot.com/557190043/diff/581490044/lily/pointer-group-interface.cc
File lily/pointer-group-interface.cc (right):

https://codereview.appspot.com/557190043/diff/581490044/lily/pointer-group-interface.cc#newcode30
lily/pointer-group-interface.cc:30: return arr ? int (arr->size ()) : 0;
MHO: Return a vsize.  Somewhere, sometime, someone will probably say,

    my_things_.size () < pgi.count ()

and the compiler will warn about comparing int to size_t.

I don't suggest that you switch to vsize and ferret out all the
consequences at this time if you don't want to invest your time in that,
but that it's better to leave this line alone and live with the warning
until there is time to take a proper look.

https://codereview.appspot.com/557190043/diff/581490044/lily/quote-iterator.cc
File lily/quote-iterator.cc (right):

https://codereview.appspot.com/557190043/diff/581490044/lily/quote-iterator.cc#newcode104
lily/quote-iterator.cc:104: int hi = int (scm_c_vector_length (vec));
If scm_c_vector_length () is returning size_t, then why don't we work in
terms of size_t?  Any place I see a cast, especially a C-style cast, I
feel the urge to stop and ask, "Why is this OK?"  So I'd rather not see
them where they can be avoided.

https://codereview.appspot.com/557190043/diff/581490044/lily/stem.cc
File lily/stem.cc (right):

https://codereview.appspot.com/557190043/diff/581490044/lily/stem.cc#newcode94
lily/stem.cc:94: int len = int (scm_ilength (lst)); // -1 for dotted
lists!
ditto

https://codereview.appspot.com/557190043/



reply via email to

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