summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1d142bf)
-) 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.
-) Remove unneccessary #(set-paper-size "a6") in the regtests
-) fix bad texinfo code in function documentation
get_working_directory ()
{
char cwd[PATH_MAX];
get_working_directory ()
{
char cwd[PATH_MAX];
- getcwd (cwd, PATH_MAX);
-
- return string (cwd);
+ // getcwd returns NULL upon a failure, contents of cwd would be undefined!
+ return string (getcwd (cwd, PATH_MAX));
}
/* Join components to full file_name. */
}
/* Join components to full file_name. */
-#(set-paper-size "a6")
-
\layout { ragged-right= ##t }
\layout { ragged-right= ##t }
-#(set-paper-size "a6")
-
\layout { ragged-right= ##t }
\layout { ragged-right= ##t }
continue;
int n1 = robust_scm2int (scm_car (candidate), -1);
int n2 = robust_scm2int (scm_cdr (candidate), -1);
continue;
int n1 = robust_scm2int (scm_car (candidate), -1);
int n2 = robust_scm2int (scm_cdr (candidate), -1);
- if (n1 < 0 || n2 < 0 || n1 >= note_heads.size ())
+ if ((n1 < 0) || (n2 < 0) || (size_t(n1) >= note_heads.size ()))
continue;
note_column_1.push_back (vsize (n1));
note_column_2.push_back (vsize (n2));
continue;
note_column_1.push_back (vsize (n1));
note_column_2.push_back (vsize (n2));
else
{
File_name out (output_name);
else
{
File_name out (output_name);
- if (is_dir (out.dir_part ()))
- {
- dir = out.dir_part ();
- out_file_name = out.file_part ();
- }
+ dir = out.dir_part ();
+ out_file_name = out.file_part ();
}
if (dir != "" && dir != "." && dir != get_working_directory ())
{
global_path.prepend (get_working_directory ());
}
if (dir != "" && dir != "." && dir != get_working_directory ())
{
global_path.prepend (get_working_directory ());
- message (_f ("Changing working directory to: `%s'",
- dir.c_str ()));
- chdir (dir.c_str ());
+ message (_f ("Changing working directory to: `%s'", dir));
+ // If we can't change to the output dir (not existing, wrong
+ // permissions), exit lilypond
+ if (chdir (dir.c_str ()) != 0)
+ error (_f ("unable to change directory to: `%s'", dir));
}
else
out_file_name = File_name (output_name);
}
else
out_file_name = File_name (output_name);
IMPLEMENT_LISTENER (Lyric_combine_music_iterator, check_new_context)
void
IMPLEMENT_LISTENER (Lyric_combine_music_iterator, check_new_context)
void
-Lyric_combine_music_iterator::check_new_context (SCM sev)
+Lyric_combine_music_iterator::check_new_context (SCM /*sev*/)
-Skyline::Skyline (Skyline const &src, Real horizon_padding, Axis a)
+Skyline::Skyline (Skyline const &src, Real horizon_padding, Axis /*a*/)
{
/*
We extract boxes from the skyline, then build a new skyline from
{
/*
We extract boxes from the skyline, then build a new skyline from
list<Box> boxes;
// establish a baseline box
list<Box> boxes;
// establish a baseline box
+ // FIXME: This has hardcoded logic, assuming a == X_AXIS!
boxes.push_back (Box (Interval (-infinity_f, infinity_f),
Interval (0, 0)));
list<Building>::const_iterator end = src.buildings_.end ();
boxes.push_back (Box (Interval (-infinity_f, infinity_f),
Interval (0, 0)));
list<Building>::const_iterator end = src.buildings_.end ();
shiftDurations =
#(define-music-function (parser location dur dots arg)
(integer? integer? ly:music?)
shiftDurations =
#(define-music-function (parser location dur dots arg)
(integer? integer? ly:music?)
- (_i "Scale @var{arg} up by a factor of @var{2^dur*(2-(1/2)^dots)}.")
+ (_i "Scale @var{arg} up by a factor of 2^@var{dur}*(2-(1/2)^@var{dots}).")
#(define-music-function (parser location key-symbol tuning shape-definition)
(symbol? pair? string-or-pair?)
(_i "Add chord shape @var{shape-definition} to the @var{chord-shape-table}
#(define-music-function (parser location key-symbol tuning shape-definition)
(symbol? pair? string-or-pair?)
(_i "Add chord shape @var{shape-definition} to the @var{chord-shape-table}
-hash with the key @var{(cons key-symbol tuning)}.")
+hash with the key @code{(cons @var{key-symbol} @var{tuning})}.")
(hash-set! chord-shape-table
(cons key-symbol tuning)
shape-definition)
(hash-set! chord-shape-table
(cons key-symbol tuning)
shape-definition)
return extract_sections (filepath)[1]
if not (include_name in known_missing_files):
# Not found
return extract_sections (filepath)[1]
if not (include_name in known_missing_files):
# Not found
- print 'No such file: ' + include_name
- print 'Search path: ' + ':'.join (include_path)
+ print 'Warning: No such file: ' + include_name + \
+ ' (search path: ' + ':'.join (include_path)+')'
return ''
lang_re = re.compile (r'^@documentlanguage (.+)', re.M)
return ''
lang_re = re.compile (r'^@documentlanguage (.+)', re.M)