mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
Reformat
This commit is contained in:
parent
d8d794fb4e
commit
4a7ca6168f
@ -48,7 +48,8 @@ unsigned GetCompletionPriority(const CXCompletionString& str,
|
||||
|
||||
template <typename T>
|
||||
char* tofixedbase64(T input, char* out) {
|
||||
const char *digits = "./0123456789"
|
||||
const char* digits =
|
||||
"./0123456789"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz";
|
||||
int len = (sizeof(T) * 8 - 1) / 6 + 1;
|
||||
@ -450,9 +451,10 @@ void CompletionQueryMain(ClangCompleteManager* completion_manager) {
|
||||
|
||||
char buf[16];
|
||||
ls_completion_item.sortText =
|
||||
tofixedbase64(GetCompletionPriority(
|
||||
result.CompletionString, result.CursorKind,
|
||||
ls_completion_item.label), buf);
|
||||
tofixedbase64(GetCompletionPriority(result.CompletionString,
|
||||
result.CursorKind,
|
||||
ls_completion_item.label),
|
||||
buf);
|
||||
|
||||
ls_result.push_back(ls_completion_item);
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ ClangIndex::ClangIndex() : ClangIndex(1, 0) {}
|
||||
|
||||
ClangIndex::ClangIndex(int exclude_declarations_from_pch,
|
||||
int display_diagnostics) {
|
||||
// llvm::InitializeAllTargets (and possibly others) called by clang_createIndex
|
||||
// transtively modifies/reads lib/Support/TargetRegistry.cpp FirstTarget.
|
||||
// There will be a race condition if two threads call clang_createIndex
|
||||
// concurrently.
|
||||
// llvm::InitializeAllTargets (and possibly others) called by
|
||||
// clang_createIndex transtively modifies/reads lib/Support/TargetRegistry.cpp
|
||||
// FirstTarget. There will be a race condition if two threads call
|
||||
// clang_createIndex concurrently.
|
||||
static std::mutex mutex_;
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user