Commit 2ae99257 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Simplify statements.

parent beeb2819
......@@ -1680,7 +1680,7 @@ void confp3(double pval, int *kexp, int *kmant, int kbits, int kround)
/* Section 2 . Convert value of zero. */
/* ----------------------------------------------------------------- */
if ( ! (fabs(pval) > 0))
if (fabs(pval) <= 0)
{
*kexp = 0;
*kmant = 0;
......
......@@ -362,7 +362,7 @@ void cdiGridTypeInit(grid_t *gridptr, int gridtype, size_t size)
// used also in CDO
void gridGenXvals(int xsize, double xfirst, double xlast, double xinc, double *restrict xvals)
{
if ( (! (fabs(xinc) > 0)) && xsize > 1 )
if (fabs(xinc) <= 0 && xsize > 1)
{
if ( xfirst >= xlast )
{
......@@ -458,7 +458,7 @@ void gridGenYvals(int gridtype, int ysize, double yfirst, double ylast, double y
/* else if ( gridtype == GRID_LONLAT || gridtype == GRID_GENERIC ) */
else
{
if ( (! (fabs(yinc) > 0)) && ysize > 1 )
if (fabs(yinc) <= 0 && ysize > 1)
{
if ( IS_EQUAL(yfirst, ylast) && IS_NOT_EQUAL(yfirst, 0) ) ylast *= -1;
......@@ -1929,7 +1929,7 @@ double gridInqXinc(int gridID)
grid_t *gridptr = grid_to_pointer(gridID);
const double *restrict xvals = gridptr->vtable->inqXValsPtr(gridptr);
if ( (! (fabs(gridptr->x.inc) > 0)) && xvals )
if (fabs(gridptr->x.inc) <= 0 && xvals)
{
size_t xsize = gridptr->x.size;
if ( xsize > 1 ) gridptr->x.inc = grid_calc_increment(xsize, xvals);
......@@ -1953,7 +1953,7 @@ double gridInqYinc(int gridID)
grid_t *gridptr = grid_to_pointer(gridID);
const double *yvals = gridptr->vtable->inqYValsPtr(gridptr);
if ( (! (fabs(gridptr->y.inc) > 0)) && yvals )
if (fabs(gridptr->y.inc) <= 0 && yvals)
{
size_t ysize = gridptr->y.size;
if ( ysize > 1 ) gridptr->y.inc = grid_calc_increment(ysize, yvals);
......
......@@ -1433,7 +1433,7 @@ void cdfDefZaxisChar(stream_t *streamptr, int zaxisID, char *axisname, int *dimI
char dimname[CDI_MAX_NAME+3]; dimname[0] = 0;
cdiZaxisInqKeyStr(zaxisID, CDI_KEY_DIMNAME, CDI_MAX_NAME, dimname);
*dimID = checkDimName(fileID, dimlen, dimname);
if ( !(dimlen > 0) )
if (dimlen <= 0)
Error("No strings delivered for a character axis.");
if ( dimname[0] == 0 ) { memcpy(dimname, "area_type", 10); dimname[10] = 0; }
......
Markdown is supported
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