Skip to content

Commit

Permalink
Fix integer truncation warnings from Clang
Browse files Browse the repository at this point in the history
ssize_t assignment to couchstore_error_t requires explicit cast
since it's throwing away the upper half of a 64-bit value.

Change-Id: If4456dcb1a8fd34234bde433d30d2441c6dcb90d
Reviewed-on: http://review.couchbase.org/19179
Tested-by: Aaron Miller <apage43@ninjawhale.com>
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
  • Loading branch information
snej committed Aug 6, 2012
1 parent 6a0fd89 commit 1e72545
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/couch_file_write.c
Expand Up @@ -66,14 +66,14 @@ couchstore_error_t db_write_header(Db *db, sized_buf *buf, off_t *pos)

written = db->file_ops->pwrite(db->file_handle, &headerbuf, sizeof(headerbuf), write_pos);
if (written < 0) {
return written;
return (couchstore_error_t)written;
}
write_pos += written;

//Write actual header
written = raw_write(db, buf, write_pos);
if (written < 0) {
return written;
return (couchstore_error_t)written;
}
write_pos += written;
db->file_pos = write_pos;
Expand All @@ -97,14 +97,14 @@ int db_write_buf(Db *db, const sized_buf *buf, off_t *pos, size_t *disk_size)
sized_buf sized_headerbuf = { headerbuf, 8 };
written = raw_write(db, &sized_headerbuf, end_pos);
if (written < 0) {
return written;
return (int)written;
}
end_pos += written;

// Write actual buffer:
written = raw_write(db, buf, end_pos);
if (written < 0) {
return written;
return (int)written;
}
end_pos += written;

Expand Down

0 comments on commit 1e72545

Please sign in to comment.