Skip to content

Commit e353fbc

Browse files
committed
Release LevelDB 1.17
- Cleanup: delete unused IntSetToString It was added in http://cr/19491949 (and was referenced at the time). The last reference was removed in http://cr/19507363. This fixes warning/error with pre-release crosstoolv18: 'std::string leveldb::{anonymous}::IntSetToString(const std::set<long unsigned int>&)' defined but not used [-Werror=unused-function] - Added arm64 and and armv7s to IOS build as suggested on leveldb mailing list. - Changed local variable type from int to size_t This eliminates compiler warning/error and resolves https://code.google.com/p/leveldb/issues/detail?id=140
1 parent 269fc6c commit e353fbc

File tree

4 files changed

+8
-21
lines changed

4 files changed

+8
-21
lines changed

Makefile

+6-5
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ SHARED = $(SHARED1)
7272
else
7373
# Update db.h if you change these.
7474
SHARED_MAJOR = 1
75-
SHARED_MINOR = 16
75+
SHARED_MINOR = 17
7676
SHARED1 = libleveldb.$(PLATFORM_SHARED_EXT)
7777
SHARED2 = $(SHARED1).$(SHARED_MAJOR)
7878
SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR)
@@ -190,19 +190,20 @@ PLATFORMSROOT=/Applications/Xcode.app/Contents/Developer/Platforms
190190
SIMULATORROOT=$(PLATFORMSROOT)/iPhoneSimulator.platform/Developer
191191
DEVICEROOT=$(PLATFORMSROOT)/iPhoneOS.platform/Developer
192192
IOSVERSION=$(shell defaults read $(PLATFORMSROOT)/iPhoneOS.platform/version CFBundleShortVersionString)
193+
IOSARCH=-arch armv6 -arch armv7 -arch armv7s -arch arm64
193194

194195
.cc.o:
195196
mkdir -p ios-x86/$(dir $@)
196-
$(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@
197+
$(CXX) $(CXXFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@
197198
mkdir -p ios-arm/$(dir $@)
198-
xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@
199+
xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk $(IOSARCH) -c $< -o ios-arm/$@
199200
lipo ios-x86/$@ ios-arm/$@ -create -output $@
200201

201202
.c.o:
202203
mkdir -p ios-x86/$(dir $@)
203-
$(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -c $< -o ios-x86/$@
204+
$(CC) $(CFLAGS) -isysroot $(SIMULATORROOT)/SDKs/iPhoneSimulator$(IOSVERSION).sdk -arch i686 -arch x86_64 -c $< -o ios-x86/$@
204205
mkdir -p ios-arm/$(dir $@)
205-
xcrun -sdk iphoneos $(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk -arch armv6 -arch armv7 -c $< -o ios-arm/$@
206+
xcrun -sdk iphoneos $(CC) $(CFLAGS) -isysroot $(DEVICEROOT)/SDKs/iPhoneOS$(IOSVERSION).sdk $(IOSARCH) -c $< -o ios-arm/$@
206207
lipo ios-x86/$@ ios-arm/$@ -create -output $@
207208

208209
else

db/version_set.cc

-14
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,6 @@ static int64_t TotalFileSize(const std::vector<FileMetaData*>& files) {
5454
return sum;
5555
}
5656

57-
namespace {
58-
std::string IntSetToString(const std::set<uint64_t>& s) {
59-
std::string result = "{";
60-
for (std::set<uint64_t>::const_iterator it = s.begin();
61-
it != s.end();
62-
++it) {
63-
result += (result.size() > 1) ? "," : "";
64-
result += NumberToString(*it);
65-
}
66-
result += "}";
67-
return result;
68-
}
69-
} // namespace
70-
7157
Version::~Version() {
7258
assert(refs_ == 0);
7359

include/leveldb/db.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace leveldb {
1414

1515
// Update Makefile if you change these
1616
static const int kMajorVersion = 1;
17-
static const int kMinorVersion = 16;
17+
static const int kMinorVersion = 17;
1818

1919
struct Options;
2020
struct ReadOptions;

include/leveldb/slice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ inline bool operator!=(const Slice& x, const Slice& y) {
9494
}
9595

9696
inline int Slice::compare(const Slice& b) const {
97-
const int min_len = (size_ < b.size_) ? size_ : b.size_;
97+
const size_t min_len = (size_ < b.size_) ? size_ : b.size_;
9898
int r = memcmp(data_, b.data_, min_len);
9999
if (r == 0) {
100100
if (size_ < b.size_) r = -1;

0 commit comments

Comments
 (0)