Skip to content

Commit

Permalink
Run clang tidy
Browse files Browse the repository at this point in the history
- error: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int'
- error: Value stored to 'latIndex' is never read
- error: Value stored to 'lonIndex' is never read
  • Loading branch information
N1ckP3rsl3y committed Dec 16, 2024
1 parent 888bdf8 commit 97928ac
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/SW_netCDF_Input.c
Original file line number Diff line number Diff line change
Expand Up @@ -2929,7 +2929,7 @@ static void alloc_dom_coord_info(

if (allocArrays[coordArr]) {
allocSize = *domCoordSizes[coordArr];
if (numCoords > numGeo && coordArr < numGeo) {
if (numCoords > numGeo && coordArr < (size_t) numGeo) {
allocSize *= *domCoordSizes[coordArr + 1];
}

Expand Down Expand Up @@ -5160,8 +5160,6 @@ static void read_spatial_topo_climate_inputs(
missValFlags = SW_Domain->SW_PathInputs.missValFlags[currKey];
doubleMissVals = SW_Domain->SW_PathInputs.doubleMissVals[currKey];
dimOrderInVar = SW_Domain->netCDFInput.dimOrderInVar[currKey];
latIndex = dimOrderInVar[fIndex][0];
lonIndex = dimOrderInVar[fIndex][1];
start[0] = start[1] = start[2] = 0;
count[0] = count[1] = count[2] = 0;

Expand Down Expand Up @@ -6168,8 +6166,6 @@ static void read_veg_inputs(
}

inSiteDom = (Bool) (strcmp(inVarInfo[fIndex][INDOMTYPE], "s") == 0);
latIndex = dimOrderInVar[fIndex][0];
lonIndex = dimOrderInVar[fIndex][1];

/* Get the start indices based on if we need to use the respective
index file */
Expand Down Expand Up @@ -6598,8 +6594,6 @@ static void read_soil_inputs(
}

inSiteDom = (Bool) (strcmp(inVarInfo[fIndex][INDOMTYPE], "s") == 0);
latIndex = dimOrderInVar[fIndex][0];
lonIndex = dimOrderInVar[fIndex][1];

get_read_start(
useIndexFile, soilInFiles[0], inSiteDom, ncSUID, defSetStart, LogInfo
Expand Down Expand Up @@ -7421,8 +7415,6 @@ static void read_weather_input(
}

inSiteDom = (Bool) (strcmp(inVarInfo[fIndex][INDOMTYPE], "s") == 0);
latIndex = dimOrderInVar[fIndex][0];
lonIndex = dimOrderInVar[fIndex][1];

allocate_temp_weather(SW_Weather->n_years, &tempWeatherHist, LogInfo);
if (LogInfo->stopRun) {
Expand Down

0 comments on commit 97928ac

Please sign in to comment.