diff options
author | pph34r@gmail.com <pph34r@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-02 14:38:05 +0000 |
---|---|---|
committer | pph34r@gmail.com <pph34r@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-02 14:38:05 +0000 |
commit | 7c75b4ce3dab78609129944ee91131e62ca36085 (patch) | |
tree | 7b667951f46397fafc6f6a187ebf5f258e4e3593 | |
parent | 894f634cee519f550410ee9bd98f76a3bd956736 (diff) | |
download | chromium_src-7c75b4ce3dab78609129944ee91131e62ca36085.zip chromium_src-7c75b4ce3dab78609129944ee91131e62ca36085.tar.gz chromium_src-7c75b4ce3dab78609129944ee91131e62ca36085.tar.bz2 |
GCC 4.6 -Wunused-but-set-variable cleanup.
BUG=87490
TEST=net_unittests
Review URL: http://codereview.chromium.org/7261018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91424 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/base/x509_certificate.cc | 5 | ||||
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 3 | ||||
-rw-r--r-- | net/http/http_auth_gssapi_posix.cc | 7 | ||||
-rw-r--r-- | net/http/http_auth_gssapi_posix_unittest.cc | 2 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.cc | 1 | ||||
-rw-r--r-- | net/spdy/spdy_test_util.cc | 2 | ||||
-rw-r--r-- | net/tools/dump_cache/url_to_filename_encoder.cc | 4 | ||||
-rw-r--r-- | net/tools/flip_server/spdy_interface.cc | 6 | ||||
-rw-r--r-- | net/url_request/url_request_http_job.cc | 6 | ||||
-rw-r--r-- | net/websockets/websocket_handshake_handler.cc | 4 |
10 files changed, 12 insertions, 28 deletions
diff --git a/net/base/x509_certificate.cc b/net/base/x509_certificate.cc index e73b5d5..1f27504 100644 --- a/net/base/x509_certificate.cc +++ b/net/base/x509_certificate.cc @@ -406,7 +406,6 @@ bool X509Certificate::VerifyHostname( bool found_alpha = false; bool found_ip6_chars = false; - bool found_hyphen = false; int dot_count = 0; size_t first_dot_index = std::string::npos; @@ -422,9 +421,7 @@ bool X509Certificate::VerifyHostname( first_dot_index = reference_name.length(); } else if (c == ':') { found_ip6_chars = true; - } else if (c == '-') { - found_hyphen = true; - } else if (!IsAsciiDigit(c)) { + } else if (c != '-' && !IsAsciiDigit(c)) { LOG(WARNING) << "Invalid char " << c << " in hostname " << hostname; return false; } diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index 982a5e5..1cde9b6 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -1085,7 +1085,6 @@ TEST_F(DiskCacheBackendTest, NewEvictionFixEnumerators) { void DiskCacheBackendTest::BackendDoomRecent() { InitCache(); - Time initial = Time::Now(); disk_cache::Entry *entry; ASSERT_EQ(net::OK, CreateEntry("first", &entry)); @@ -1133,7 +1132,6 @@ TEST_F(DiskCacheBackendTest, MemoryOnlyDoomRecent) { void DiskCacheBackendTest::BackendDoomBetween() { InitCache(); - Time initial = Time::Now(); disk_cache::Entry *entry; ASSERT_EQ(net::OK, CreateEntry("first", &entry)); @@ -1833,7 +1831,6 @@ TEST_F(DiskCacheTest, Backend_UsageStats) { void DiskCacheBackendTest::BackendDoomAll() { InitCache(); - Time initial = Time::Now(); disk_cache::Entry *entry1, *entry2; ASSERT_EQ(net::OK, CreateEntry("first", &entry1)); diff --git a/net/http/http_auth_gssapi_posix.cc b/net/http/http_auth_gssapi_posix.cc index 8a39688..25ee910 100644 --- a/net/http/http_auth_gssapi_posix.cc +++ b/net/http/http_auth_gssapi_posix.cc @@ -244,15 +244,10 @@ std::string DescribeOid(GSSAPILibrary* gssapi_lib, const gss_OID oid) { // Check if the first |kMaxCharsToPrint| characters // contain only printable characters and are NULL terminated. const char* str = reinterpret_cast<const char*>(oid); - bool is_printable = true; size_t str_length = 0; for ( ; str_length < kMaxCharsToPrint; ++str_length) { - if (!str[str_length]) + if (!str[str_length] || !isprint(str[str_length])) break; - if (!isprint(str[str_length])) { - is_printable = false; - break; - } } if (!str[str_length]) { output += base::StringPrintf("\"%s\"", str); diff --git a/net/http/http_auth_gssapi_posix_unittest.cc b/net/http/http_auth_gssapi_posix_unittest.cc index c3f9f75..9ae0cc8 100644 --- a/net/http/http_auth_gssapi_posix_unittest.cc +++ b/net/http/http_auth_gssapi_posix_unittest.cc @@ -162,6 +162,7 @@ TEST(HttpAuthGSSAPIPOSIXTest, GSSAPICycle) { &output_token, &ret_flags, &time_rec); + EXPECT_EQ(queries[i].response_code, major_status); CopyBuffer(&input_token, &output_token); ClearBuffer(&output_token); } @@ -169,6 +170,7 @@ TEST(HttpAuthGSSAPIPOSIXTest, GSSAPICycle) { major_status = mock_library->delete_sec_context(&minor_status, &context_handle, GSS_C_NO_BUFFER); + EXPECT_EQ(static_cast<OM_uint32>(GSS_S_COMPLETE), major_status); } TEST(HttpAuthGSSAPITest, ParseChallenge_FirstRound) { diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index 957d764..b84d6ad 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -183,7 +183,6 @@ void SpdySessionPool::Remove(const scoped_refptr<SpdySession>& session) { Value* SpdySessionPool::SpdySessionPoolInfoToValue() const { ListValue* list = new ListValue(); - SpdySessionsMap::const_iterator spdy_session_pool_it = sessions_.begin(); for (SpdySessionsMap::const_iterator it = sessions_.begin(); it != sessions_.end(); ++it) { SpdySessionList* sessions = it->second; diff --git a/net/spdy/spdy_test_util.cc b/net/spdy/spdy_test_util.cc index d959d5d..e8c5138 100644 --- a/net/spdy/spdy_test_util.cc +++ b/net/spdy/spdy_test_util.cc @@ -764,7 +764,6 @@ int ConstructSpdyReplyString(const char* const extra_headers[], char* buffer, int buffer_length) { int packet_size = 0; - int header_count = 0; char* buffer_write = buffer; int buffer_left = buffer_length; spdy::SpdyHeaderBlock headers; @@ -772,7 +771,6 @@ int ConstructSpdyReplyString(const char* const extra_headers[], return 0; // Copy in the extra headers. AppendHeadersToSpdyFrame(extra_headers, extra_header_count, &headers); - header_count = headers.size(); // The iterator gets us the list of header/value pairs in sorted order. spdy::SpdyHeaderBlock::iterator next = headers.begin(); spdy::SpdyHeaderBlock::iterator last = headers.end(); diff --git a/net/tools/dump_cache/url_to_filename_encoder.cc b/net/tools/dump_cache/url_to_filename_encoder.cc index 4ca4a51..40cd16f 100644 --- a/net/tools/dump_cache/url_to_filename_encoder.cc +++ b/net/tools/dump_cache/url_to_filename_encoder.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -177,7 +177,6 @@ bool UrlToFilenameEncoder::Decode(const string& encoded_filename, kEscapeDot }; State state = kStart; - int char_code = 0; char hex_buffer[3]; hex_buffer[2] = '\0'; for (size_t i = 0; i < encoded_filename.size(); ++i) { @@ -215,7 +214,6 @@ bool UrlToFilenameEncoder::Decode(const string& encoded_filename, hex_buffer[1] = ch; uint64 hex_value = ParseLeadingHex64Value(hex_buffer, 0); decoded_url->append(1, static_cast<char>(hex_value)); - char_code = 0; state = kStart; } else { return false; diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc index 278f0dd..30cb401 100644 --- a/net/tools/flip_server/spdy_interface.cc +++ b/net/tools/flip_server/spdy_interface.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -185,7 +185,6 @@ int SpdySM::SpdyHandleNewStream(const SpdyControlFrame* frame, else uri = std::string(url->second); if (acceptor_->flip_handler_type_ == FLIP_HANDLER_SPDY_SERVER) { - SpdyHeaderBlock::iterator referer = headers.find("referer"); std::string host = UrlUtilities::GetUrlHost(url->second); VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Request: " << method->second << " " << uri; @@ -259,6 +258,9 @@ void SpdySM::OnControl(const SpdyControlFrame* frame) { case SYN_REPLY: parsed_headers = spdy_framer_->ParseHeaderBlock(frame, &headers); + DCHECK(parsed_headers); + // TODO(willchan): if there is an error parsing headers, we + // should send a RST_STREAM. VLOG(2) << ACCEPTOR_CLIENT_IDENT << "SpdySM: OnSynReply(" << reinterpret_cast<const SpdySynReplyControlFrame*>(frame)->stream_id() << ")"; diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index 8a7d298..52e330e 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -581,11 +581,9 @@ void URLRequestHttpJob::SaveNextCookie() { // be notifying our consumer asynchronously via OnStartCompleted. SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); - bool allow = true; CookieOptions options; - if (request_info_.load_flags & LOAD_DO_NOT_SAVE_COOKIES) { - allow = false; - } else if (request_->delegate() && request_->context()->cookie_store()) { + if (!(request_info_.load_flags & LOAD_DO_NOT_SAVE_COOKIES) && + request_->delegate() && request_->context()->cookie_store()) { CookieOptions options; options.set_include_httponly(); if (request_->delegate()->CanSetCookie( diff --git a/net/websockets/websocket_handshake_handler.cc b/net/websockets/websocket_handshake_handler.cc index 2e62a18..4a424ca 100644 --- a/net/websockets/websocket_handshake_handler.cc +++ b/net/websockets/websocket_handshake_handler.cc @@ -226,9 +226,7 @@ HttpRequestInfo WebSocketHandshakeRequestHandler::GetRequestInfo( const GURL& url, std::string* challenge) { HttpRequestInfo request_info; request_info.url = url; - base::StringPiece method = status_line_.data(); - size_t method_end = base::StringPiece( - status_line_.data(), status_line_.size()).find_first_of(" "); + size_t method_end = base::StringPiece(status_line_).find_first_of(" "); if (method_end != base::StringPiece::npos) request_info.method = std::string(status_line_.data(), method_end); |