Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Unified Diff: src/utils.cc

Issue 390004: Fix warnings on Win64. (Closed)
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/api.cc ('K') | « src/utils.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.cc
diff --git a/src/utils.cc b/src/utils.cc
index 3c684b8199d650c7e6d5c6368c07485c4f118320..ce5aceda3ab0a1a03ece4445962b3d50be23d476 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -129,7 +129,7 @@ char* ReadLine(const char* prompt) {
}
return NULL;
}
- int len = strlen(line_buf);
+ int len = StrLength(line_buf);
if (len > 1 &&
line_buf[len - 2] == '\\' &&
line_buf[len - 1] == '\n') {
@@ -184,7 +184,7 @@ char* ReadCharsFromFile(const char* filename,
char* result = NewArray<char>(*size + extra_space);
for (int i = 0; i < *size;) {
- int read = fread(&result[i], 1, *size - i, file);
+ int read = static_cast<int>(fread(&result[i], 1, *size - i, file));
if (read <= 0) {
fclose(file);
DeleteArray(result);
@@ -221,7 +221,7 @@ Vector<const char> ReadFile(const char* filename,
int WriteCharsToFile(const char* str, int size, FILE* f) {
int total = 0;
while (total < size) {
- int write = fwrite(str, 1, size - total, f);
+ int write = static_cast<int>(fwrite(str, 1, size - total, f));
if (write == 0) {
return total;
}
@@ -265,7 +265,7 @@ StringBuilder::StringBuilder(int size) {
void StringBuilder::AddString(const char* s) {
- AddSubstring(s, strlen(s));
+ AddSubstring(s, StrLength(s));
}
« src/api.cc ('K') | « src/utils.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698