Skip to content

Commit

Permalink
Merge pull request #46 from r-barnes/Develop
Browse files Browse the repository at this point in the history
Fix Compiler Warnings
  • Loading branch information
dtarb committed May 2, 2016
2 parents 7a8736a + 423c3a0 commit 254d9a8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.o
9 changes: 9 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Linux Compilation Instructions
==============================

Type `make` on the command line to initiate compilation.

It may be necessary to modify `makefile`:

* Uncomment the line `INCDIRS=-I/usr/lib/openmpi/include -I/usr/include/gdal`
* On the line beginning with `all :` remove the `clean` target from the end
6 changes: 3 additions & 3 deletions src/flood.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int flood( char* demfile, char* felfile, char *sfdrfile, int usesfdr, bool verbo
if(verbose) // debug writes
{
printf("Header read\n");
printf("Process: %d, totalX: %d, totalY: %d\n",rank,totalX,totalY);
printf("Process: %d, totalX: %ld, totalY: %ld\n",rank,totalX,totalY);
printf("Process: %d, nx: %d, ny: %d\n",rank,nx,ny);
printf("Process: %d, xstart: %d, ystart: %d\n",rank,xstart,ystart);
if (use_mask)
Expand Down Expand Up @@ -149,7 +149,7 @@ int flood( char* demfile, char* felfile, char *sfdrfile, int usesfdr, bool verbo
long nxm=nx/2;
long nym=ny/2;
elevDEM->getData(nxm,nym,tempFloat);
printf("Midpoint of partition: %d, nxm: %d, nym: %d, value: %f\n",rank,nxm,nym,tempFloat);
printf("Midpoint of partition: %d, nxm: %ld, nym: %ld, value: %f\n",rank,nxm,nym,tempFloat);
fflush(stdout);
}

Expand Down Expand Up @@ -486,7 +486,7 @@ int flood( char* demfile, char* felfile, char *sfdrfile, int usesfdr, bool verbo
long nxm=nx/2;
long nym=ny/2;
planchon->getData(nxm,nym,tempFloat);
printf("Result midpoint of partition: %ld, nxm: %ld, nym: %d, value: %f\n",rank,nxm,nym,tempFloat);
printf("Result midpoint of partition: %d, nxm: %ld, nym: %ld, value: %f\n",rank,nxm,nym,tempFloat);
fflush(stdout);
}

Expand Down
6 changes: 3 additions & 3 deletions src/streamnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ int netsetup(char *pfile,char *srcfile,char *ordfile,char *ad8file,char *elevfil
if(verbose) // debug writes
{
printf("Files read\n");
printf("Process: %d, TotalX: %d, TotalY: %d\n",rank,TotalX,TotalY);
printf("Process: %d, TotalX: %ld, TotalY: %ld\n",rank,TotalX,TotalY);
printf("Process: %d, nx: %d, ny: %d\n",rank,nx,ny);
printf("Process: %d, xstart: %d, ystart: %d\n",rank,xstart,ystart);
printf("Process: %d, numOutlets: %d\n",rank,numOutlets);
Expand Down Expand Up @@ -1131,7 +1131,7 @@ int netsetup(char *pfile,char *srcfile,char *ordfile,char *ad8file,char *elevfil
long dotinc=myNumLinks/ndots;

for(ilink=0;ilink<myNumLinks;ilink++){//only once per link
fprintf(fTreeOut,"\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",LinkIdU1U2DMagShapeidCoords[ilink][0],LinkIdU1U2DMagShapeidCoords[ilink][1],LinkIdU1U2DMagShapeidCoords[ilink][2],LinkIdU1U2DMagShapeidCoords[ilink][3],LinkIdU1U2DMagShapeidCoords[ilink][4],LinkIdU1U2DMagShapeidCoords[ilink][5],LinkIdU1U2DMagShapeidCoords[ilink][6],LinkIdU1U2DMagShapeidCoords[ilink][7],LinkIdU1U2DMagShapeidCoords[ilink][8]);
fprintf(fTreeOut,"\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\n",LinkIdU1U2DMagShapeidCoords[ilink][0],LinkIdU1U2DMagShapeidCoords[ilink][1],LinkIdU1U2DMagShapeidCoords[ilink][2],LinkIdU1U2DMagShapeidCoords[ilink][3],LinkIdU1U2DMagShapeidCoords[ilink][4],LinkIdU1U2DMagShapeidCoords[ilink][5],LinkIdU1U2DMagShapeidCoords[ilink][6],LinkIdU1U2DMagShapeidCoords[ilink][7],LinkIdU1U2DMagShapeidCoords[ilink][8]);
//fflush(fTreeOut);
long i1=LinkIdU1U2DMagShapeidCoords[ilink][1];
long i2=LinkIdU1U2DMagShapeidCoords[ilink][2];
Expand Down Expand Up @@ -1183,7 +1183,7 @@ int netsetup(char *pfile,char *srcfile,char *ordfile,char *ad8file,char *elevfil
nextdot=0;
for(ilink=0;ilink<procNumLinks;++ilink){
MPI_Recv(&treeBuf,9,MPI_LONG,i,1,MCW,&mystatus);
fprintf(fTreeOut,"\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",treeBuf[0],treeBuf[1]+numPointsPrinted,treeBuf[2]+numPointsPrinted,treeBuf[3],treeBuf[4],treeBuf[5],treeBuf[6],treeBuf[7],treeBuf[8]);
fprintf(fTreeOut,"\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t%ld\n",treeBuf[0],treeBuf[1]+numPointsPrinted,treeBuf[2]+numPointsPrinted,treeBuf[3],treeBuf[4],treeBuf[5],treeBuf[6],treeBuf[7],treeBuf[8]);

MPI_Recv(&procNumPoints,1,MPI_INT,i,0,MCW,&mystatus);//get points one at a time and print them to file
// Variables for shape
Expand Down
2 changes: 1 addition & 1 deletion src/streamnetmn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ int main(int argc,char **argv)
i++;
if(argc > i)
{
sscanf(argv[i],"%d",&lyrno);
sscanf(argv[i],"%ld",&lyrno);
i++;
}
else goto errexit;
Expand Down
2 changes: 1 addition & 1 deletion src/tiffIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ email: [email protected]
#include "ogr_api.h"
// #include "tiffIO.h" Part of commonLib.h
#include <ogr_spatialref.h>
#include<math.h>;
#include <math.h>
#include "commonLib.h"
#include <iostream>
using namespace std;
Expand Down

0 comments on commit 254d9a8

Please sign in to comment.