提交 a9f0e2b5 编写于 作者: I Igor Canadi

Fix compile

Summary: as title, we have unused variables. this is a short-term solution

Test Plan: compiles

Reviewers: IslamAbdelRahman, sdong, rven

Reviewed By: rven

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D34125
上级 e7c434c3
fbson commit: c8f16edf02243dce5a9dc48495f8f5a99f1c7895
fbson commit:
https://github.com/facebook/mysql-5.6/commit/c8f16edf02243dce5a9dc48495f8f5a99f1c7895
......@@ -916,7 +916,7 @@ class DocumentDBImpl : public DocumentDB {
for (const auto& update : updates.Items()) {
if (update.first == "$set") {
JSONDocumentBuilder builder;
bool res = builder.WriteStartObject();
bool res __attribute__((unused)) = builder.WriteStartObject();
assert(res);
for (const auto& itr : update.second.Items()) {
if (itr.first == kPrimaryKey) {
......
......@@ -46,7 +46,7 @@ void InitJSONDocument(std::unique_ptr<char[]>* data,
Func f) {
// TODO(stash): maybe add function to FbsonDocument to avoid creating array?
fbson::FbsonWriter writer;
bool res = writer.writeStartArray();
bool res __attribute__((unused)) = writer.writeStartArray();
assert(res);
uint32_t bytesWritten __attribute__((unused)) = f(writer);
assert(bytesWritten != 0);
......@@ -67,7 +67,7 @@ void InitString(std::unique_ptr<char[]>* data,
const std::string& s) {
InitJSONDocument(data, value, std::bind(
[](fbson::FbsonWriter& writer, const std::string& str) -> uint32_t {
bool res = writer.writeStartString();
bool res __attribute__((unused)) = writer.writeStartString();
assert(res);
auto bytesWritten = writer.writeString(str.c_str(),
static_cast<uint32_t>(str.length()));
......@@ -113,7 +113,7 @@ bool IsComparable(fbson::FbsonValue* left, fbson::FbsonValue* right) {
void CreateArray(std::unique_ptr<char[]>* data, fbson::FbsonValue** value) {
fbson::FbsonWriter writer;
bool res = writer.writeStartArray();
bool res __attribute__((unused)) = writer.writeStartArray();
assert(res);
res = writer.writeEndArray();
assert(res);
......@@ -126,7 +126,7 @@ void CreateArray(std::unique_ptr<char[]>* data, fbson::FbsonValue** value) {
void CreateObject(std::unique_ptr<char[]>* data, fbson::FbsonValue** value) {
fbson::FbsonWriter writer;
bool res = writer.writeStartObject();
bool res __attribute__((unused)) = writer.writeStartObject();
assert(res);
res = writer.writeEndObject();
assert(res);
......@@ -402,7 +402,7 @@ bool CompareSimpleTypes(fbson::FbsonValue* left, fbson::FbsonValue* right) {
return memcmp(left, right, left->numPackedBytes()) == 0;
}
bool Compare(fbson::FbsonValue* left, fbson::FbsonValue* right) {
bool CompareFbsonValue(fbson::FbsonValue* left, fbson::FbsonValue* right) {
if (!IsComparable(left, right)) {
return false;
}
......@@ -432,8 +432,8 @@ bool Compare(fbson::FbsonValue* left, fbson::FbsonValue* right) {
if (rightObject->find(str.c_str()) == nullptr) {
return false;
}
if (!Compare(keyValue.value(),
rightObject->find(str.c_str()))) {
if (!CompareFbsonValue(keyValue.value(),
rightObject->find(str.c_str()))) {
return false;
}
}
......@@ -447,7 +447,7 @@ bool Compare(fbson::FbsonValue* left, fbson::FbsonValue* right) {
return false;
}
for (int i = 0; i < static_cast<int>(leftArr->numElem()); ++i) {
if (!Compare(leftArr->get(i), rightArr->get(i))) {
if (!CompareFbsonValue(leftArr->get(i), rightArr->get(i))) {
return false;
}
}
......@@ -462,7 +462,7 @@ bool Compare(fbson::FbsonValue* left, fbson::FbsonValue* right) {
} // namespace
bool JSONDocument::operator==(const JSONDocument& rhs) const {
return Compare(value_, rhs.value_);
return CompareFbsonValue(value_, rhs.value_);
}
bool JSONDocument::operator!=(const JSONDocument& rhs) const {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册