Changeset 16152


Ignore:
Timestamp:
09/17/13 14:35:17 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: more cppcheck errors

Location:
issm/trunk-jpl/src/c
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/bamg/Mesh.cpp

    r15219 r16152  
    122122                  }
    123123                  for (i=0;i<Tho.nbt;i++)
    124                         if(  reft[i] >=0 && flag[i])
    125                           {
     124                        if(reft[i] >=0 && flag[i]){
    126125                                const Triangle & t = Tho.triangles[i];
    127126                                int i0 = Tho.GetId(t[0]);
    128127                                int i1 = Tho.GetId(t[1]);
    129128                                int i2 = Tho.GetId(t[2]);
    130                                 if (i0<0 || i1<0 || i2<0){
     129                                if(i0<0 || i1<0 || i2<0){
    131130                                        delete [] refv;
    132131                                        _error_("i0<0 || i1<0 || i2< 0");
    133132                                }
    134                                 if (i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
     133                                if(i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv){
     134                                        delete [] refv;
    135135                                        _error_("i0>=Tho.nbv || i1>=Tho.nbv || i2>=Tho.nbv");
    136136                                }
     
    41384138         first_np_or_next_t1[i]=-1;
    41394139        kk=0;
    4140         while (Head0>=0&& kk++<100) {
     4140        while(Head0>=0&& kk++<100){
    41414141                kch=0;
    4142                 for (i=Head0;i>=0;i=first_np_or_next_t0[ip=i],first_np_or_next_t0[ip]=-1) {
     4142                for(i=Head0;i>=0;i=first_np_or_next_t0[ip=i],first_np_or_next_t0[ip]=-1) {
    41434143                        //  pour tous les triangles autour du sommet s
    41444144                        register Triangle* t= vertices[i].t;
  • issm/trunk-jpl/src/c/shared/Bamg/HeapSort.h

    r15072 r16152  
    8585                }
    8686        }
     87
     88        /*Make cppcheck happy*/
     89        *porder=order;
    8790}/*}}}*/
    8891
  • issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp

    r15839 r16152  
    1515ErrorException::ErrorException(const string &what_arg){/*{{{*/
    1616
    17         what_str=what_arg;
    18         file_name="";
    19         function_name="";
    20         file_line=0;
     17        what_str      = what_arg;
     18        file_name     = "";
     19        function_name = "";
     20        file_line     = 0;
     21
    2122}/*}}}*/
    2223ErrorException::ErrorException(const string& what_file, const string& what_function,int what_line, const string& what_arg){/*{{{*/
    2324
    24         what_str=what_arg;
    25         file_name=what_file;
    26         function_name=what_function;
    27         file_line=what_line;
     25        what_str      = what_arg;
     26        file_name     = what_file;
     27        function_name = what_function;
     28        file_line     = what_line;
     29
    2830}/*}}}*/
    2931ErrorException::~ErrorException() throw(){/*{{{*/
  • issm/trunk-jpl/src/c/shared/Exceptions/exceptions.h

    r15104 r16152  
    8383        public:
    8484        ErrorException(const string &what_arg); //for windows
    85         ErrorException(const stringwhat_file,const string& what_function,int what_line,const string& what_arg);//UNIX
     85        ErrorException(const string &what_file,const string& what_function,int what_line,const string& what_arg);//UNIX
    8686        ~ErrorException() throw();
    8787        virtual const char *what() const throw();
  • issm/trunk-jpl/src/c/shared/LatLong/Ll2xyx.cpp

    r15741 r16152  
    4646        int     i,iret=0;
    4747        double  delta,slat;
    48         double  cde,re,ex2,ex;
     48        double  re,ex2,ex;
    4949        double  latitude,longitude;
    5050        double  T,rho,sl,tc,mc;
     
    5555        slat  = standard_parallel;
    5656
    57         /*  Conversion constant from degrees to radians  */
    58         cde = 57.29577951;
    5957        /*  Radius of the earth in meters  */
    6058        re  = 6378.273*1.e3;
  • issm/trunk-jpl/src/c/shared/LatLong/Xy2llx.cpp

    r15741 r16152  
    4848        int     i,iret=0;
    4949        double  delta,slat;
    50         double  cde,re,ex2,ex;
     50        double  re,ex2,ex;
    5151        double  sl,rho,cm,T,chi;
    5252
     
    5656        slat  = standard_parallel;
    5757
    58         /*  Conversion constant from degrees to radians  */
    59         cde  = 57.29577951;
    6058        /*  Radius of the earth in meters  */
    6159        re   = 6378.273e+3;
  • issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp

    r15741 r16152  
    4545        static IssmPDouble* xip [MAX_LINE_GAUS_PTS]={xi1  ,xi2  ,xi3  ,xi4  };
    4646
    47         static int np[MAX_LINE_GAUS_PTS]={sizeof(wgt1 )/sizeof(IssmPDouble),
    48                 sizeof(wgt2 )/sizeof(IssmPDouble),
    49                 sizeof(wgt3 )/sizeof(IssmPDouble),
    50                 sizeof(wgt4 )/sizeof(IssmPDouble)};
    51 
    52         //      _printf0_("Gauss-Legendre recurrence coefficients ngaus=" << ngaus << "\n");
    5347        *pxgaus =xNew<IssmPDouble>(ngaus);
    5448        *pxwgt  =xNew<IssmPDouble>(ngaus);
    5549
    5650        /*  check to see if Gauss points need to be calculated  */
    57         if (ngaus <= MAX_LINE_GAUS_PTS) {
     51        if(ngaus <= MAX_LINE_GAUS_PTS) {
    5852
    5953                /*  copy the points from the static arrays (noting that the pointers
     
    6155                         have to know to not free them)  */
    6256
    63                 for (i=0; i<ngaus; i++) {
     57                for(i=0; i<ngaus; i++) {
    6458                        (*pxgaus)[i]=xip [ngaus-1][i];
    6559                        (*pxwgt )[i]=wgtp[ngaus-1][i];
    6660                }
    6761        }
    68         else {
     62        else{
    6963
    7064                /*  calculate the Gauss points using recurrence relations  */
     
    12591253                0.250000000000000, 0.500000000000000, 0.166666666666667,
    12601254                0.166666666666667, 0.166666666666667};
    1261         static IssmPDouble l23[]={
    1262                 0.250000000000000, 0.166666666666667, 0.500000000000000,
    1263                 0.166666666666667, 0.166666666666667};
    12641255        static IssmPDouble l33[]={
    12651256                0.250000000000000, 0.166666666666667, 0.166666666666667,
     
    15111502        static IssmPDouble* xip [MAX_LINE_GLOB_PTS]={xi1  ,xi2  ,xi3  ,xi4  ,xi5  };
    15121503
    1513         static int np[MAX_LINE_GLOB_PTS]={sizeof(wgt1 )/sizeof(IssmPDouble),
    1514                 sizeof(wgt2 )/sizeof(IssmPDouble),
    1515                 sizeof(wgt3 )/sizeof(IssmPDouble),
    1516                 sizeof(wgt4 )/sizeof(IssmPDouble),
    1517                 sizeof(wgt5 )/sizeof(IssmPDouble)};
    1518 
    1519         //      _printf0_("Gauss-Lobatto recurrence coefficients ngaus=" << ngaus << "\n");
    15201504        *pxgaus =xNew<IssmPDouble>(ngaus);
    15211505        *pxwgt  =xNew<IssmPDouble>(ngaus);
  • issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h

    r16144 r16152  
    504504                IssmAbsVec<IssmDouble>* Solve(IssmAbsVec<IssmDouble>* pfin, Parameters* parameters){
    505505
    506                         int i;
    507 
    508506                        /*output: */
    509507                        IssmMpiVec<IssmDouble>* uf=NULL;
     
    523521                                        #endif
    524522                                        return (IssmAbsVec<IssmDouble>*)uf;
    525                                         break;
    526                                                                 }
     523                                                                         }
    527524                                case GslEnum: {
    528525
     
    535532
    536533                                        return (IssmAbsVec<IssmDouble>*)uf;
    537                                         break;
    538534                                        #else
    539535                                        _error_("GSL support not compiled in!");
    540536                                        #endif
    541                                                           }
     537                                                                  }
    542538                                default:
    543539                                        _error_("solver type not supported yet!");
  • issm/trunk-jpl/src/c/toolkits/mumps/MpiDenseMumpsSolve.cpp

    r16149 r16152  
    110110        /*Variables*/
    111111        ISSM_MPI_Comm  comm;
    112         int            my_rank;
    113112        int            num_procs;
    114113        int            i,j;
     
    125124
    126125        /*Communicator info */
    127         my_rank   = IssmComm::GetRank();
    128126        num_procs = IssmComm::GetSize();
    129127        comm      = IssmComm::GetComm();
Note: See TracChangeset for help on using the changeset viewer.