Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3738)

Issue 4854049: Get rid of some compiler warnings (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by Reinhold
Modified:
12 years, 8 months ago
Reviewers:
Keith, pkx166h, benko.pal, carl.d.sorensen, Graham Percival (old account)
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Get rid of some compiler warnings -) Some "unused parameter" warnings -) Some "ignoring return value" are a bit trickier. They are bad coding style: o) the file-name.cc one returns a string with undefined contents if getcwd fails, which might either crash guile or lead to other bugs. o) the lily-parser-scheme.cc warning was also a programming error (if you used --output=dir/file, and dir/ had the wrong permissions, then lilypond would not print an error, but simply put the output file into the current directory without telling the user!). In this case (output dir explicitly requested, but not possible to change there), I think it's best to exit lilypond with an error. -) signed/unsigned warning in glissando-engraver.cc, where we already had a check for negative values, so explicitly casting to unsigned shuts up the compiler. -) Wrap #(set-paper-size "a6") in the regtests with a \paper block -) fix bad texinfo code in function documentation

Patch Set 1 #

Patch Set 2 : Axis argument of Skyline should not be ignored. #

Total comments: 4

Patch Set 3 : One more unused variable #

Total comments: 5

Patch Set 4 : Fix regtest differences #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -22 lines) Patch
M flower/file-name.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M input/regression/completion-heads-factor.ly View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M input/regression/completion-rest.ly View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M lily/glissando-engraver.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M lily/lily-parser-scheme.cc View 1 chunk +7 lines, -8 lines 0 comments Download
M lily/lyric-combine-music-iterator.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lily/skyline.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M ly/music-functions-init.ly View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ly/predefined-fretboards-init.ly View 1 chunk +1 line, -1 line 0 comments Download
M scripts/build/extract_texi_filenames.py View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 7
Carl
LGTM, with a few comments. Thanks, Carl http://codereview.appspot.com/4854049/diff/2001/lily/skyline.cc File lily/skyline.cc (right): http://codereview.appspot.com/4854049/diff/2001/lily/skyline.cc#newcode417 lily/skyline.cc:417: buildings_ = ...
12 years, 8 months ago (2011-08-09 21:20:29 UTC) #1
Keith
Reinhold Kainhofer <reinhold <at> kainhofer.com> writes: LGTM > Am Freitag, 5. August 2011, 21:22:49 schrieb ...
12 years, 8 months ago (2011-08-10 04:39:24 UTC) #2
Graham Percival (old account)
http://codereview.appspot.com/4854049/diff/5001/input/regression/completion-heads-factor.ly File input/regression/completion-heads-factor.ly (right): http://codereview.appspot.com/4854049/diff/5001/input/regression/completion-heads-factor.ly#newcode12 input/regression/completion-heads-factor.ly:12: \paper { #(set-paper-size "a6") } is this part of ...
12 years, 8 months ago (2011-08-10 05:19:42 UTC) #3
Graham Percival (old account)
On 2011/08/10 05:19:42, Graham Percival wrote: > input/regression/completion-heads-factor.ly:12: \paper { #(set-paper-size "a6") > } > ...
12 years, 8 months ago (2011-08-10 05:20:48 UTC) #4
pkx166h
Passes make but there are some reg test differences see http://code.google.com/p/lilypond/issues/detail?id=804#c6
12 years, 8 months ago (2011-08-10 21:21:09 UTC) #5
benko.pal
generally signed-unsigned problems are better solved by casting to size_t, not to unsigned - size_t ...
12 years, 8 months ago (2011-08-11 10:04:49 UTC) #6
Reinhold
12 years, 8 months ago (2011-08-15 13:44:58 UTC) #7
http://codereview.appspot.com/4854049/diff/5001/lily/glissando-engraver.cc
File lily/glissando-engraver.cc (right):

http://codereview.appspot.com/4854049/diff/5001/lily/glissando-engraver.cc#ne...
lily/glissando-engraver.cc:124: if (n1 < 0 || n2 < 0 || unsigned(n1) >=
note_heads.size ())
On 2011/08/10 05:19:42, Graham Percival wrote:
> Also, my initial preference would be to case note_heads.size() to int rather
> than n1 to unsigned, but I confess that I can't think of an actual rule as to
> why that is.  It's just from seeing things done that way more often than the
> alternative.

I deliberately casted n1 to unsigned, because we already checked that its value
is positive, so the cast will never ever change the value used in the check.
Casting note_head.size() to int might change the comparison and yield wrong
results (although, if we have more than 2^15 noteheads in a glissande, we
probably will have more serious problems, like memory issues; but still, casting
to unsigned is cleaner IMO).
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b