summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-22 20:42:09 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-22 20:42:09 +0000
commit21d3f3889ede9bd4b2c48424715e44ad2c405500 (patch)
tree720382f460c5e6139f7aedc9f9106ef9a6cb3675
parent9de1a9516f1fad4cc669cb7622b8f2828eddcbf9 (diff)
Add -Wextra and fix the warnings.
-rw-r--r--src/lib/combiner.cc4
-rw-r--r--src/lib/decoder.cc5
-rw-r--r--src/lib/film.cc3
-rw-r--r--src/lib/util.cc1
-rw-r--r--src/tools/dvdomatic.cc4
-rw-r--r--src/wx/config_dialog.cc2
-rw-r--r--src/wx/film_viewer.cc6
-rw-r--r--test/test.cc4
-rw-r--r--wscript2
9 files changed, 16 insertions, 15 deletions
diff --git a/src/lib/combiner.cc b/src/lib/combiner.cc
index d5f55026b..68aafd2a2 100644
--- a/src/lib/combiner.cc
+++ b/src/lib/combiner.cc
@@ -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;
}
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc
index 61e63460b..7066b488e 100644
--- a/src/lib/decoder.cc
+++ b/src/lib/decoder.cc
@@ -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");
}
diff --git a/src/lib/film.cc b/src/lib/film.cc
index e7687fe3c..1abf8e91f 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -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)
diff --git a/src/lib/util.cc b/src/lib/util.cc
index a68496e94..45965385c 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -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 {
diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc
index 9d0d58662..055c5a066 100644
--- a/src/tools/dvdomatic.cc
+++ b/src/tools/dvdomatic.cc
@@ -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
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index abc6bcdeb..adf039e41 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -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);
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 73ed13e50..3d8198457 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -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);
diff --git a/test/test.cc b/test/test.cc
index d2c589951..6d4cca060 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -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 1c3cee1b4..13969cbfa 100644
--- 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'])