Windows: Fix 64-bit compile errors (issue #394).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1361 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2013-08-14 21:45:22 +00:00
parent 94b5c536ba
commit 2f1c313fd0
11 changed files with 26 additions and 25 deletions

View File

@ -54,7 +54,7 @@ bool CefStreamResourceHandler::ReadResponse(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefCallback> callback) {
bytes_read = stream_->Read(data_out, 1, bytes_to_read);
bytes_read = static_cast<int>(stream_->Read(data_out, 1, bytes_to_read));
return (bytes_read > 0);
}

View File

@ -144,7 +144,7 @@ void OSRWindow::OnCursorChange(CefRefPtr<CefBrowser> browser,
return;
// Change the plugin window's cursor.
SetClassLong(hWnd_, GCL_HCURSOR,
SetClassLongPtr(hWnd_, GCLP_HCURSOR,
static_cast<LONG>(reinterpret_cast<LONG_PTR>(cursor)));
SetCursor(cursor);
}

View File

@ -62,7 +62,7 @@ void SetListValue(CefRefPtr<CefV8Value> list, int index,
switch (type) {
case VTYPE_LIST: {
CefRefPtr<CefListValue> list = value->GetList(index);
new_value = CefV8Value::CreateArray(list->GetSize());
new_value = CefV8Value::CreateArray(static_cast<int>(list->GetSize()));
SetList(list, new_value);
} break;
case VTYPE_BOOL:
@ -92,7 +92,7 @@ void SetListValue(CefRefPtr<CefV8Value> list, int index,
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefV8Value> target) {
ASSERT(target->IsArray());
int arg_length = source->GetSize();
int arg_length = static_cast<int>(source->GetSize());
if (arg_length == 0)
return;
@ -382,7 +382,8 @@ bool ClientApp::OnProcessMessageReceived(
// Second argument is the list of message arguments.
CefRefPtr<CefListValue> list = message->GetArgumentList();
CefRefPtr<CefV8Value> args = CefV8Value::CreateArray(list->GetSize());
CefRefPtr<CefV8Value> args =
CefV8Value::CreateArray(static_cast<int>(list->GetSize()));
SetList(list, args);
arguments.push_back(args);

View File

@ -31,7 +31,7 @@ class RunFileDialogCallback : public CefRunFileDialogCallback {
CefProcessMessage::Create(message_name_);
CefRefPtr<CefListValue> args = message->GetArgumentList();
CefRefPtr<CefListValue> val = CefListValue::Create();
for (size_t i = 0; i < file_paths.size(); ++i)
for (int i = 0; i < static_cast<int>(file_paths.size()); ++i)
val->SetString(i, file_paths[i]);
args->SetList(0, val);

View File

@ -14,9 +14,9 @@ namespace performance_test {
// Use more interations for a Release build.
#ifdef NDEBUG
const size_t kDefaultIterations = 100000;
const int kDefaultIterations = 100000;
#else
const size_t kDefaultIterations = 10000;
const int kDefaultIterations = 10000;
#endif
namespace {
@ -41,7 +41,7 @@ class V8Handler : public CefV8Handler {
bool found = false;
std::string test = arguments[0]->GetStringValue();
for (size_t i = 0; i < kPerfTestsCount; ++i) {
for (int i = 0; i < kPerfTestsCount; ++i) {
if (test == kPerfTests[i].name) {
// Execute the test.
int64 delta = kPerfTests[i].test(kPerfTests[i].iterations);
@ -63,7 +63,7 @@ class V8Handler : public CefV8Handler {
} else if (name == kGetPerfTests) {
// Retrieve the list of perf tests.
retval = CefV8Value::CreateArray(kPerfTestsCount);
for (size_t i = 0; i < kPerfTestsCount; ++i) {
for (int i = 0; i < kPerfTestsCount; ++i) {
CefRefPtr<CefV8Value> val = CefV8Value::CreateArray(2);
val->SetValue(0, CefV8Value::CreateString(kPerfTests[i].name));
val->SetValue(1, CefV8Value::CreateUInt(kPerfTests[i].iterations));

View File

@ -11,7 +11,7 @@
namespace performance_test {
// Default number of iterations.
extern const size_t kDefaultIterations;
extern const int kDefaultIterations;
// Test name.
#define PERF_TEST_NAME(name) PerfTest##name
@ -24,7 +24,7 @@ extern const size_t kDefaultIterations;
// Test function declaration.
#define PERF_TEST_RESULT int64
#define PERF_TEST_PARAM_ITERATIONS iterations
#define PERF_TEST_PARAMS size_t PERF_TEST_PARAM_ITERATIONS
#define PERF_TEST_PARAMS int PERF_TEST_PARAM_ITERATIONS
#define PERF_TEST_FUNC(name) \
PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS)
@ -66,7 +66,7 @@ class CefTimer {
{ \
CefTimer _timer; \
_timer.Start(); \
for (size_t _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) {
for (int _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) {
#define PERF_ITERATIONS_END_EX(result) \
} \
@ -87,12 +87,12 @@ class CefTimer {
struct PerfTestEntry {
const char* name;
PerfTest* test;
size_t iterations;
int iterations;
};
// Array of perf tests.
extern const PerfTestEntry kPerfTests[];
extern const size_t kPerfTestsCount;
extern const int kPerfTestsCount;
} // namespace performance_test

View File

@ -323,6 +323,6 @@ const PerfTestEntry kPerfTests[] = {
PERF_TEST_ENTRY(V8ContextEval),
};
const size_t kPerfTestsCount = (sizeof(kPerfTests) / sizeof(kPerfTests[0]));
const int kPerfTestsCount = (sizeof(kPerfTests) / sizeof(kPerfTests[0]));
} // namespace performance_test

View File

@ -275,7 +275,7 @@ class NetNotifyRendererTest : public ClientApp::RenderDelegate {
NetNotifyTestType test_type = NNTT_NONE;
// Extract the test type.
int pos = url.find("t=");
size_t pos = url.find("t=");
int intval = 0;
if (pos > 0 && base::StringToInt(url.substr(pos + 2, 1), &intval))
test_type = static_cast<NetNotifyTestType>(intval);

View File

@ -27,7 +27,7 @@ static void VerifyStreamReadBehavior(CefRefPtr<CefStreamReader> stream,
int res, read, offset = 0;
do {
read = std::min(static_cast<int>(sizeof(buff)), contentSize-offset);
res = stream->Read(buff, 1, read);
res = static_cast<int>(stream->Read(buff, 1, read));
ASSERT_EQ(read, res);
ASSERT_TRUE(!memcmp(contentStr+offset, buff, res));
offset += res;
@ -47,7 +47,7 @@ static void VerifyStreamWriteBehavior(CefRefPtr<CefStreamWriter> stream,
int res, write, offset = 0;
do {
write = std::min(10, contentSize-offset);
res = stream->Write(contentStr+offset, 1, write);
res = static_cast<int>(stream->Write(contentStr+offset, 1, write));
ASSERT_EQ(write, res);
offset += res;
ASSERT_EQ(offset, stream->Tell());

View File

@ -132,7 +132,7 @@ CefRefPtr<CefResourceHandler> TestHandler::GetResourceHandler(
// Ignore the query component, if any.
std::string urlStr = url;
int idx = urlStr.find('?');
size_t idx = urlStr.find('?');
if (idx > 0)
urlStr = urlStr.substr(0, idx);
@ -186,7 +186,7 @@ void TestHandler::AddResource(const std::string& url,
const std::string& mimeType) {
// Ignore the query component, if any.
std::string urlStr = url;
int idx = urlStr.find('?');
size_t idx = urlStr.find('?');
if (idx > 0)
urlStr = urlStr.substr(0, idx);

View File

@ -182,10 +182,10 @@ void TestListEqual(CefRefPtr<CefListValue> val1,
EXPECT_TRUE(val1.get());
EXPECT_TRUE(val2.get());
size_t size = val1->GetSize();
EXPECT_EQ(size, val2->GetSize());
int size = static_cast<int>(val1->GetSize());
EXPECT_EQ(size, static_cast<int>(val2->GetSize()));
for (size_t i = 0; i < size; ++i) {
for (int i = 0; i < size; ++i) {
CefValueType type = val1->GetType(i);
EXPECT_EQ(type, val2->GetType(i));
switch (type) {