Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
b90a56ca
Commit
b90a56ca
authored
Dec 03, 2014
by
Uwe Schulzweida
Browse files
cast result of lround to int
parent
f2525a01
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cgribexlib.c
View file @
b90a56ca
/* Automatically generated by m214003 at 2014-
09-30
, do not edit */
/* Automatically generated by m214003 at 2014-
12-03
, do not edit */
/* CGRIBEXLIB_VERSION="1.7.0" */
...
...
@@ -8,9 +8,6 @@
#endif
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic warning "-Wstrict-overflow"
#endif
#ifdef _ARCH_PWR6
...
...
@@ -2134,16 +2131,16 @@ void confp3(double pval, int *kexp, int *kmant, int kbits, int kround)
/* Round up for negative numbers. */
if
(
isign
==
0
)
*
kmant
=
(
int
)
rpowref
;
*
kmant
=
(
int
)
rpowref
;
else
*
kmant
=
lround
(
rpowref
+
0
.
5
);
*
kmant
=
(
int
)
lround
(
rpowref
+
0
.
5
);
}
else
{
/* Closest number in GRIB format to the original number */
/* (equal to, greater than or less than original number). */
*
kmant
=
lround
(
rpowref
);
*
kmant
=
(
int
)
lround
(
rpowref
);
}
/* Check that mantissa value does not exceed 24 bits. */
...
...
@@ -2191,16 +2188,16 @@ void confp3(double pval, int *kexp, int *kmant, int kbits, int kround)
/* Round up for negative numbers. */
if
(
isign
==
0
)
*
kmant
=
(
int
)
rpowref
;
*
kmant
=
(
int
)
rpowref
;
else
*
kmant
=
lround
(
rpowref
+
0
.
5
);
*
kmant
=
(
int
)
lround
(
rpowref
+
0
.
5
);
}
else
{
/* Closest number in GRIB format to the original number */
/* (equal to, greater or less than original number). */
*
kmant
=
lround
(
rpowref
);
*
kmant
=
(
int
)
lround
(
rpowref
);
}
/* Repeat calculation (with modified exponent) if still have */
...
...
@@ -14225,7 +14222,7 @@ void encode_dummy(void)
(
void
)
encode_array_unrolled_double
(
0
,
0
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
);
(
void
)
encode_array_unrolled_float
(
0
,
0
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
);
}
static
const
char
grb_libvers
[]
=
"1.7.0"
" of ""
Sep
3
0
2014"" ""
13:27:33
"
;
static
const
char
grb_libvers
[]
=
"1.7.0"
" of ""
Dec
3 2014"" ""
08:52:12
"
;
const
char
*
cgribexLibraryVersion
(
void
)
{
...
...
src/stream_cgribex.c
View file @
b90a56ca
...
...
@@ -1719,19 +1719,19 @@ void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
ISEC2_NumLon
=
nlon
;
ISEC2_NumLat
=
nlat
;
ISEC2_FirstLat
=
lround
(
yfirst
*
1000
);
ISEC2_LastLat
=
lround
(
ylast
*
1000
);
ISEC2_FirstLat
=
(
int
)
lround
(
yfirst
*
1000
);
ISEC2_LastLat
=
(
int
)
lround
(
ylast
*
1000
);
if
(
gridtype
==
GRID_GAUSSIAN_REDUCED
)
{
ISEC2_FirstLon
=
0
;
ISEC2_LastLon
=
lround
(
1000
*
(
360
.
-
360
.
/
(
nlat
*
2
)));
ISEC2_LonIncr
=
lround
(
1000
*
360
.
/
(
nlat
*
2
));
ISEC2_LastLon
=
(
int
)
lround
(
1000
*
(
360
.
-
360
.
/
(
nlat
*
2
)));
ISEC2_LonIncr
=
(
int
)
lround
(
1000
*
360
.
/
(
nlat
*
2
));
}
else
{
ISEC2_FirstLon
=
lround
(
xfirst
*
1000
);
ISEC2_LastLon
=
lround
(
xlast
*
1000
);
ISEC2_LonIncr
=
lround
(
xinc
*
1000
);
ISEC2_FirstLon
=
(
int
)
lround
(
xfirst
*
1000
);
ISEC2_LastLon
=
(
int
)
lround
(
xlast
*
1000
);
ISEC2_LonIncr
=
(
int
)
lround
(
xinc
*
1000
);
}
// if ( fabs(xinc*1000 - ISEC2_LonIncr) > FLT_EPSILON ) ISEC2_LonIncr = 0;
...
...
@@ -1744,7 +1744,7 @@ void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
}
else
{
ISEC2_LatIncr
=
lround
(
yinc
*
1000
);
ISEC2_LatIncr
=
(
int
)
lround
(
yinc
*
1000
);
// if ( fabs(yinc*1000 - ISEC2_LatIncr) > FLT_EPSILON ) ISEC2_LatIncr = 0;
if
(
ISEC2_LatIncr
<
0
)
ISEC2_LatIncr
=
-
ISEC2_LatIncr
;
...
...
@@ -1763,8 +1763,8 @@ void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
if
(
gridIsRotated
(
gridID
)
)
{
ISEC2_LatSP
=
-
lround
(
gridInqYpole
(
gridID
)
*
1000
);
ISEC2_LonSP
=
lround
((
gridInqXpole
(
gridID
)
+
180
)
*
1000
);
ISEC2_LatSP
=
-
(
int
)
lround
(
gridInqYpole
(
gridID
)
*
1000
);
ISEC2_LonSP
=
(
int
)
lround
((
gridInqXpole
(
gridID
)
+
180
)
*
1000
);
}
/* East -> West */
...
...
@@ -1790,13 +1790,13 @@ void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
ISEC2_GridType
=
GRIB1_GTYPE_LCC
;
ISEC2_NumLon
=
xsize
;
ISEC2_NumLat
=
ysize
;
ISEC2_FirstLon
=
lround
(
originLon
*
1000
);
ISEC2_FirstLat
=
lround
(
originLat
*
1000
);
ISEC2_Lambert_Lov
=
lround
(
lonParY
*
1000
);
ISEC2_Lambert_LatS1
=
lround
(
lat1
*
1000
);
ISEC2_Lambert_LatS2
=
lround
(
lat2
*
1000
);
ISEC2_Lambert_dx
=
lround
(
xincm
);
ISEC2_Lambert_dy
=
lround
(
yincm
);
ISEC2_FirstLon
=
(
int
)
lround
(
originLon
*
1000
);
ISEC2_FirstLat
=
(
int
)
lround
(
originLat
*
1000
);
ISEC2_Lambert_Lov
=
(
int
)
lround
(
lonParY
*
1000
);
ISEC2_Lambert_LatS1
=
(
int
)
lround
(
lat1
*
1000
);
ISEC2_Lambert_LatS2
=
(
int
)
lround
(
lat2
*
1000
);
ISEC2_Lambert_dx
=
(
int
)
lround
(
xincm
);
ISEC2_Lambert_dy
=
(
int
)
lround
(
yincm
);
ISEC2_Lambert_LatSP
=
0
;
ISEC2_Lambert_LatSP
=
0
;
ISEC2_Lambert_ProjFlag
=
projflag
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment