diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 22:13:43 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 22:13:43 +0000 |
commit | 887cec87432cce92d06a39b62a9ce4f57260acc9 (patch) | |
tree | 910e78a9e37009c7774a097872d2769ca50226db /remoting | |
parent | 0c860d067e62556bad67620240abc9abfeb85c7d (diff) | |
download | chromium_src-887cec87432cce92d06a39b62a9ce4f57260acc9.zip chromium_src-887cec87432cce92d06a39b62a9ce4f57260acc9.tar.gz chromium_src-887cec87432cce92d06a39b62a9ce4f57260acc9.tar.bz2 |
Tighten up compile warnings based to match other chromium sub-projects.
Fix up the issues that the new warnings raised.
BUG=none
TEST=build remoting cleanly
Review URL: http://codereview.chromium.org/2801003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49842 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/base/multiple_array_input_stream_unittest.cc | 4 | ||||
-rw-r--r-- | remoting/base/protocol_decoder.cc | 9 | ||||
-rw-r--r-- | remoting/base/protocol_decoder.h | 6 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_plugin.cc | 1 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_plugin_unittest.cc | 5 | ||||
-rw-r--r-- | remoting/client/plugin/client.cc | 1 | ||||
-rw-r--r-- | remoting/client/plugin/compression.cc | 1 | ||||
-rw-r--r-- | remoting/client/simple_client.cc | 2 | ||||
-rw-r--r-- | remoting/client/x11_view.cc | 4 | ||||
-rw-r--r-- | remoting/host/client_connection.cc | 2 | ||||
-rw-r--r-- | remoting/host/differ_unittest.cc | 14 | ||||
-rw-r--r-- | remoting/host/encoder_verbatim.cc | 2 | ||||
-rw-r--r-- | remoting/host/session_manager.cc | 4 | ||||
-rw-r--r-- | remoting/jingle_glue/jingle_channel.cc | 2 | ||||
-rw-r--r-- | remoting/jingle_glue/jingle_client.cc | 3 | ||||
-rw-r--r-- | remoting/jingle_glue/jingle_thread.cc | 6 | ||||
-rw-r--r-- | remoting/remoting.gyp | 4 |
17 files changed, 35 insertions, 35 deletions
diff --git a/remoting/base/multiple_array_input_stream_unittest.cc b/remoting/base/multiple_array_input_stream_unittest.cc index 810596c..d8397c7 100644 --- a/remoting/base/multiple_array_input_stream_unittest.cc +++ b/remoting/base/multiple_array_input_stream_unittest.cc @@ -9,8 +9,8 @@ namespace remoting { -static int ReadFromInput(MultipleArrayInputStream* input, - void* data, int size) { +static size_t ReadFromInput(MultipleArrayInputStream* input, + void* data, size_t size) { uint8* out = reinterpret_cast<uint8*>(data); int out_size = size; diff --git a/remoting/base/protocol_decoder.cc b/remoting/base/protocol_decoder.cc index 3b60f2b..3724f5a 100644 --- a/remoting/base/protocol_decoder.cc +++ b/remoting/base/protocol_decoder.cc @@ -69,9 +69,8 @@ bool ProtocolDecoder::ParseOneMessage(T** message) { std::deque<int> buffer_sizes; while (next_payload_ > 0 && !data_list_.empty()) { scoped_refptr<media::DataBuffer> buffer = data_list_.front(); - int read_bytes = std::min( - static_cast<int>(buffer->GetDataSize()) - last_read_position_, - next_payload_); + size_t read_bytes = std::min(buffer->GetDataSize() - last_read_position_, + next_payload_); buffers.push_back(buffer); buffer_pointers.push_back(buffer->GetData() + last_read_position_); @@ -88,7 +87,7 @@ bool ProtocolDecoder::ParseOneMessage(T** message) { last_read_position_ = 0; } } - DCHECK_EQ(0, next_payload_); + DCHECK_EQ(0UL, next_payload_); DCHECK_EQ(buffers.size(), buffer_pointers.size()); DCHECK_EQ(buffers.size(), buffer_sizes.size()); @@ -108,7 +107,7 @@ bool ProtocolDecoder::ParseOneMessage(T** message) { bool ProtocolDecoder::GetPayloadSize(int* size) { // The header has a size of 4 bytes. - const int kHeaderSize = sizeof(int32); + const size_t kHeaderSize = sizeof(int32); if (available_bytes_ < kHeaderSize) return false; diff --git a/remoting/base/protocol_decoder.h b/remoting/base/protocol_decoder.h index c817723..119198f 100644 --- a/remoting/base/protocol_decoder.h +++ b/remoting/base/protocol_decoder.h @@ -54,13 +54,13 @@ class ProtocolDecoder { typedef std::deque<scoped_refptr<media::DataBuffer> > DataList; DataList data_list_; - int last_read_position_; + size_t last_read_position_; // Count the number of bytes in |data_list_| not read. - int available_bytes_; + size_t available_bytes_; // Stores the size of the next payload if known. - int next_payload_; + size_t next_payload_; // True if the size of the next payload is known. After one payload is read, // this is reset to false. diff --git a/remoting/client/plugin/chromoting_plugin.cc b/remoting/client/plugin/chromoting_plugin.cc index 42b975b..6ed867a 100644 --- a/remoting/client/plugin/chromoting_plugin.cc +++ b/remoting/client/plugin/chromoting_plugin.cc @@ -71,7 +71,6 @@ NPError ChromotingPlugin::SetWindow(NPWindow* window) { int16 ChromotingPlugin::HandleEvent(void* event) { NPPepperEvent* npevent = static_cast<NPPepperEvent*>(event); - char ch; switch (npevent->type) { case NPEventType_MouseDown: diff --git a/remoting/client/plugin/chromoting_plugin_unittest.cc b/remoting/client/plugin/chromoting_plugin_unittest.cc index 68baa9c..12f9193 100644 --- a/remoting/client/plugin/chromoting_plugin_unittest.cc +++ b/remoting/client/plugin/chromoting_plugin_unittest.cc @@ -79,11 +79,6 @@ TEST_F(ChromotingPluginTest, TestNew) { ASSERT_EQ(NPERR_NO_ERROR, result); } - -static uint32 get_pixel(uint32* pixels, int stride, int x, int y) { - return pixels[((x) + ((y) * (stride >> 2)))]; -} - TEST_F(ChromotingPluginTest, TestSetWindow) { NPWindow* window = fake_browser_->GetWindow(); NPError result; diff --git a/remoting/client/plugin/client.cc b/remoting/client/plugin/client.cc index 5de4b5f..75e236c8 100644 --- a/remoting/client/plugin/client.cc +++ b/remoting/client/plugin/client.cc @@ -28,7 +28,6 @@ ChromotingClient::~ChromotingClient() { void ChromotingClient::hexdump(void* ptr, int buflen) { unsigned char* buf = static_cast<unsigned char*>(ptr); - int i, j; for (int i = 0; i < buflen; i += 16) { printf("%06x: ", i); for (int j = 0; j < 16; j ++) diff --git a/remoting/client/plugin/compression.cc b/remoting/client/plugin/compression.cc index 4e89727..037aefb 100644 --- a/remoting/client/plugin/compression.cc +++ b/remoting/client/plugin/compression.cc @@ -109,6 +109,7 @@ int ZDecompressor::GetRawSize() { int ZDecompressor::GetCompressedSize() { // I don't care. + return 0; } } // namespace remoting diff --git a/remoting/client/simple_client.cc b/remoting/client/simple_client.cc index 85561bd..b2e9ce8 100644 --- a/remoting/client/simple_client.cc +++ b/remoting/client/simple_client.cc @@ -81,6 +81,7 @@ class SimpleHostEventCallback : public HostConnection::HostEventCallback { void HandleBeginUpdateStreamMessage(HostMessage* host_msg) { const BeginUpdateStreamMessage& msg = host_msg->begin_update_stream(); + std::cout << msg.GetTypeName() << std::endl; } void HandleUpdateStreamPacketMessage(HostMessage* host_msg) { @@ -93,6 +94,7 @@ class SimpleHostEventCallback : public HostConnection::HostEventCallback { void HandleEndUpdateStreamMessage(HostMessage* host_msg) { const EndUpdateStreamMessage& msg = host_msg->end_update_stream(); + std::cout << msg.GetTypeName() << std::endl; } // JingleClient::Callback interface. diff --git a/remoting/client/x11_view.cc b/remoting/client/x11_view.cc index 170a8fa..599fa31 100644 --- a/remoting/client/x11_view.cc +++ b/remoting/client/x11_view.cc @@ -15,9 +15,9 @@ namespace remoting { X11View::X11View(Display* display, XID window, int width, int height) : display_(display), window_(window), - picture_(0), width_(width), - height_(height) { + height_(height), + picture_(0) { } X11View::~X11View() { diff --git a/remoting/host/client_connection.cc b/remoting/host/client_connection.cc index 23b8b80..d2c0df0 100644 --- a/remoting/host/client_connection.cc +++ b/remoting/host/client_connection.cc @@ -15,7 +15,7 @@ namespace remoting { // Determine how many update streams we should count to find the size of // average update stream. -static const int kAverageUpdateStream = 10; +static const size_t kAverageUpdateStream = 10; ClientConnection::ClientConnection(MessageLoop* message_loop, ProtocolDecoder* decoder, diff --git a/remoting/host/differ_unittest.cc b/remoting/host/differ_unittest.cc index 6973fee..2280407 100644 --- a/remoting/host/differ_unittest.cc +++ b/remoting/host/differ_unittest.cc @@ -145,7 +145,7 @@ class DifferTest : public testing::Test { DirtyRects* dirty = new DirtyRects(); differ_->MergeBlocks(dirty); - ASSERT_EQ(1, dirty->size()); + ASSERT_EQ(1UL, dirty->size()); CheckDirtyRect(dirty->at(0), x_origin, y_origin, width, height); } @@ -272,7 +272,7 @@ TEST_F(DifferTest, MergeBlocks_Empty) { DirtyRects* dirty = new DirtyRects(); differ_->MergeBlocks(dirty); - EXPECT_EQ(0, dirty->size()); + EXPECT_EQ(0UL, dirty->size()); } TEST_F(DifferTest, MergeBlocks_SingleBlock) { @@ -435,7 +435,7 @@ TEST_F(DifferTest, MergeBlocks_MultiRect) { dirty = new DirtyRects(); differ_->MergeBlocks(dirty); - ASSERT_EQ(3, dirty->size()); + ASSERT_EQ(3UL, dirty->size()); CheckDirtyRect(dirty->at(0), 1, 0, 1, 1); CheckDirtyRect(dirty->at(1), 0, 1, 1, 1); CheckDirtyRect(dirty->at(2), 2, 2, 1, 1); @@ -456,7 +456,7 @@ TEST_F(DifferTest, MergeBlocks_MultiRect) { dirty = new DirtyRects(); differ_->MergeBlocks(dirty); - ASSERT_EQ(2, dirty->size()); + ASSERT_EQ(2UL, dirty->size()); CheckDirtyRect(dirty->at(0), 2, 0, 1, 3); CheckDirtyRect(dirty->at(1), 0, 1, 2, 2); @@ -477,7 +477,7 @@ TEST_F(DifferTest, MergeBlocks_MultiRect) { dirty = new DirtyRects(); differ_->MergeBlocks(dirty); - ASSERT_EQ(3, dirty->size()); + ASSERT_EQ(3UL, dirty->size()); CheckDirtyRect(dirty->at(0), 0, 1, 1, 2); CheckDirtyRect(dirty->at(1), 2, 1, 1, 2); CheckDirtyRect(dirty->at(2), 1, 2, 1, 1); @@ -500,7 +500,7 @@ TEST_F(DifferTest, MergeBlocks_MultiRect) { dirty = new DirtyRects(); differ_->MergeBlocks(dirty); - ASSERT_EQ(4, dirty->size()); + ASSERT_EQ(4UL, dirty->size()); CheckDirtyRect(dirty->at(0), 0, 0, 3, 1); CheckDirtyRect(dirty->at(1), 0, 1, 1, 2); CheckDirtyRect(dirty->at(2), 2, 1, 1, 2); @@ -522,7 +522,7 @@ TEST_F(DifferTest, MergeBlocks_MultiRect) { dirty = new DirtyRects(); differ_->MergeBlocks(dirty); - ASSERT_EQ(2, dirty->size()); + ASSERT_EQ(2UL, dirty->size()); CheckDirtyRect(dirty->at(0), 0, 0, 2, 2); CheckDirtyRect(dirty->at(1), 1, 2, 1, 1); } diff --git a/remoting/host/encoder_verbatim.cc b/remoting/host/encoder_verbatim.cc index f054ae8..e51248c 100644 --- a/remoting/host/encoder_verbatim.cc +++ b/remoting/host/encoder_verbatim.cc @@ -21,8 +21,6 @@ void EncoderVerbatim::Encode(const DirtyRects& dirty_rects, for (int i = 0; i < num_rects; i++) { scoped_refptr<DataBuffer> data; gfx::Rect dirty_rect = dirty_rects[i]; - PixelFormat pixel_format; - UpdateStreamEncoding encoding; scoped_ptr<UpdateStreamPacketHeader> header(new UpdateStreamPacketHeader); if (EncodeRect(dirty_rect, input_data, diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc index c434742..ec2e7dc 100644 --- a/remoting/host/session_manager.cc +++ b/remoting/host/session_manager.cc @@ -44,9 +44,9 @@ SessionManager::SessionManager( capturer_(capturer), encoder_(encoder), rate_(kDefaultCaptureRate), - max_rate_(kDefaultCaptureRate), started_(false), recordings_(0), + max_rate_(kDefaultCaptureRate), rate_control_started_(false) { DCHECK(capture_loop_); DCHECK(encode_loop_); @@ -308,7 +308,7 @@ void SessionManager::DoRateControl() { } // If |slow_down| equals zero, we have no slow down. - int slow_down = max_pending_update_streams / kSlowDownFactor; + size_t slow_down = max_pending_update_streams / kSlowDownFactor; // Set new_rate to -1 for checking later. double new_rate = -1; // If the slow down is too large. diff --git a/remoting/jingle_glue/jingle_channel.cc b/remoting/jingle_glue/jingle_channel.cc index 8111985..49bfc5b4 100644 --- a/remoting/jingle_glue/jingle_channel.cc +++ b/remoting/jingle_glue/jingle_channel.cc @@ -20,8 +20,8 @@ const size_t kReadBufferSize = 4096; JingleChannel::JingleChannel(Callback* callback) : state_(INITIALIZING), - event_handler_(this), callback_(callback), + event_handler_(this), write_buffer_size_(0), current_write_buf_pos_(0) { DCHECK(callback_ != NULL); diff --git a/remoting/jingle_glue/jingle_client.cc b/remoting/jingle_glue/jingle_client.cc index 8fb0714..b1cecdc 100644 --- a/remoting/jingle_glue/jingle_client.cc +++ b/remoting/jingle_glue/jingle_client.cc @@ -179,6 +179,9 @@ void JingleClient::OnConnectionStateChanged(buzz::XmppEngine::State state) { case buzz::XmppEngine::STATE_CLOSED: UpdateState(CLOSED); break; + default: + NOTREACHED(); + break; } } diff --git a/remoting/jingle_glue/jingle_thread.cc b/remoting/jingle_glue/jingle_thread.cc index 5090251..ee02a5c 100644 --- a/remoting/jingle_glue/jingle_thread.cc +++ b/remoting/jingle_glue/jingle_thread.cc @@ -28,9 +28,9 @@ void TaskPump::OnMessage(talk_base::Message* pmsg) { } JingleThread::JingleThread() - : message_loop_(NULL), - task_pump_(NULL), - started_event_(true, false) { } + : task_pump_(NULL), + started_event_(true, false), + message_loop_(NULL) { } JingleThread::~JingleThread() { } diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index f62a83e..49bab0b 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -3,6 +3,10 @@ # found in the LICENSE file. { + 'variables': { + 'chromium_code': 1, + }, + 'target_defaults': { 'defines': [ ], |