Commit e03e8c82 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Replace sequence of mutually exlusive ifs with switch.

parent b9031984
......@@ -2636,18 +2636,20 @@ static void gridComplete(grid_t *grid)
gridDefArea(gridID, area);
}
if ( gridtype == GRID_LAEA )
switch (gridtype)
{
case GRID_LAEA:
gridDefLaea(gridID, grid->laea_a, grid->laea_lon_0, grid->laea_lat_0);
if ( gridtype == GRID_LCC2 )
break;
case GRID_LCC2:
gridDefLcc2(gridID, grid->lcc2_a, grid->lcc2_lon_0, grid->lcc2_lat_0, grid->lcc2_lat_1, grid->lcc2_lat_2);
if ( gridtype == GRID_LCC )
break;
case GRID_LCC:
gridDefLCC(gridID, grid->lcc_originLon, grid->lcc_originLat, grid->lcc_lonParY,
grid->lcc_lat1, grid->lcc_lat2, grid->lcc_xinc, grid->lcc_yinc,
grid->lcc_projflag, grid->lcc_scanflag);
if ( gridtype == GRID_UNSTRUCTURED )
break;
case GRID_UNSTRUCTURED:
{
int number = grid->number;
int position = grid->position >= 0 ? grid->position : 0;
......@@ -2663,10 +2665,10 @@ static void gridComplete(grid_t *grid)
gridDefReference(gridID, reference);
}
}
if ( gridtype == GRID_PROJECTION )
{
break;
case GRID_PROJECTION:
grid->name = strdup(grid->name);
break;
}
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment