From aa4edea0dcdec0733c01e3f2c7487969d17b4a51 Mon Sep 17 00:00:00 2001 From: "mmoss@google.com" Date: Mon, 29 Sep 2008 21:39:01 +0000 Subject: Some cleanups for gcc warnings: test/chrome_plugin/test_chrome_plugin.cc:26: warning: comparison between signed and unsigned integer expressions test/chrome_plugin/test_chrome_plugin.cc:73: warning: 'ResponseStream::request_' will be initialized after test/chrome_plugin/test_chrome_plugin.cc:72: warning: 'int ResponseStream::ready_state_' test/chrome_plugin/test_chrome_plugin.cc:77: warning: when initialized here test/chrome_plugin/test_chrome_plugin.cc:105: warning: unused variable 'status' Review URL: http://codereview.chromium.org/5034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2694 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/chrome_plugin/test_chrome_plugin.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'chrome') diff --git a/chrome/test/chrome_plugin/test_chrome_plugin.cc b/chrome/test/chrome_plugin/test_chrome_plugin.cc index 5e3c532..7343205 100644 --- a/chrome/test/chrome_plugin/test_chrome_plugin.cc +++ b/chrome/test/chrome_plugin/test_chrome_plugin.cc @@ -23,7 +23,7 @@ static TestFuncParams::BrowserFuncs g_cptest_funcs; static base::AtExitManager global_at_exit_manager; const TestResponsePayload* FindPayload(const char* url) { - for (int i = 0; i < arraysize(kChromeTestPluginPayloads); ++i) { + for (size_t i = 0; i < arraysize(kChromeTestPluginPayloads); ++i) { if (strcmp(kChromeTestPluginPayloads[i].url, url) == 0) return &kChromeTestPluginPayloads[i]; } @@ -75,8 +75,8 @@ private: ResponseStream::ResponseStream(const TestResponsePayload* payload, CPRequest* request) - : payload_(payload), offset_(0), request_(request), - ready_state_(READY_INVALID) { + : payload_(payload), offset_(0), ready_state_(READY_INVALID), + request_(request) { } void ResponseStream::Init() { @@ -101,10 +101,8 @@ int ResponseStream::GetResponseInfo(CPResponseInfoType type, void* buf, switch (type) { case CPRESPONSEINFO_HTTP_STATUS: - if (buf) { - int status = payload_->status; + if (buf) memcpy(buf, &payload_->status, buf_size); - } break; case CPRESPONSEINFO_HTTP_RAW_HEADERS: { std::string headers = GetPayloadHeaders(payload_); @@ -380,4 +378,3 @@ int STDCALL CP_Test(void* vparam) { g_cptest_funcs = param->bfuncs; return CPERR_SUCCESS; } - -- cgit v1.1