Changeset 1816


Ignore:
Timestamp:
Nov 2, 2011 11:25:47 AM (8 years ago)
Author:
mjs
Message:

Eclipse code analyzer recommendations: (a) catch exceptions by reference; (b) parenthesize multi-term Boolean expressions; (c) virtual methods need virtual dtors (and Eclipse likes to see the keyword); (d) operator=() should return *this (and check for self-assignment).

Location:
branches/ClpForOsi2/Clp
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/ClpForOsi2/Clp/examples/addRows.cpp

    r1662 r1816  
    274274          }
    275275          model.addRows(buildObject3, true);
    276      } catch (CoinError e) {
     276     } catch (CoinError& e) {
    277277          e.print();
    278278          if (e.lineNumber() >= 0)
  • branches/ClpForOsi2/Clp/src/ClpDualRowSteepest.cpp

    r1732 r1816  
    4242     persistence_ = rhs.persistence_;
    4343     model_ = rhs.model_;
    44      if ((model_ && model_->whatsChanged() & 1) != 0) {
     44     if ((model_ && (model_->whatsChanged() & 1)) != 0) {
    4545          int number = model_->numberRows();
    4646          if (rhs.savedWeights_)
  • branches/ClpForOsi2/Clp/src/ClpMain.cpp

    r1726 r1816  
    815815                                   try {
    816816                                        status = model2->initialSolve(solveOptions);
    817                                    } catch (CoinError e) {
     817                                   } catch (CoinError& e) {
    818818                                        e.print();
    819819                                        status = -1;
  • branches/ClpForOsi2/Clp/src/ClpModel.cpp

    r1732 r1816  
    27302730     try {
    27312731          status = m.readMps(fileName, "");
    2732      } catch (CoinError e) {
     2732     } catch (CoinError& e) {
    27332733          e.print();
    27342734          status = -1;
  • branches/ClpForOsi2/Clp/src/ClpPrimalColumnSteepest.cpp

    r1732 r1816  
    5757     sizeFactorization_ = rhs.sizeFactorization_;
    5858     devex_ = rhs.devex_;
    59      if ((model_ && model_->whatsChanged() & 1) != 0) {
     59     if ((model_ && (model_->whatsChanged() & 1)) != 0) {
    6060          if (rhs.infeasible_) {
    6161               infeasible_ = new CoinIndexedVector(rhs.infeasible_);
  • branches/ClpForOsi2/Clp/test/OsiClpSolverInterfaceTest.cpp

    r1745 r1816  
    143143        OSIUNITTEST_ADD_OUTCOME("clp", "setObjCoeff on empty model", "should throw exception", OsiUnitTest::TestOutcome::ERROR, false);
    144144      }
    145       catch (CoinError e) {
     145      catch (CoinError& e) {
    146146        if (OsiUnitTest::verbosity >= 1)
    147147          std::cout<<"Correct throw from setObjCoeff on empty model"<<std::endl;
     
    158158        OSIUNITTEST_ADD_OUTCOME("clp", "setColSetBounds on cols not in model", "should throw exception", OsiUnitTest::TestOutcome::ERROR, false);
    159159      }
    160       catch (CoinError e) {
     160      catch (CoinError& e) {
    161161        if (OsiUnitTest::verbosity >= 1)
    162162          std::cout<<"Correct throw from setObjCoeff on empty model"<<std::endl;
Note: See TracChangeset for help on using the changeset viewer.