Fixing code style issues
This commit is contained in:
parent
fc1009913e
commit
8b22c4372a
@ -82,7 +82,7 @@ bool CompilationDatabase::DatabaseSuccessfullyLoaded() {
|
|||||||
|
|
||||||
|
|
||||||
CompilationInfoForFile CompilationDatabase::GetCompilationInfoForFile(
|
CompilationInfoForFile CompilationDatabase::GetCompilationInfoForFile(
|
||||||
const std::string &path_to_file ) {
|
const std::string &path_to_file ) {
|
||||||
CompilationInfoForFile info;
|
CompilationInfoForFile info;
|
||||||
|
|
||||||
if ( !is_loaded_ )
|
if ( !is_loaded_ )
|
||||||
@ -107,14 +107,14 @@ CompilationInfoForFile CompilationDatabase::GetCompilationInfoForFile(
|
|||||||
0 );
|
0 );
|
||||||
|
|
||||||
info.compiler_working_dir_ = CXStringToString(
|
info.compiler_working_dir_ = CXStringToString(
|
||||||
clang_CompileCommand_getDirectory( command ) );
|
clang_CompileCommand_getDirectory( command ) );
|
||||||
|
|
||||||
uint num_flags = clang_CompileCommand_getNumArgs( command );
|
uint num_flags = clang_CompileCommand_getNumArgs( command );
|
||||||
info.compiler_flags_.reserve( num_flags );
|
info.compiler_flags_.reserve( num_flags );
|
||||||
|
|
||||||
for ( uint i = 0; i < num_flags; ++i ) {
|
for ( uint i = 0; i < num_flags; ++i ) {
|
||||||
info.compiler_flags_.push_back(
|
info.compiler_flags_.push_back(
|
||||||
CXStringToString( clang_CompileCommand_getArg( command, i ) ) );
|
CXStringToString( clang_CompileCommand_getArg( command, i ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
@ -123,7 +123,7 @@ CompilationInfoForFile CompilationDatabase::GetCompilationInfoForFile(
|
|||||||
|
|
||||||
Future< AsyncCompilationInfoForFile >
|
Future< AsyncCompilationInfoForFile >
|
||||||
CompilationDatabase::GetCompilationInfoForFileAsync(
|
CompilationDatabase::GetCompilationInfoForFileAsync(
|
||||||
const std::string &path_to_file ) {
|
const std::string &path_to_file ) {
|
||||||
// TODO: throw exception when threading is not enabled and this is called
|
// TODO: throw exception when threading is not enabled and this is called
|
||||||
if ( !threading_enabled_ )
|
if ( !threading_enabled_ )
|
||||||
return Future< AsyncCompilationInfoForFile >();
|
return Future< AsyncCompilationInfoForFile >();
|
||||||
@ -134,9 +134,9 @@ CompilationDatabase::GetCompilationInfoForFileAsync(
|
|||||||
path_to_file );
|
path_to_file );
|
||||||
|
|
||||||
InfoTask task =
|
InfoTask task =
|
||||||
make_shared< packaged_task< AsyncCompilationInfoForFile > >(
|
make_shared< packaged_task< AsyncCompilationInfoForFile > >(
|
||||||
bind( ReturnValueAsShared< CompilationInfoForFile >,
|
bind( ReturnValueAsShared< CompilationInfoForFile >,
|
||||||
functor ) );
|
functor ) );
|
||||||
|
|
||||||
unique_future< AsyncCompilationInfoForFile > future = task->get_future();
|
unique_future< AsyncCompilationInfoForFile > future = task->get_future();
|
||||||
info_task_stack_.Push( task );
|
info_task_stack_.Push( task );
|
||||||
|
@ -47,10 +47,10 @@ public:
|
|||||||
void EnableThreading();
|
void EnableThreading();
|
||||||
|
|
||||||
CompilationInfoForFile GetCompilationInfoForFile(
|
CompilationInfoForFile GetCompilationInfoForFile(
|
||||||
const std::string &path_to_file );
|
const std::string &path_to_file );
|
||||||
|
|
||||||
Future< AsyncCompilationInfoForFile > GetCompilationInfoForFileAsync(
|
Future< AsyncCompilationInfoForFile > GetCompilationInfoForFileAsync(
|
||||||
const std::string &path_to_file );
|
const std::string &path_to_file );
|
||||||
|
|
||||||
typedef boost::shared_ptr <
|
typedef boost::shared_ptr <
|
||||||
boost::packaged_task< AsyncCompilationInfoForFile > > InfoTask;
|
boost::packaged_task< AsyncCompilationInfoForFile > > InfoTask;
|
||||||
|
@ -37,7 +37,7 @@ typedef shared_ptr <
|
|||||||
remove_pointer< CXCodeCompleteResults >::type > CodeCompleteResultsWrap;
|
remove_pointer< CXCodeCompleteResults >::type > CodeCompleteResultsWrap;
|
||||||
|
|
||||||
TranslationUnit::TranslationUnit()
|
TranslationUnit::TranslationUnit()
|
||||||
: filename_(""),
|
: filename_( "" ),
|
||||||
clang_translation_unit_( NULL ) {
|
clang_translation_unit_( NULL ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ extern const unsigned int MIN_ASYNC_THREADS = 2;
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void QueryThreadMain(
|
void QueryThreadMain(
|
||||||
IdentifierCompleter::LatestQueryTask &latest_query_task ) {
|
IdentifierCompleter::LatestQueryTask &latest_query_task ) {
|
||||||
while ( true ) {
|
while ( true ) {
|
||||||
try {
|
try {
|
||||||
( *latest_query_task.Get() )();
|
( *latest_query_task.Get() )();
|
||||||
|
Loading…
Reference in New Issue
Block a user