summaryrefslogtreecommitdiff
path: root/table
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-04-20 22:48:11 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-04-20 22:48:11 +0000
commitba6dac0e809b249532a7465f71a00ccda307161d (patch)
tree9aa494c1bb1bbbefba5bf12c520941dbe4abfec1 /table
parent69c6d38342a1fab5f7f2921aa2e9c0e60ba90e35 (diff)
downloadleveldb-ba6dac0e809b249532a7465f71a00ccda307161d.tar.gz
@20776309
* env_chromium.cc should not export symbols. * Fix MSVC warnings. * Removed large value support. * Fix broken reference to documentation file git-svn-id: https://leveldb.googlecode.com/svn/trunk@24 62dab493-f737-651d-591e-8d6aee1b9529
Diffstat (limited to 'table')
-rw-r--r--table/block.cc4
-rw-r--r--table/block_builder.cc2
-rw-r--r--table/format.cc4
3 files changed, 6 insertions, 4 deletions
diff --git a/table/block.cc b/table/block.cc
index 0525d2d..92b2877 100644
--- a/table/block.cc
+++ b/table/block.cc
@@ -62,7 +62,9 @@ static inline const char* DecodeEntry(const char* p, const char* limit,
if ((p = GetVarint32Ptr(p, limit, value_length)) == NULL) return NULL;
}
- if (limit - p < (*non_shared + *value_length)) return NULL;
+ if (static_cast<uint32>(limit - p) < (*non_shared + *value_length)) {
+ return NULL;
+ }
return p;
}
diff --git a/table/block_builder.cc b/table/block_builder.cc
index ae18b36..dc958c8 100644
--- a/table/block_builder.cc
+++ b/table/block_builder.cc
@@ -62,7 +62,7 @@ size_t BlockBuilder::CurrentSizeEstimate() const {
Slice BlockBuilder::Finish() {
// Append restart array
- for (int i = 0; i < restarts_.size(); i++) {
+ for (size_t i = 0; i < restarts_.size(); i++) {
PutFixed32(&buffer_, restarts_[i]);
}
PutFixed32(&buffer_, restarts_.size());
diff --git a/table/format.cc b/table/format.cc
index 8c6b0f3..63971db 100644
--- a/table/format.cc
+++ b/table/format.cc
@@ -36,7 +36,7 @@ void Footer::EncodeTo(std::string* dst) const {
metaindex_handle_.EncodeTo(dst);
index_handle_.EncodeTo(dst);
dst->resize(2 * BlockHandle::kMaxEncodedLength); // Padding
- PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber));
+ PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber & 0xffffffffu));
PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber >> 32));
assert(dst->size() == original_size + kEncodedLength);
}
@@ -71,7 +71,7 @@ Status ReadBlock(RandomAccessFile* file,
// Read the block contents as well as the type/crc footer.
// See table_builder.cc for the code that built this structure.
- size_t n = handle.size();
+ size_t n = static_cast<size_t>(handle.size());
char* buf = new char[n + kBlockTrailerSize];
Slice contents;
Status s = file->Read(handle.offset(), n + kBlockTrailerSize, &contents, buf);