Skip to content

Commit

Permalink
Merge pull request #29880 from fwyzard/Apply_clang-format_CondTools
Browse files Browse the repository at this point in the history
Apply code checks to the CondTools packages
  • Loading branch information
cmsbuild committed May 20, 2020
2 parents fc108a4 + 123aa78 commit 5e91448
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions CondTools/Hcal/interface/CmdLine.h
Expand Up @@ -121,7 +121,7 @@ namespace cmdline {
// Subsequent classes will throw exceptions of the following class
class CmdLineError {
public:
inline CmdLineError(const char* msg = 0) : os_(new std::ostringstream()) {
inline CmdLineError(const char* msg = nullptr) : os_(new std::ostringstream()) {
if (msg)
*os_ << msg;
}
Expand Down Expand Up @@ -155,7 +155,7 @@ namespace cmdline {

inline OneShotIStream(const std::string& s) : str_(s), valid_(true), readout_(false) {}

inline operator void*() const { return valid_ && !readout_ ? (void*)this : (void*)0; }
inline operator void*() const { return valid_ && !readout_ ? (void*)this : (void*)nullptr; }

template <typename T>
inline bool operator>>(T& obj) {
Expand Down Expand Up @@ -193,7 +193,7 @@ namespace cmdline {
inline std::string demangle(T& obj) const {
int status;
const std::type_info& ti = typeid(obj);
char* realname = abi::__cxa_demangle(ti.name(), 0, 0, &status);
char* realname = abi::__cxa_demangle(ti.name(), nullptr, nullptr, &status);
std::string s(realname);
free(realname);
return s;
Expand Down Expand Up @@ -275,7 +275,7 @@ namespace cmdline {

inline const char* progname() const { return progname_.c_str(); }

inline bool has(const char* shortOpt, const char* longOpt = 0) {
inline bool has(const char* shortOpt, const char* longOpt = nullptr) {
bool found = false;
for (Optlist::iterator it = find(shortOpt, longOpt); it != args_.end(); it = find(shortOpt, longOpt)) {
found = true;
Expand All @@ -288,7 +288,7 @@ namespace cmdline {
return found;
}

inline OneShotIStream option(const char* shortOpt, const char* longOpt = 0) {
inline OneShotIStream option(const char* shortOpt, const char* longOpt = nullptr) {
OneShotIStream result;
for (Optlist::iterator it = find(shortOpt, longOpt); it != args_.end(); it = find(shortOpt, longOpt)) {
Optlist::iterator it0(it);
Expand All @@ -304,7 +304,7 @@ namespace cmdline {
return result;
}

inline OneShotIStream require(const char* shortOpt, const char* longOpt = 0) {
inline OneShotIStream require(const char* shortOpt, const char* longOpt = nullptr) {
const OneShotIStream& is(option(shortOpt, longOpt));
if (!is.isValid()) {
const char empty[] = "";
Expand Down Expand Up @@ -340,7 +340,7 @@ namespace cmdline {
}

private:
CmdLine();
CmdLine() = delete;

std::string progname_;
Optlist args_;
Expand Down
14 changes: 7 additions & 7 deletions CondTools/Hcal/interface/visualizeHFPhase1PMTParams.h
Expand Up @@ -20,13 +20,13 @@ struct VisualizationOptions {
bool verbose{false};

void load(cmdline::CmdLine& cmdline) {
cmdline.option(0, "--minAsymm") >> minAsymm;
cmdline.option(0, "--maxAsymm") >> maxAsymm;
cmdline.option(0, "--minCharge") >> minCharge;
cmdline.option(0, "--maxCharge") >> maxCharge;
cmdline.option(0, "--minTDC") >> minTDC;
cmdline.option(0, "--maxTDC") >> maxTDC;
cmdline.option(0, "--plotPoints") >> plotPoints;
cmdline.option(nullptr, "--minAsymm") >> minAsymm;
cmdline.option(nullptr, "--maxAsymm") >> maxAsymm;
cmdline.option(nullptr, "--minCharge") >> minCharge;
cmdline.option(nullptr, "--maxCharge") >> maxCharge;
cmdline.option(nullptr, "--minTDC") >> minTDC;
cmdline.option(nullptr, "--maxTDC") >> maxTDC;
cmdline.option(nullptr, "--plotPoints") >> plotPoints;
verbose = cmdline.has("-v");
}

Expand Down

0 comments on commit 5e91448

Please sign in to comment.