Skip to content

Commit

Permalink
Address rest of Ubuntu compiler warnings
Browse files Browse the repository at this point in the history
- Cast `strideOutYears` to unsigned int in SW_netCDF.c
- Initialize `inBufintRes` and `inBufDoubleVal` within `read_spp()`
  • Loading branch information
N1ckP3rsl3y committed Aug 6, 2024
1 parent 7104568 commit b9cefe3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/SW_VegEstab.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ static void read_spp(
int resSNP;
char name[80]; /* only allow 4 char sppnames */
char inbuf[MAX_FILENAMESIZE];
int inBufintRes;
double inBufDoubleVal;
int inBufintRes = 0;
double inBufDoubleVal = 0.;

Bool doIntConv;

Expand Down
3 changes: 2 additions & 1 deletion src/SW_netCDF.c
Original file line number Diff line number Diff line change
Expand Up @@ -3784,7 +3784,8 @@ void SW_NC_create_output_files(
1 :
(unsigned int) ceil((double) numYears / strideOutYears);

yearOffset = (strideOutYears == -1) ? numYears : strideOutYears;
yearOffset =
(strideOutYears == -1) ? numYears : (unsigned int) strideOutYears;

yearFormat = (strideOutYears == 1) ? (char *) "%d" : (char *) "%d-%d";

Expand Down

0 comments on commit b9cefe3

Please sign in to comment.