aboutsummaryrefslogtreecommitdiff
path: root/src/client/minidump_file_writer.cc
diff options
context:
space:
mode:
authordmaclach <dmaclach@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-07-19 20:43:49 +0000
committerdmaclach <dmaclach@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-07-19 20:43:49 +0000
commit4ac61acb3a7dad6ce722fe07564be8ec92713228 (patch)
treefb71c49eb2aa7ca1f1867854ad9871c84504bc46 /src/client/minidump_file_writer.cc
parentBreakpad Linux/Mac symbol dumper: Share duplicate strings that arise in DWARF... (diff)
downloadbreakpad-4ac61acb3a7dad6ce722fe07564be8ec92713228.tar.xz
Clean up build for 64 bit.
Fix up some broken mac projects. Consolidate project settings in xcconfig files. http://breakpad.appspot.com/130001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@627 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/minidump_file_writer.cc')
-rw-r--r--src/client/minidump_file_writer.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/client/minidump_file_writer.cc b/src/client/minidump_file_writer.cc
index 1be3f504..66d4c690 100644
--- a/src/client/minidump_file_writer.cc
+++ b/src/client/minidump_file_writer.cc
@@ -107,7 +107,7 @@ bool MinidumpFileWriter::CopyStringToMDString(const wchar_t *str,
// zero, but the second one may be zero, depending on the conversion from
// UTF-32.
int out_count = out[1] ? 2 : 1;
- int out_size = sizeof(u_int16_t) * out_count;
+ size_t out_size = sizeof(u_int16_t) * out_count;
result = mdstring->CopyIndexAfterObject(out_idx, out, out_size);
out_idx += out_count;
}
@@ -134,7 +134,7 @@ bool MinidumpFileWriter::CopyStringToMDString(const char *str,
// Append the one or two UTF-16 characters
int out_count = out[1] ? 2 : 1;
- int out_size = sizeof(u_int16_t) * out_count;
+ size_t out_size = sizeof(u_int16_t) * out_count;
result = mdstring->CopyIndexAfterObject(out_idx, out, out_size);
out_idx += out_count;
}
@@ -161,7 +161,8 @@ bool MinidumpFileWriter::WriteStringCore(const CharType *str,
return false;
// Set length excluding the NULL and copy the string
- mdstring.get()->length = mdstring_length * sizeof(u_int16_t);
+ mdstring.get()->length =
+ static_cast<u_int32_t>(mdstring_length * sizeof(u_int16_t));
bool result = CopyStringToMDString(str, mdstring_length, &mdstring);
// NULL terminate
@@ -235,15 +236,15 @@ bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) {
assert(file_ != -1);
// Ensure that the data will fit in the allocated space
- if (size + position > size_)
+ if (static_cast<size_t>(size + position) > size_)
return false;
// Seek and write the data
#if __linux__
- if (sys_lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) {
+ if (sys_lseek(file_, position, SEEK_SET) == position) {
if (sys_write(file_, src, size) == size) {
#else
- if (lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) {
+ if (lseek(file_, position, SEEK_SET) == position) {
if (write(file_, src, size) == size) {
#endif
return true;
@@ -260,11 +261,11 @@ bool UntypedMDRVA::Allocate(size_t size) {
return position_ != MinidumpFileWriter::kInvalidMDRVA;
}
-bool UntypedMDRVA::Copy(MDRVA position, const void *src, size_t size) {
+bool UntypedMDRVA::Copy(MDRVA pos, const void *src, size_t size) {
assert(src);
assert(size);
- assert(position + size <= position_ + size_);
- return writer_->Copy(position, src, size);
+ assert(pos + size <= position_ + size_);
+ return writer_->Copy(pos, src, size);
}
} // namespace google_breakpad