cquery_member_hierarchy.cc: Change uint64_t to size_t (#304)

This commit is contained in:
Fangrui Song 2018-01-18 10:13:25 -08:00 committed by GitHub
parent 9b8a0b01e6
commit 3c23ed8047

View File

@ -17,7 +17,7 @@ struct Ipc_CqueryMemberHierarchyExpand
const static IpcId kIpcId = IpcId::CqueryMemberHierarchyExpand; const static IpcId kIpcId = IpcId::CqueryMemberHierarchyExpand;
lsRequestId id; lsRequestId id;
struct Params { struct Params {
uint64_t type_id; size_t type_id;
}; };
Params params; Params params;
}; };
@ -29,7 +29,7 @@ struct Out_CqueryMemberHierarchy
: public lsOutMessage<Out_CqueryMemberHierarchy> { : public lsOutMessage<Out_CqueryMemberHierarchy> {
struct Entry { struct Entry {
std::string name; std::string name;
uint64_t type_id; // FIXME: should be size_t size_t type_id;
lsLocation location; lsLocation location;
}; };
lsRequestId id; lsRequestId id;
@ -74,7 +74,7 @@ ExpandNode(QueryDatabase* db,
Out_CqueryMemberHierarchy::Entry entry; Out_CqueryMemberHierarchy::Entry entry;
entry.name = var.def->short_name; entry.name = var.def->short_name;
entry.type_id = entry.type_id =
var.def->variable_type ? var.def->variable_type->id : uint64_t(-1); var.def->variable_type ? var.def->variable_type->id : size_t(-1);
if (var.def->definition_spelling) { if (var.def->definition_spelling) {
optional<lsLocation> loc = optional<lsLocation> loc =
GetLsLocation(db, working_files, *var.def->definition_spelling); GetLsLocation(db, working_files, *var.def->definition_spelling);
@ -125,7 +125,7 @@ struct CqueryMemberHierarchyExpandHandler
Out_CqueryMemberHierarchy out; Out_CqueryMemberHierarchy out;
out.id = request->id; out.id = request->id;
// |ExpandNode| uses -1 to indicate invalid |type_id|. // |ExpandNode| uses -1 to indicate invalid |type_id|.
if (request->params.type_id != uint64_t(-1)) if (request->params.type_id != size_t(-1))
out.result = out.result =
ExpandNode(db, working_files, QueryTypeId(request->params.type_id)); ExpandNode(db, working_files, QueryTypeId(request->params.type_id));