Skip to content

Commit

Permalink
Update C++ formatting to avoid inline short functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrosame committed Apr 25, 2020
1 parent 68a008e commit 66c4f37
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
Expand Down
12 changes: 9 additions & 3 deletions src/bindings/PyDP/algorithms/algorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ class BoundedMeanDummy {
obj = DP_NewBoundedMean(epsilon, lower, upper);
}

BoundedMeanDummy(double epsilon) { obj = DP_NewBoundedMean1(epsilon); }
BoundedMeanDummy(double epsilon) {
obj = DP_NewBoundedMean1(epsilon);
}

double Result(py::list l) { return DP_ResultBoundedMean(obj, l); }
double Result(py::list l) {
return DP_ResultBoundedMean(obj, l);
}

~BoundedMeanDummy() { DP_DeleteBoundedMean(obj); }
~BoundedMeanDummy() {
DP_DeleteBoundedMean(obj);
}

DP_BoundedMeanInt* obj;
};
Expand Down
8 changes: 6 additions & 2 deletions src/bindings/PyDP/base/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ class Logging_helper {
Logging_helper(const char* directory, const char* file_name, int level) {
dpbase::InitLogging(directory, file_name, level);
}
int get_vlog_level() { return dpbase::get_vlog_level(); }
int get_vlog_level() {
return dpbase::get_vlog_level();
}

std::__cxx11::string get_log_directory() { return dpbase::get_log_directory(); }
std::__cxx11::string get_log_directory() {
return dpbase::get_log_directory();
}
};

void init_base_logging(py::module& m) {
Expand Down
4 changes: 3 additions & 1 deletion src/bindings/c/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ DP_BoundedMeanInt* DP_NewBoundedMean1(double epsilon) {
return new DP_BoundedMeanInt{epsilon};
}

void DP_DeleteBoundedMean(DP_BoundedMeanInt* config) { delete config; };
void DP_DeleteBoundedMean(DP_BoundedMeanInt* config) {
delete config;
};

} // end namespace differential_privacy
} // end extern "C"

0 comments on commit 66c4f37

Please sign in to comment.