Changeset 16158


Ignore:
Timestamp:
09/17/13 16:00:44 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: cppcheck errors

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/ResetBoundaryConditions.cpp

    r16149 r16158  
    1010
    1111        /*variables: */
    12         Vector<IssmDouble>*    yg    = NULL;
    13         Nodes *nodes = NULL;
     12        Vector<IssmDouble>* yg = NULL;
    1413
    1514        if(VerboseSolution()) _printf0_("   updating boundary conditions...\n");
  • issm/trunk-jpl/src/c/analyses/controltao_core.cpp

    r16047 r16158  
    2929        AppCtx              user;
    3030        TaoSolver           tao = 0;
    31         IssmDouble         *dummy        = NULL;
    3231        int                *control_list = NULL;
    3332        Vector<IssmDouble> *X            = NULL;
     
    163162        AppCtx   *user      = (AppCtx *)userCtx;
    164163        FemModel *femmodel  = user->femmodel;
    165         Element  *element   = NULL;
    166164        int      *responses = NULL;
    167165
  • issm/trunk-jpl/src/c/analyses/dakota_core.cpp

    r16127 r16158  
    161161        char              *dakota_output_file = NULL;
    162162        char              *dakota_error_file  = NULL;
    163         int                status             = 0;
    164163        Dakota::ModelLIter ml_iter;
    165         Parameters        *parameters         = NULL;
    166164
    167165        /*Recover dakota_input_file, dakota_output_file and dakota_error_file, in the parameters dataset in parallel */
  • issm/trunk-jpl/src/c/analyses/gia_core.cpp

    r15849 r16158  
    1111void gia_core(FemModel* femmodel){
    1212
    13         int i;
    14         Vector<IssmDouble>*  wg  = NULL;
    15         Vector<IssmDouble>*  dwdtg  = NULL;
    16         IssmDouble*          x   = NULL;
    17         IssmDouble*          y   = NULL;
     13        Vector<IssmDouble> *wg    = NULL;
     14        Vector<IssmDouble> *dwdtg = NULL;
     15        IssmDouble          *x    = NULL;
     16        IssmDouble          *y    = NULL;
    1817
    1918        /*parameters: */
  • issm/trunk-jpl/src/c/analyses/stressbalance_core.cpp

    r15849 r16158  
    7878        }
    7979
    80         if (dim==3 & (isSIA || isSSA || isL1L2 || isHO)){
     80        if (dim==3 && (isSIA || isSSA || isL1L2 || isHO)){
    8181                if(VerboseSolution()) _printf0_("   computing vertical velocities\n");
    8282                femmodel->SetCurrentConfiguration(StressbalanceVerticalAnalysisEnum);
  • issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp

    r15067 r16158  
    535535                register int l=0; // level
    536536                register BamgQuadtreeBox * b;
    537                 Icoor1 h=MaxISize;
    538537                Icoor1 hb =  MaxISize;
    539538                Icoor1 i0=0,j0=0;
     
    549548                ii[0]=i0;
    550549                jj[0]=j0;
    551                 h=hb;
    552550                do {   
    553551                        b= pb[l];
     
    560558                                          {
    561559                                                R2 XY(X,b->v[k]->r);
    562                                                 double dd;
    563                                                 if( (dd= LengthInterpole(Mx(XY), b->v[k]->m(XY)))  < seuil ){
     560                                                if(LengthInterpole(Mx(XY), b->v[k]->m(XY)) < seuil){
    564561                                                        return b->v[k];
    565562                                                }
  • issm/trunk-jpl/src/c/bamg/Direction.cpp

    r12821 r16158  
    2727                int r =1;
    2828                if (dir!= MaxICoor) {
    29                         Icoor2 x(dir/2),y1(MaxICoor/2-Abs(x)),y(dir%2?-y1:y1);
     29                        Icoor2 x(dir/2),y1(MaxICoor/2-Abs(x)),y((dir%2)?-y1:y1);
    3030                        r = (x*i + y*j) >=0;
    3131                }
  • issm/trunk-jpl/src/c/bamg/Geometry.cpp

    r15104 r16158  
    6262
    6363                int verbose;
    64                 nbv=0;
    65                 nbe=0;
    6664                nbcurves=0;
    6765
     
    286284                int nbreqv=0;
    287285                int nbtan=0;
    288                 int nbcracked=0;
    289286                int i,count;
    290287
     
    378375                if (nbtan){
    379376                        bamggeom->TangentAtEdges=xNew<double>(4*nbtan);
    380                         count=0;
    381377                        for (i=0;i<nbe;i++){
    382378                                if (edges[i].TgA() && edges[i][0].Corner()){
     
    392388                                        bamggeom->TangentAtEdges[4*i+3]=edges[i].tg[1].y;
    393389                                }
    394                                 count=count+1;
    395390                        }
    396391                }
  • issm/trunk-jpl/src/c/bamg/ListofIntersectionTriangles.cpp

    r15100 r16158  
    4848
    4949                SegInterpolation* SegI=lSegsI;
    50                 SegI=lSegsI;
    5150                lSegsI[NbSeg].last=Size;
    5251                int EndSeg=Size;
     
    225224                Triangle *tbegin, *t;
    226225
    227                 long int verbose=2;
    228226                Icoor2 deta[3], deti,detj;
    229227                double ba[3];
    230                 int nbt =0,ifirst=-1,ilast;
     228                int ifirst=-1,ilast;
    231229                int i0,i1,i2;
    232230                int ocut,i,j,k=-1;
     
    288286                                if (t == tbegin) { //
    289287                                        double ba,bb;
    290                                         long int verbose=2;
    291288                                        AdjacentTriangle edge=CloseBoundaryEdge(a,t,ba,bb);
    292289                                        BamgVertex & v0 = *edge.EdgeVertex(0), & v1 = *edge.EdgeVertex(1);
  • issm/trunk-jpl/src/c/bamg/Mesh.cpp

    r16156 r16158  
    269269        void Mesh::ReadMesh(int* index,double* x,double* y,int nods,int nels){
    270270
    271                 double Hmin = HUGE_VAL;// the infinie value
    272271                long i1,i2,i3;
    273272                long i;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r16151 r16158  
    4343Penta::Penta(int penta_id, int penta_sid, int index, IoModel* iomodel,int nummodels)
    4444        :PentaRef(nummodels)
    45         ,ElementHook(nummodels,index+1,6,iomodel) //index+1: material id, iomodel->numberofelements+1: matpar id
    46                                                                       { //i is the element index
    47 
    48         int i;
     45        ,ElementHook(nummodels,index+1,6,iomodel){
     46
    4947        int penta_elements_ids[2];
    5048
    5149        /*Checks in debugging mode*/
    52         /*{{{*/
    5350        _assert_(iomodel->Data(MeshUpperelementsEnum));
    5451        _assert_(iomodel->Data(MeshLowerelementsEnum));
    55         /*}}}*/
    5652
    5753        /*id: */
     
    45444540
    45454541        /*Intermediaries*/
    4546         int        i,j,found=0;
     4542        int        i,found=0;
    45474543        int        stabilization;
    45484544        IssmDouble Jdet,phi,dt;
     
    65266522        int*         pdoflist=NULL;
    65276523        IssmDouble   FSreconditioning;
    6528         GaussPenta  *gauss;
    65296524
    65306525        /*Fetch number of nodes and dof for this finite element*/
     
    85868581
    85878582        /*Intermediaries */
    8588         int         i,j;
    85898583        int         approximation;
    85908584        IssmDouble  viscosity,Jdet;
     
    86328626                material->GetViscosity3dFS(&viscosity,&epsilon[0]);
    86338627
    8634                 for(i=0;i<NUMVERTICES;i++){
     8628                for(int i=0;i<NUMVERTICES;i++){
    86358629                        pe->values[i*NDOF3+0]+=-Jdet*gauss->weight*viscosity*dw[0]*dbasis[2][i];
    86368630                        pe->values[i*NDOF3+1]+=-Jdet*gauss->weight*viscosity*dw[1]*dbasis[2][i];
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp

    r15872 r16158  
    846846         * where h is the interpolation function for node i.
    847847         */
    848         int i;
    849         int num_dof=4;
    850 
     848
     849        int        num_dof=4;
    851850        IssmDouble L1L2l3[NUMNODESP1_2d];
    852851        IssmDouble dbasis[3][NUMNODESP1];
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r16153 r16158  
    2424/*FUNCTION Tria::Tria(){{{*/
    2525Tria::Tria(){
    26 
    27         int i;
    28 
    2926        this->nodes    = NULL;
    3027        this->vertices = NULL;
  • issm/trunk-jpl/src/c/toolkits/issm/Bucket.h

    r15838 r16158  
    131131                void SpawnBucketsPerCpu(DataSet* bucketsofcpu_i,int rank_i,int* rowranks){ /*{{{*/
    132132
    133                         int i,j;
    134 
    135133                        /*go through our idxm index of rows this bucket owns, and spawn buckets 
    136134                         *if these rows belong to cpu rank_i. Use rowranks to determine this.*/
    137                         for(i=0;i<m;i++){
     135                        for(int i=0;i<m;i++){
    138136                                if (rowranks[idxm[i]]==rank_i){
    139137                                        /*This row belongs to cpu rank_i, so spawn a bucket with this row, and add it to the bucketsofcpu_i dataset: */
     
    147145                        }
    148146
    149                 };
    150                 /*}}}*/
     147                }; /*}}}*/
    151148                int BucketType(void){ /*{{{*/
    152149
  • issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h

    r15838 r16158  
    149149
    150150                        int        *row_indices_forcpu = NULL;
    151                         int        *col_indices_forcpu = NULL;
    152151                        int        *modes_forcpu       = NULL;
    153152                        doubletype *values_forcpu      = NULL;
Note: See TracChangeset for help on using the changeset viewer.