X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ff6722c4292f04aef9e1417b5698881f1fd414eb..abf3b21ad3f4a19475431076e6e2b26f76d2e7d6:/examples/smpi/NAS/DGraph.c?ds=sidebyside diff --git a/examples/smpi/NAS/DGraph.c b/examples/smpi/NAS/DGraph.c index 530bf3ee94..452abc674d 100644 --- a/examples/smpi/NAS/DGraph.c +++ b/examples/smpi/NAS/DGraph.c @@ -37,7 +37,7 @@ void nodeShow(DGNode* nd){ /* if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name); else if(nd->verified==0) fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name); - else fprintf(stderr,"%ld.%s\t: notverified.",nd->id,nd->name); + else fprintf(stderr,"%ld.%s\t: notverified.",nd->id,nd->name); */ } @@ -54,7 +54,8 @@ DGraph* newDGraph(char* nm){ } int AttachNode(DGraph* dg, DGNode* nd) { - int i=0,j,len=0; + int i = 0, j; + unsigned len = 0; DGNode **nds =NULL, *tmpnd=NULL; DGArc **ar=NULL; @@ -83,7 +84,7 @@ int AttachNode(DGraph* dg, DGNode* nd) { } memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *)); tmpnd->inDegree += nd->inDegree; - } + } if ( nd->outDegree > 0 ) { tmpnd->maxOutDegree += nd->maxOutDegree; ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*)); @@ -96,7 +97,7 @@ int AttachNode(DGraph* dg, DGNode* nd) { memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *)); tmpnd->outDegree += nd->outDegree; } - free(nd); + free(nd); return i; } nd->id = dg->numNodes;