mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-21 16:09:40 +00:00
small clang build fixes
This commit is contained in:
parent
88f2a3541a
commit
dad7fcb5a3
@ -59,7 +59,7 @@ void Serialize(Writer& writer, IndexedFile* file) {
|
|||||||
assert(file->Resolve(it->second)->uses.size() == 0);
|
assert(file->Resolve(it->second)->uses.size() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SERIALIZE(json_name, member_name) Serialize(writer, json_name, def.##member_name)
|
#define SERIALIZE(json_name, member_name) Serialize(writer, json_name, def.member_name)
|
||||||
|
|
||||||
writer.StartObject();
|
writer.StartObject();
|
||||||
|
|
||||||
@ -137,13 +137,13 @@ void Serialize(Writer& writer, IndexedFile* file) {
|
|||||||
#undef WRITE
|
#undef WRITE
|
||||||
}
|
}
|
||||||
|
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::string& output) {
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::string& output) {
|
||||||
auto it = document.FindMember(name);
|
auto it = document.FindMember(name);
|
||||||
if (it != document.MemberEnd())
|
if (it != document.MemberEnd())
|
||||||
output = it->value.GetString();
|
output = it->value.GetString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<std::string>& output) {
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<std::string>& output) {
|
||||||
auto it = document.FindMember(name);
|
auto it = document.FindMember(name);
|
||||||
if (it != document.MemberEnd()) {
|
if (it != document.MemberEnd()) {
|
||||||
for (auto& entry : it->value.GetArray())
|
for (auto& entry : it->value.GetArray())
|
||||||
@ -151,13 +151,13 @@ void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const cha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, optional<Location>& output) {
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, optional<Location>& output) {
|
||||||
auto it = document.FindMember(name);
|
auto it = document.FindMember(name);
|
||||||
if (it != document.MemberEnd())
|
if (it != document.MemberEnd())
|
||||||
output = Location(it->value.GetString()); // TODO: Location parsing not implemented in Location type.
|
output = Location(it->value.GetString()); // TODO: Location parsing not implemented in Location type.
|
||||||
}
|
}
|
||||||
|
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Location>& output) {
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Location>& output) {
|
||||||
auto it = document.FindMember(name);
|
auto it = document.FindMember(name);
|
||||||
if (it != document.MemberEnd()) {
|
if (it != document.MemberEnd()) {
|
||||||
for (auto& array_value : it->value.GetArray())
|
for (auto& array_value : it->value.GetArray())
|
||||||
@ -165,11 +165,11 @@ void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const cha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Deserialize(Reader& reader, IndexedFile* file) {
|
void Deserialize(const Reader& reader, IndexedFile* file) {
|
||||||
#define DESERIALIZE(json_name, member_name) Deserialize(entry, json_name, def.##member_name)
|
#define DESERIALIZE(json_name, member_name) Deserialize(entry, json_name, def.member_name)
|
||||||
|
|
||||||
auto& types = reader["types"].GetArray();
|
const auto& types = reader["types"].GetArray();
|
||||||
for (auto& entry : types) {
|
for (const auto& entry : types) {
|
||||||
TypeId id(entry["id"].GetInt64());
|
TypeId id(entry["id"].GetInt64());
|
||||||
std::string usr = entry["usr"].GetString();
|
std::string usr = entry["usr"].GetString();
|
||||||
|
|
||||||
@ -188,8 +188,8 @@ void Deserialize(Reader& reader, IndexedFile* file) {
|
|||||||
file->types.push_back(def);
|
file->types.push_back(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& functions = reader["functions"].GetArray();
|
const auto& functions = reader["functions"].GetArray();
|
||||||
for (auto& entry : functions) {
|
for (const auto& entry : functions) {
|
||||||
FuncId id(entry["id"].GetInt64());
|
FuncId id(entry["id"].GetInt64());
|
||||||
std::string usr = entry["usr"].GetString();
|
std::string usr = entry["usr"].GetString();
|
||||||
|
|
||||||
@ -209,8 +209,8 @@ void Deserialize(Reader& reader, IndexedFile* file) {
|
|||||||
file->funcs.push_back(def);
|
file->funcs.push_back(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& vars = reader["variables"].GetArray();
|
const auto& vars = reader["variables"].GetArray();
|
||||||
for (auto& entry : vars) {
|
for (const auto& entry : vars) {
|
||||||
VarId id(entry["id"].GetInt64());
|
VarId id(entry["id"].GetInt64());
|
||||||
std::string usr = entry["usr"].GetString();
|
std::string usr = entry["usr"].GetString();
|
||||||
|
|
||||||
|
16
serializer.h
16
serializer.h
@ -63,14 +63,14 @@ void Serialize(Writer& writer, IndexedFile* file);
|
|||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, optional<Id<T>>& output) {
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, optional<Id<T>>& output) {
|
||||||
auto it = document.FindMember(name);
|
auto it = document.FindMember(name);
|
||||||
if (it != document.MemberEnd())
|
if (it != document.MemberEnd())
|
||||||
output = Id<T>(it->value.GetUint64());
|
output = Id<T>(it->value.GetUint64());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Id<T>>& output) {
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Id<T>>& output) {
|
||||||
auto it = document.FindMember(name);
|
auto it = document.FindMember(name);
|
||||||
if (it != document.MemberEnd()) {
|
if (it != document.MemberEnd()) {
|
||||||
for (auto& array_value : it->value.GetArray())
|
for (auto& array_value : it->value.GetArray())
|
||||||
@ -79,7 +79,7 @@ void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Ref<T>>& output) {
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Ref<T>>& output) {
|
||||||
auto it = document.FindMember(name);
|
auto it = document.FindMember(name);
|
||||||
if (it != document.MemberEnd()) {
|
if (it != document.MemberEnd()) {
|
||||||
for (auto& array_value : it->value.GetArray()) {
|
for (auto& array_value : it->value.GetArray()) {
|
||||||
@ -90,11 +90,11 @@ void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const cha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::string& output);
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::string& output);
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<std::string>& output);
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<std::string>& output);
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, optional<Location>& output);
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, optional<Location>& output);
|
||||||
void Deserialize(rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Location>& output);
|
void Deserialize(const rapidjson::GenericValue<rapidjson::UTF8<>>& document, const char* name, std::vector<Location>& output);
|
||||||
void Deserialize(Reader& reader, IndexedFile* file);
|
void Deserialize(const Reader& reader, IndexedFile* file);
|
||||||
|
|
||||||
std::string Serialize(IndexedFile* file);
|
std::string Serialize(IndexedFile* file);
|
||||||
IndexedFile Deserialize(std::string path, std::string serialized);
|
IndexedFile Deserialize(std::string path, std::string serialized);
|
||||||
|
8
task.cc
8
task.cc
@ -1,4 +1,4 @@
|
|||||||
#include <cassert>>
|
#include <cassert>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
#include "query.h"
|
#include "query.h"
|
||||||
#include "optional.h"
|
#include "optional.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "third_party/tiny-process-library/process.hpp"
|
//#include "third_party/tiny-process-library/process.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
@ -64,7 +64,7 @@ private:
|
|||||||
struct Task {
|
struct Task {
|
||||||
int priority = 0;
|
int priority = 0;
|
||||||
bool writes_to_index = false;
|
bool writes_to_index = false;
|
||||||
|
|
||||||
enum class Kind {
|
enum class Kind {
|
||||||
CreateIndex,
|
CreateIndex,
|
||||||
IndexImport,
|
IndexImport,
|
||||||
@ -221,4 +221,4 @@ int main252525225(int argc, char** argv) {
|
|||||||
|
|
||||||
std::cin.get();
|
std::cin.get();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user