Skip to content

Commit

Permalink
The battle agains coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusFrankATcernch committed May 23, 2024
1 parent c7a0173 commit 92bbd04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions DDCore/src/plugins/VisDensityProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ static void* create_object(Detector& description, int argc, char** argv) {
if ( argv[i] ) {
if ( ::strncmp(argv[i],"-vis",6) == 0 ) {
VisAttr vis = description.visAttributes(argv[++i]);
if ( vis.isValid() ) proc->minVis = vis;
if ( vis.isValid() ) proc->minVis = std::move(vis);
continue;
}
else if ( ::strncmp(argv[i],"-min-vis",6) == 0 ) {
VisAttr vis = description.visAttributes(argv[++i]);
if ( vis.isValid() ) proc->minVis = vis;
if ( vis.isValid() ) proc->minVis = std::move(vis);
continue;
}
else if ( ::strncmp(argv[i],"-min-density",6) == 0 ) {
Expand All @@ -125,7 +125,7 @@ static void* create_object(Detector& description, int argc, char** argv) {
}
else if ( ::strncmp(argv[i],"-name",4) == 0 ) {
std::string name = argv[++i];
proc->name = name;
proc->name = std::move(name);
continue;
}
else if ( ::strncmp(argv[i],"-show",4) == 0 ) {
Expand Down
9 changes: 3 additions & 6 deletions DDParsers/src/Evaluator/Evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,7 @@ int Evaluator::Object::setVariable(const char * name, const char * expression)

void Evaluator::Object::setVariableNoLock(const char * name, double value) {
std::string item_name = name;
Item item(value);
imp->theDictionary[item_name] = item;
imp->theDictionary[item_name] = Item(value);
}

int Evaluator::Object::setFunction(const char * name,double (*fun)()) {
Expand Down Expand Up @@ -837,14 +836,12 @@ int Evaluator::Object::setFunction(const char * name, double (*fun)(double,doubl

void Evaluator::Object::setFunctionNoLock(const char * name,double (*fun)(double)) {
std::string item_name = "1"+std::string(name);
Item item(FCN(fun).ptr);
imp->theDictionary[item_name] = item;
imp->theDictionary[item_name] = Item(FCN(fun).ptr);
}

void Evaluator::Object::setFunctionNoLock(const char * name, double (*fun)(double,double)) {
std::string item_name = "2"+std::string(name);
Item item(FCN(fun).ptr);
imp->theDictionary[item_name] = item;
imp->theDictionary[item_name] = Item(FCN(fun).ptr);
}


Expand Down

0 comments on commit 92bbd04

Please sign in to comment.