diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-01 13:43:41 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-01 13:43:41 +0100 |
| commit | 6bc83f72f12c8513a1e9e9b6fd880697a73f968f (patch) | |
| tree | 2b7f8b1456aea84dc088b5638524e908585c7e6e /src/lib | |
| parent | a6b3b4539ae17ce59f975a4be49278f4ccc736fd (diff) | |
while (1) -> while (true)
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/cross.cc | 4 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 2 | ||||
| -rw-r--r-- | src/lib/ffmpeg_examiner.cc | 2 | ||||
| -rw-r--r-- | src/lib/file_group.cc | 2 | ||||
| -rw-r--r-- | src/lib/filter_graph.cc | 2 | ||||
| -rw-r--r-- | src/lib/internet.cc | 2 | ||||
| -rw-r--r-- | src/lib/job_manager.cc | 2 | ||||
| -rw-r--r-- | src/lib/json_server.cc | 4 | ||||
| -rw-r--r-- | src/lib/resampler.cc | 2 | ||||
| -rw-r--r-- | src/lib/server.cc | 4 | ||||
| -rw-r--r-- | src/lib/server_finder.cc | 2 | ||||
| -rw-r--r-- | src/lib/update.cc | 2 | ||||
| -rw-r--r-- | src/lib/writer.cc | 6 |
13 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 70f643913..e30cf6459 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -202,7 +202,7 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share CloseHandle (child_stderr_write); - while (1) { + while (true) { char buffer[512]; DWORD read; if (!ReadFile(child_stderr_read, buffer, sizeof(buffer), &read, 0) || read == 0) { @@ -247,7 +247,7 @@ mount_info () return m; } - while (1) { + while (true) { struct mntent* mnt = getmntent (f); if (!mnt) { break; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index a51b521d0..07f988e2b 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -360,7 +360,7 @@ FFmpegDecoder::seek (VideoContent::Frame frame, bool accurate) return; } - while (1) { + while (true) { int r = av_read_frame (_format_context, &_packet); if (r < 0) { return; diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index d73063083..bc82a9700 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -63,7 +63,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c) /* Run through until we find the first audio (for each stream) and video */ - while (1) { + while (true) { int r = av_read_frame (_format_context, &_packet); if (r < 0) { break; diff --git a/src/lib/file_group.cc b/src/lib/file_group.cc index 9d042554c..048f69233 100644 --- a/src/lib/file_group.cc +++ b/src/lib/file_group.cc @@ -142,7 +142,7 @@ int FileGroup::read (uint8_t* buffer, int amount) const { int read = 0; - while (1) { + while (true) { int const this_time = fread (buffer + read, 1, amount - read, _current_file); read += this_time; if (read == amount) { diff --git a/src/lib/filter_graph.cc b/src/lib/filter_graph.cc index a36a41f43..c11ee6331 100644 --- a/src/lib/filter_graph.cc +++ b/src/lib/filter_graph.cc @@ -142,7 +142,7 @@ FilterGraph::process (AVFrame* frame) throw DecodeError (N_("could not push buffer into filter chain.")); } - while (1) { + while (true) { if (av_buffersink_get_frame (_buffer_sink_context, _frame) < 0) { break; } diff --git a/src/lib/internet.cc b/src/lib/internet.cc index c3f9dce65..99ae5c214 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -80,7 +80,7 @@ get_from_zip_url (string url, string file, function<void (boost::filesystem::pat ScopedTemporary temp_cert; f = temp_cert.open ("wb"); char buffer[4096]; - while (1) { + while (true) { int const N = zip_fread (zip_file, buffer, sizeof (buffer)); fwrite (buffer, 1, N, f); if (N < int (sizeof (buffer))) { diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc index 056b9f925..2b727b0aa 100644 --- a/src/lib/job_manager.cc +++ b/src/lib/job_manager.cc @@ -106,7 +106,7 @@ JobManager::errors () const void JobManager::scheduler () { - while (1) { + while (true) { bool active_jobs = false; diff --git a/src/lib/json_server.cc b/src/lib/json_server.cc index f4aa292d7..1be3c7d0e 100644 --- a/src/lib/json_server.cc +++ b/src/lib/json_server.cc @@ -58,7 +58,7 @@ try { boost::asio::io_service io_service; tcp::acceptor a (io_service, tcp::endpoint (tcp::v4 (), port)); - while (1) { + while (true) { try { shared_ptr<tcp::socket> s (new tcp::socket (io_service)); a.accept (*s); @@ -80,7 +80,7 @@ JSONServer::handle (shared_ptr<tcp::socket> socket) string url; State state = AWAITING_G; - while (1) { + while (true) { char data[MAX_LENGTH]; boost::system::error_code error; size_t len = socket->read_some (boost::asio::buffer (data), error); diff --git a/src/lib/resampler.cc b/src/lib/resampler.cc index e6b1623d9..e7f50c4b7 100644 --- a/src/lib/resampler.cc +++ b/src/lib/resampler.cc @@ -91,7 +91,7 @@ Resampler::flush () int64_t const pass_size = 256; shared_ptr<AudioBuffers> pass (new AudioBuffers (_channels, 256)); - while (1) { + while (true) { int const frames = swr_convert (_swr_context, (uint8_t **) pass->data(), pass_size, 0, 0); if (frames < 0) { diff --git a/src/lib/server.cc b/src/lib/server.cc index 7450fd12e..f1c6d6c44 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -115,7 +115,7 @@ Server::process (shared_ptr<Socket> socket, struct timeval& after_read, struct t void Server::worker_thread () { - while (1) { + while (true) { boost::mutex::scoped_lock lock (_worker_mutex); while (_queue.empty ()) { _empty_condition.wait (lock); @@ -194,7 +194,7 @@ Server::run (int num_threads) boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), Config::instance()->server_port_base ()) ); - while (1) { + while (true) { shared_ptr<Socket> socket (new Socket); acceptor.accept (socket->socket ()); diff --git a/src/lib/server_finder.cc b/src/lib/server_finder.cc index ed6016c67..65e0940a0 100644 --- a/src/lib/server_finder.cc +++ b/src/lib/server_finder.cc @@ -103,7 +103,7 @@ void ServerFinder::listen_thread () try { - while (1) { + while (true) { shared_ptr<Socket> sock (new Socket (60)); try { diff --git a/src/lib/update.cc b/src/lib/update.cc index 34eaf385c..af3e46f0e 100644 --- a/src/lib/update.cc +++ b/src/lib/update.cc @@ -85,7 +85,7 @@ UpdateChecker::run () void UpdateChecker::thread () { - while (1) { + while (true) { boost::mutex::scoped_lock lock (_process_mutex); while (_to_do == 0) { _condition.wait (lock); diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 01da6d3b4..66ddb58f7 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -238,11 +238,11 @@ void Writer::thread () try { - while (1) + while (true) { boost::mutex::scoped_lock lock (_mutex); - while (1) { + while (true) { if (_finish || _queued_full_in_memory > _maximum_frames_in_memory || have_sequenced_image_at_queue_head ()) { /* We've got something to do: go and do it */ @@ -563,7 +563,7 @@ Writer::check_existing_picture_mxf () ++N; } - while (1) { + while (true) { shared_ptr<Job> job = _job.lock (); assert (job); |
