Skip to content

Commit

Permalink
Format all files with format.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Sep 5, 2023
1 parent 012727f commit f6dc344
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 17 deletions.
47 changes: 47 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,cppcoreguidelines-pro-type-member-init,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-nullptr,readability-braces-around-statements,readability-redundant-member-init'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: '0'
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: '1'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
value: '1'
- key: cppcoreguidelines-pro-type-member-init.UseAssignment
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-bool-literals.IgnoreMacros
value: '0'
- key: modernize-use-default-member-init.IgnoreMacros
value: '0'
- key: modernize-use-default-member-init.UseAssignment
value: '1'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: readability-braces-around-statements.ShortStatementLines
value: '0'
...

14 changes: 7 additions & 7 deletions src/code/engine/UtilityFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ static Rotation axisToRotation(Vec3d finalDir, Vec3d initialDir) {
static std::vector<std::string>
listFiles(std::string path, std::string extension) // extension = ".txt"
{
std::vector<std::string> filePaths;
for (const auto &entry : std::filesystem::directory_iterator(path)) {
if (entry.path().extension() == extension) {
filePaths.push_back(entry.path().string());
}
}
return filePaths;
std::vector<std::string> filePaths;
for (const auto &entry : std::filesystem::directory_iterator(path)) {
if (entry.path().extension() == extension) {
filePaths.push_back(entry.path().string());
}
}
return filePaths;
}

static std::vector<std::string> listDirectory(std::string path) {
Expand Down
18 changes: 9 additions & 9 deletions src/code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ static std::string getEnvVar(const std::string &name) {
}

int main(int argc, char *argv[]) {
int n_threads = std::thread::hardware_concurrency();
std::string NUM_THREADS_ENV_VAR = getEnvVar("OMP_NUM_THREADS");
if (NUM_THREADS_ENV_VAR.empty()) {
Logging::logWarning(
int n_threads = std::thread::hardware_concurrency();
std::string NUM_THREADS_ENV_VAR = getEnvVar("OMP_NUM_THREADS");
if (NUM_THREADS_ENV_VAR.empty()) {
Logging::logWarning(
"OMP_NUM_THREADS not specified in your environment variable. Defaulting to number of physical cores: " + std::to_string(n_threads) + "\n");
} else {
n_threads = std::stoi(NUM_THREADS_ENV_VAR);
Logging::logColor("OMP_NUM_THREADS=" + std::to_string(n_threads) + "\n",
Logging::GREEN);
}
} else {
n_threads = std::stoi(NUM_THREADS_ENV_VAR);
Logging::logColor("OMP_NUM_THREADS=" + std::to_string(n_threads) + "\n",
Logging::GREEN);
}
bool parallelizeEigen = true;
if (OPENMP_ENABLED) {
Eigen::initParallel();
Expand Down
2 changes: 1 addition & 1 deletion src/code/simulation/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ void Simulation::step() {
(sceneConfig.timeStep * sceneConfig.timeStep) +
M_times_sn;
timeSteptimer.toc();

double deltav_prim_changes = 0;
std::pair<VecXd, VecXd> collisionResults;
timeSteptimer.tic("b_tilde and f");
Expand Down

0 comments on commit f6dc344

Please sign in to comment.