From d2fec012063ade5737c7075758574137e4d18410 Mon Sep 17 00:00:00 2001 From: "gspencer@google.com" Date: Mon, 8 Jun 2009 16:43:27 +0000 Subject: This fixes a bunch of warnings that are in our code, in order for the GYP build to succeed. Review URL: http://codereview.chromium.org/118346 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17865 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/utils/cross/file_text_reader.cc | 7 ++++++- o3d/utils/cross/file_text_reader_test.cc | 7 ++++++- o3d/utils/cross/json_writer.cc | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'o3d/utils') diff --git a/o3d/utils/cross/file_text_reader.cc b/o3d/utils/cross/file_text_reader.cc index 39e5057..314be5e 100644 --- a/o3d/utils/cross/file_text_reader.cc +++ b/o3d/utils/cross/file_text_reader.cc @@ -171,7 +171,12 @@ std::string FileTextReader::ReadToEnd() { size_t FileTextReader::GetFileSize() const { struct stat file_info; - ::fstat(::fileno(input_), &file_info); +#if defined(OS_WIN) + int file_number = ::_fileno(input_); +#else + int file_number = ::fileno(input_); +#endif + ::fstat(file_number, &file_info); return file_info.st_size; } diff --git a/o3d/utils/cross/file_text_reader_test.cc b/o3d/utils/cross/file_text_reader_test.cc index b87e61d..3bf1415 100644 --- a/o3d/utils/cross/file_text_reader_test.cc +++ b/o3d/utils/cross/file_text_reader_test.cc @@ -95,7 +95,12 @@ class FileTextReaderTest : public testing::Test { if (file_pointers_[i]) { ::fclose(file_pointers_[i]); } - ::unlink((tmp_base + kFileInfo[i].file_name_).c_str()); + std::string path = tmp_base + kFileInfo[i].file_name_; +#if defined(OS_WIN) + ::_unlink(path.c_str()); +#else + ::unlink(path.c_str()); +#endif file_pointers_[i] = NULL; } } diff --git a/o3d/utils/cross/json_writer.cc b/o3d/utils/cross/json_writer.cc index 784d728..a49700e 100644 --- a/o3d/utils/cross/json_writer.cc +++ b/o3d/utils/cross/json_writer.cc @@ -210,7 +210,7 @@ void JsonWriter::WritePending() { } void JsonWriter::WriteEscapedString(const string& unescaped) { - for (int i = 0; i < unescaped.length(); ++i) { + for (string::size_type i = 0; i < unescaped.length(); ++i) { char c = unescaped[i]; switch (c) { case '\"': -- cgit v1.1