Changeset 16521


Ignore:
Timestamp:
10/22/13 14:18:40 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixed some warnings from compiler

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

Legend:

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

    r16233 r16521  
    350350
    351351                                        /*if the next box exists:*/
    352                                         if (b=b->b[k]){
     352                                        if((b=b->b[k])){
    353353
    354354                                                /*Get size (hb) and coordinates of the current sub-box lowest left corner*/
  • issm/trunk-jpl/src/c/bamg/Mesh.cpp

    r16280 r16521  
    11521152
    11531153                //some checks
    1154                 if (( infvertexindex <0 ) && (detOld <0) ||  ( infvertexindex >=0  ) && (detOld >0) ){
     1154                if(((infvertexindex <0 ) && (detOld <0)) ||  ((infvertexindex >=0) && (detOld >0)) ){
    11551155                        _error_("inconsistent configuration (Contact ISSM developers)");
    11561156                }
     
    27612761                        vertices=new BamgVertex[maxnbv];
    27622762                        _assert_(vertices);
    2763                         orderedvertices=new (BamgVertex* [maxnbv]);
     2763                        orderedvertices=new BamgVertex* [maxnbv];
    27642764                        _assert_(orderedvertices);
    27652765                        triangles=new Triangle[maxnbt];
     
    30103010                        _error_("!Gh.nbe");
    30113011                }
    3012                 Edge **e= new (Edge* [Gh.nbe]);
     3012                Edge **e= new Edge* [Gh.nbe];
    30133013
    30143014                long i;
     
    31153115                        for (int j=0;j<3;j++){
    31163116                                Triangle &tt = *t.TriangleAdj(j);
    3117                                 if ( ! &tt ||  it < GetId(tt) && ( tt.link || t.link)){
     3117                                if ( (!&tt ||  it < GetId(tt)) && ( tt.link || t.link)){
    31183118                                        BamgVertex &v0 = t[VerticesOfTriangularEdge[j][0]];
    31193119                                        BamgVertex &v1 = t[VerticesOfTriangularEdge[j][1]];
     
    49674967                         }
    49684968                        BamgVertex *aa = tc.EdgeVertex(0), *bb = tc.EdgeVertex(1);
    4969                         if (( aa == &a ) && (bb == &b) ||  (bb ==  &a ) && (aa == &b)) {
     4969                        if (((aa == &a ) && (bb == &b)) ||((bb ==  &a ) && (aa == &b))){
    49704970                                tc.SetLock();
    49714971                                a.Optim(1,0);
     
    51095109                        detsb=-detsb;
    51105110
    5111                         if (ToSwap)
     5111                        if(ToSwap){
    51125112                         if (dets2 < 0) {// haut
    51135113                                 dets1 = (ToSwap ? dets1 : detsa) ;
    51145114                                 detsa = dets2;
    51155115                                 tt1 =  Previous(tt2) ;}
    5116                          else if (dets2 > 0){// bas
     5116                         else if(dets2 > 0){// bas
    51175117                                 dets1 = (ToSwap ? dets1 : detsb) ;
    51185118                                 detsb =  dets2;
     
    51225122                                 tt1 = Next(tt2);
    51235123                                 ret =0;}
     5124                        }
    51245125
    51255126                }
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp

    r16350 r16521  
    12261226        if(*Jdet<0) _error_("negative jacobian determinant!");
    12271227}
    1228 /*}}}*
     1228/*}}}*/
    12291229/*FUNCTION PentaRef::GetSegmentJacobianDeterminant{{{*/
    12301230void PentaRef::GetSegmentJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussPenta* gauss){
  • issm/trunk-jpl/src/c/kml/KMLFileReadUtils.cpp

    r15843 r16521  
    314314
    315315        /*  return next non " =?/>" and move past subsequent " =?/>"  */
    316         while (ktokn=strtok(NULL," =?/>")) {
     316        while((ktokn=strtok(NULL," =?/>"))){
    317317
    318318                /*  return next non quote and move past subsequent quote  */
     
    358358/*  get additional token and compare to closing tag  */
    359359
    360         if (ktag)
     360        if(ktag){
    361361                if (!(kstr=KMLFileToken(fid,
    362362                                                                NULL,NULL)) ||
     
    365365                        (strncmp(&(kstr[2]),&(ktag[1]),strlen(ktag)-1)))
    366366                  {_error_("KMLFileTokenParse -- Missing closing tag for " << ktag << ".\n");}
    367                 else
     367                else{
    368368                        xDelete<char>(kstr);
     369                }
     370        }
    369371
    370372//      _printf0_("KMLFileTokenParse -- " << ktag << "=" << *pival << ".\n");
     
    392394/*  get additional token and compare to closing tag  */
    393395
    394         if (ktag)
     396        if(ktag){
    395397                if (!(kstr=KMLFileToken(fid,
    396398                                                                NULL,NULL)) ||
     
    401403                else
    402404                        xDelete<char>(kstr);
     405        }
    403406
    404407//      _printf0_("KMLFileTokenParse -- " << ktag << "=" << (*pbval ? "true" : "false") << ".\n");
     
    453456/*  get additional token and compare to closing tag  */
    454457
    455         if (ktag)
     458        if(ktag){
    456459                if (!(kstr=KMLFileToken(fid,
    457460                                                                NULL,NULL)) ||
     
    462465                else
    463466                        xDelete<char>(kstr);
     467        }
    464468
    465469//      _printf0_("KMLFileTokenParse -- " << ktag << "=\"" << pstr << "\".\n");
     
    487491/*  get additional token and compare to closing tag  */
    488492
    489         if (ktag)
     493        if(ktag){
    490494                if (!(kstr=KMLFileToken(fid,
    491495                                                                NULL,NULL)) ||
     
    496500                else
    497501                        xDelete<char>(kstr);
     502        }
    498503
    499504//      _printf0_("KMLFileTokenParse -- " << ktag << "=" << *pfval << ".\n");
     
    521526/*  get additional token and compare to closing tag  */
    522527
    523         if (ktag)
     528        if(ktag){
    524529                if (!(kstr=KMLFileToken(fid,
    525530                                                                NULL,NULL)) ||
     
    530535                else
    531536                        xDelete<char>(kstr);
     537        }
    532538
    533539//      _printf0_("KMLFileTokenParse -- " << ktag << "=" << *pdval << ".\n");
     
    554560                _error_("KMLFileTokenParse -- Missing double [m] field for " << ktag << ".\n");
    555561
    556         if (!*pdval)
     562        if(!*pdval){
    557563                if (maxlen)
    558564                        *pdval=xNew<IssmPDouble>(maxlen            );
    559565                else
    560566                        *pdval=xNew<IssmPDouble>((strlen(kstr)+1)/2);
     567        }
    561568
    562569/*  loop through string to get all values  */
     
    585592/*  get additional token and compare to closing tag  */
    586593
    587         if (ktag)
     594        if(ktag){
    588595                if (!(kstr=KMLFileToken(fid,
    589596                                                                NULL,NULL)) ||
     
    594601                else
    595602                        xDelete<char>(kstr);
     603        }
    596604
    597605//      _printf0_("KMLFileTokenParse -- " << ktag << "=...\n");
     
    620628                _error_("KMLFileTokenParse -- Missing double [m x n] field for " << ktag << ".\n");
    621629
    622         if (!*pdval)
     630        if(!*pdval){
    623631                if (maxlen)
    624632                        *pdval=xNew<IssmPDouble>(maxlen*n          );
    625633                else
    626634                        *pdval=xNew<IssmPDouble>((strlen(kstr)+1)/2);
     635        }
    627636
    628637/*  loop through string to get all values  */
     
    655664/*  get additional token and compare to closing tag  */
    656665
    657         if (ktag)
     666        if(ktag){
    658667                if (!(kstr=KMLFileToken(fid,
    659668                                                                NULL,NULL)) ||
     
    664673                else
    665674                        xDelete<char>(kstr);
     675        }
    666676
    667677//      _printf0_("KMLFileTokenParse -- " << ktag << "=...\n");
     
    673683/*}}}*/
    674684/*FUNCTION  KMLFileTagSkip {{{*/
    675 int KMLFileTagSkip(char* ktag,
    676                                    FILE* fid){
     685int KMLFileTagSkip(char* ktag, FILE* fid){
    677686
    678687        char*   kstr;
     
    685694/*  if next token is a closing tag, compare to input  */
    686695
    687         while (kstr=KMLFileToken(fid,
    688                                                          NULL,NULL)) {
    689                 if      ((kstr[0] == '<') &&
    690                                  (kstr[1] == '/') &&
    691                                  (!strncmp(&(kstr[2]),&(ktag[1]),(strcspn(ktag," >")-1)/sizeof(char)))) {
     696        while((kstr=KMLFileToken(fid,NULL,NULL))){
     697                if((kstr[0] == '<') && (kstr[1] == '/') && (!strncmp(&(kstr[2]),&(ktag[1]),(strcspn(ktag," >")-1)/sizeof(char)))){
    692698                        _printf0_("KMLFileTagSkip -- closing tag " << kstr << ".\n");
    693699                        xDelete<char>(kstr);
  • issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp

    r15104 r16521  
    8686        sprintf(klsty->color     ,"ff000000");
    8787        sprintf(klsty->colormode ,"normal");
    88         klsty->width     ,lwidth;
     88        klsty->width     =lwidth;
    8989        kpsty =new KML_PolyStyle();
    9090        sprintf(kpsty->color     ,"00ffffff");
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp

    r15557 r16521  
    9999
    100100                        /*Inside convex but outside mesh*/
    101                         if (reft[it]<0 & isdefault){
     101                        if (reft[it]<0 && isdefault){
    102102                                for(j=0;j<N_data;j++) data_interp[i*N_data+j]=defaultvalue;
    103103                                continue;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Damage/CreateLoadsDamage.cpp

    r16188 r16521  
    1919
    2020                /*keep only this partition's nodes:*/
    21                 if((iomodel->my_vertices[i]==1)){
     21                if(iomodel->my_vertices[i]){
    2222                        if (xIsNan<IssmDouble>(iomodel->Data(DamageSpcdamageEnum)[i])){ //No penalty applied on spc nodes!
    2323                                loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,DamageEvolutionAnalysisEnum));
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCInefficient/CreateLoadsHydrologyDCInefficient.cpp

    r16291 r16521  
    2424                if (iomodel->meshtype==Mesh3DEnum){
    2525                        /*keep only this partition's nodes:*/
    26                         if((iomodel->my_vertices[i]==1)){
     26                        if(iomodel->my_vertices[i]){
    2727                                loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum));
    2828                        }
    2929                }
    3030                else if(reCast<int>(iomodel->Data(MeshVertexonbedEnum)[i])){
    31                         if((iomodel->my_vertices[i]==1)){
     31                        if(iomodel->my_vertices[i]){
    3232                                loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum));
    3333                        }       
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp

    r16291 r16521  
    2020
    2121        for(int i=0;i<iomodel->numberofvertices;i++){
    22                 if((iomodel->my_vertices[i]==1)){
     22                if(iomodel->my_vertices[i]){
    2323                        if (reCast<int>(iomodel->Data(MeshVertexonbedEnum)[i])){
    2424                                loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,MeltingAnalysisEnum));
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/StressbalanceSIA/CreateConstraintsStressbalanceSIA.cpp

    r16164 r16521  
    3838                /*keep only this partition's nodes:*/
    3939                if((iomodel->my_vertices[i])){
    40                         if (!reCast<int,IssmDouble>(iomodel->Data(FlowequationVertexEquationEnum)[i])==SIAApproximationEnum){
     40                        if (reCast<int,IssmDouble>(iomodel->Data(FlowequationVertexEquationEnum)[i])!=SIAApproximationEnum){
    4141
    4242                                constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,StressbalanceSIAAnalysisEnum));
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r16291 r16521  
    2121
    2222                /*keep only this partition's nodes:*/
    23                 if((iomodel->my_vertices[i]==1)){
     23                if(iomodel->my_vertices[i]){
    2424                        if (xIsNan<IssmDouble>(iomodel->Data(ThermalSpctemperatureEnum)[i])){ //No penalty applied on spc nodes!
    2525                                loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,ThermalAnalysisEnum));
  • issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp

    r16149 r16521  
    223223        sprintf(klsty->color     ,"ff000000");
    224224        sprintf(klsty->colormode ,"normal");
    225         klsty->width     ,lwidth;
     225        klsty->width     =lwidth;
    226226        kpsty =new KML_PolyStyle();
    227227        sprintf(kpsty->color     ,"00ffffff");
  • issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp

    r16231 r16521  
    474474                                node3=segments[3*k+0]-1; node4=segments[3*k+1]-1;
    475475                                /*We are trying to find 2 elements, where position of node3 == position of node1, and position of node4 == position of node2*/
    476                                 if (   (x[node3]==x[node1]) && (y[node3]==y[node1]) && (x[node4]==x[node2]) && (y[node4]==y[node2])
    477                                     || (x[node3]==x[node2]) && (y[node3]==y[node2]) && (x[node4]==x[node1]) && (y[node4]==y[node1])  ){
     476                                if (   ((x[node3]==x[node1]) && (y[node3]==y[node1]) && (x[node4]==x[node2]) && (y[node4]==y[node2]))
     477                                    || ((x[node3]==x[node2]) && (y[node3]==y[node2]) && (x[node4]==x[node1]) && (y[node4]==y[node1]))  ){
    478478                                        /*We found the corresponding element: */
    479479                                        pairs[2*j+1]=segments[3*k+2];
Note: See TracChangeset for help on using the changeset viewer.