Add -Wextra and fix the warnings.
authorCarl Hetherington <cth@carlh.net>
Sat, 22 Dec 2012 20:42:09 +0000 (20:42 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 22 Dec 2012 20:42:09 +0000 (20:42 +0000)
src/lib/combiner.cc
src/lib/decoder.cc
src/lib/film.cc
src/lib/util.cc
src/tools/dvdomatic.cc
src/wx/config_dialog.cc
src/wx/film_viewer.cc
test/test.cc
wscript

index d5f55026b54f8c14c597820fb6d1c454cf7c43b0..68aafd2a24d97d65b183dfcf97f0edd97a5fb48c 100644 (file)
@@ -29,11 +29,11 @@ Combiner::Combiner (Log* log)
 }
 
 /** Process video for the left half of the frame.
+ *  Subtitle parameter will be ignored.
  *  @param image Frame image.
- *  @param sub Subtitle (which will be ignored)
  */
 void
-Combiner::process_video (shared_ptr<Image> image, bool, shared_ptr<Subtitle> sub)
+Combiner::process_video (shared_ptr<Image> image, bool, shared_ptr<Subtitle>)
 {
        _image = image;
 }
index 61e63460bae8469d4650e6fa65932ef8b4a74fef..7066b488e6507352320c06767caaa216218c0275 100644 (file)
@@ -57,12 +57,11 @@ Decoder::Decoder (boost::shared_ptr<Film> f, boost::shared_ptr<const DecodeOptio
        _film_connection = f->Changed.connect (bind (&Decoder::film_changed, this, _1));
 }
 
-/** Seek.
- *  @param p Position as a source timestamp in seconds.
+/** Seek to a position as a source timestamp in seconds.
  *  @return true on error.
  */
 bool
-Decoder::seek (double p)
+Decoder::seek (double)
 {
        throw DecodeError ("decoder does not support seek");
 }
index e7687fe3c14f90e09a8ccbbe0ba63d1e8eece7ad..1abf8e91f0ad780f8fbdfc8d929caec66c75dfaa 100644 (file)
@@ -141,7 +141,8 @@ Film::Film (string d, bool must_exist)
 }
 
 Film::Film (Film const & o)
-       : _log (0)
+       : boost::enable_shared_from_this<Film> (o)
+       , _log (0)
        , _directory         (o._directory)
        , _name              (o._name)
        , _use_dci_name      (o._use_dci_name)
index a68496e94260bf90b5ab6bda607f709470d393a8..45965385c6c9b4f5e4bdb9202be0671b2335f720 100644 (file)
@@ -428,6 +428,7 @@ Socket::check ()
 void
 Socket::connect (asio::ip::basic_resolver_entry<asio::ip::tcp> const & endpoint, int timeout)
 {
+       _deadline.expires_from_now (posix_time::seconds (timeout));
        system::error_code ec = asio::error::would_block;
        _socket.async_connect (endpoint, lambda::var(ec) = lambda::_1);
        do {
index 9d0d586628ace4edd7317acfc5abc16cf200814c..055c5a0662cee89269a633612f25c8591552df40 100644 (file)
@@ -372,13 +372,13 @@ public:
 static const wxCmdLineEntryDesc command_line_description[] = {
        { wxCMD_LINE_OPTION, "l", "log", "set log level (silent, verbose or timing)", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
         { wxCMD_LINE_PARAM, 0, 0, "film to load", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
-       { wxCMD_LINE_NONE }
+       { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 }
 };
 #else
 static const wxCmdLineEntryDesc command_line_description[] = {
        { wxCMD_LINE_OPTION, wxT("l"), wxT("log"), wxT("set log level (silent, verbose or timing)"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
         { wxCMD_LINE_PARAM, 0, 0, wxT("film to load"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
-       { wxCMD_LINE_NONE }
+       { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 }
 };
 #endif
 
index abc6bcdeb10db2f240b19cdfe911226d6be336a2..adf039e41f09045ab2b49b1f174abf55c8ef9efc 100644 (file)
@@ -307,7 +307,7 @@ ConfigDialog::remove_server_clicked (wxCommandEvent &)
 }
 
 void
-ConfigDialog::server_selection_changed (wxListEvent& ev)
+ConfigDialog::server_selection_changed (wxListEvent &)
 {
        int const i = _servers->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        _edit_server->Enable (i >= 0);
index 73ed13e50aa0d9c7ba9281d636c85a4785822cb0..3d8198457db1a3c342290087fe938408d63a11c1 100644 (file)
@@ -81,7 +81,7 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
        _play_button->Connect (wxID_ANY, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler (FilmViewer::play_clicked), 0, this);
        _timer.Connect (wxID_ANY, wxEVT_TIMER, wxTimerEventHandler (FilmViewer::timer), 0, this);
 
-       set_film (_film);
+       set_film (f);
 
        JobManager::instance()->ActiveJobsChanged.connect (
                bind (&FilmViewer::active_jobs_changed, this, _1)
@@ -165,7 +165,7 @@ FilmViewer::decoder_changed ()
 }
 
 void
-FilmViewer::timer (wxTimerEvent& ev)
+FilmViewer::timer (wxTimerEvent &)
 {
        if (!_film) {
                return;
@@ -186,7 +186,7 @@ FilmViewer::timer (wxTimerEvent& ev)
 
 
 void
-FilmViewer::paint_panel (wxPaintEvent& ev)
+FilmViewer::paint_panel (wxPaintEvent &)
 {
        wxPaintDC dc (_panel);
 
index d2c58995125681fb26964768f97ce49dd0defbd0..6d4cca060f5d6f6304f0a648ee691a55573c663f 100644 (file)
@@ -315,7 +315,7 @@ BOOST_AUTO_TEST_CASE (paths_test)
 }
 
 void
-do_remote_encode (shared_ptr<DCPVideoFrame> frame, ServerDescription* description, shared_ptr<EncodedData> locally_encoded, int N)
+do_remote_encode (shared_ptr<DCPVideoFrame> frame, ServerDescription* description, shared_ptr<EncodedData> locally_encoded)
 {
        shared_ptr<EncodedData> remotely_encoded;
        BOOST_CHECK_NO_THROW (remotely_encoded = frame->encode_remotely (description));
@@ -385,7 +385,7 @@ BOOST_AUTO_TEST_CASE (client_server_test)
 
        list<thread*> threads;
        for (int i = 0; i < 8; ++i) {
-               threads.push_back (new thread (boost::bind (do_remote_encode, frame, &description, locally_encoded, i)));
+               threads.push_back (new thread (boost::bind (do_remote_encode, frame, &description, locally_encoded)));
        }
 
        for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
diff --git a/wscript b/wscript
index 1c3cee1b4f41e13e7c5ab5c8c977b8ba352c1f05..13969cbfa34fd73ff90f61aebc2dc76d2dba1d4c 100644 (file)
--- a/wscript
+++ b/wscript
@@ -19,7 +19,7 @@ def configure(conf):
     if conf.options.target_windows:
         conf.load('winres')
 
-    conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing', '-Wall', '-Wno-attributes'])
+    conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing', '-Wall', '-Wno-attributes', '-Wextra'])
 
     if conf.options.target_windows:
         conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE'])