Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
f1227e21
Commit
f1227e21
authored
Oct 13, 2020
by
Uwe Schulzweida
Browse files
Added __attribute__((warn_unused)) to some class definitions.
parent
4ed6036d
Pipeline
#4616
passed with stages
in 23 minutes and 41 seconds
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/array.h
View file @
f1227e21
...
...
@@ -28,7 +28,7 @@
#ifdef CHECK_UNUSED_VECTOR
template
<
typename
T
>
class
#if
def
ined(
__GNUG__
)
#ifdef
__GNUG__
__attribute__
((
warn_unused
))
#endif
CheckVector
...
...
src/datetime.h
View file @
f1227e21
...
...
@@ -78,7 +78,11 @@ struct CheckTimeInc
TimeIncrement
timeIncr
;
};
class
DateTimeList
class
// DateTimeList
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
DateTimeList
{
public:
DateTimeList
()
{
init
();
}
...
...
src/field.h
View file @
f1227e21
...
...
@@ -33,13 +33,17 @@ enum field_flag
FIELD_DBL
=
8
,
// 64-bit float
};
class
Field
class
// Field
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
Field
{
public:
int
fpeRaised
=
0
;
int
nwpv
=
1
;
// number of words per value; real:1 complex:2
MemType
memType
=
MemType
::
Native
;
// MemType::Float or MemType::Double
int
grid
=
-
1
;
MemType
memType
=
MemType
::
Native
;
// MemType::Float or MemType::Double
size_t
gridsize
=
0
;
size_t
size
=
0
;
...
...
@@ -70,7 +74,11 @@ private:
size_t
m_count
=
0
;
};
class
Field3D
:
public
Field
class
// Field3D
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
Field3D
:
public
Field
{
public:
size_t
nlevels
=
0
;
...
...
src/interpol.cc
View file @
f1227e21
...
...
@@ -525,7 +525,7 @@ interpolate(Field &field1, Field &field2)
Varray
<
double
>
xin_array
(
nxlon
*
nxlat
);
MatrixView
<
double
>
xin
(
xin_array
.
data
(),
nxlat
,
nxlon
);
std
::
vector
<
double
>
xlon
(
nxlon
);
Varray
<
double
>
xlon
(
nxlon
);
for
(
ilon
=
0
;
ilon
<
nlon
;
ilon
++
)
{
xlon
[
2
*
ilon
+
1
]
=
lon
[
ilon
];
...
...
@@ -533,7 +533,7 @@ interpolate(Field &field1, Field &field2)
}
xlon
[
2
*
nlon
]
=
(
lon
[
nlon
-
1
]
+
lon
[
nlon
])
/
2
;
std
::
vector
<
double
>
xlat
(
2
*
nlat
+
1
);
Varray
<
double
>
xlat
(
2
*
nlat
+
1
);
for
(
ilat
=
0
;
ilat
<
nlat
;
ilat
++
)
{
xlat
[
2
*
ilat
+
1
]
=
lat
[
ilat
];
...
...
@@ -543,8 +543,8 @@ interpolate(Field &field1, Field &field2)
MatrixView
<
double
>
in0
(
arrayIn
.
data
(),
nlat
,
nlon
);
std
::
vector
<
long
>
ilon11
(
out_nlon
),
ilon12
(
out_nlon
),
ilon21
(
out_nlon
),
ilon22
(
out_nlon
);
std
::
vector
<
double
>
volon11
(
out_nlon
),
volon12
(
out_nlon
),
volon21
(
out_nlon
),
volon22
(
out_nlon
);
Varray
<
long
>
ilon11
(
out_nlon
),
ilon12
(
out_nlon
),
ilon21
(
out_nlon
),
ilon22
(
out_nlon
);
Varray
<
double
>
volon11
(
out_nlon
),
volon12
(
out_nlon
),
volon21
(
out_nlon
),
volon22
(
out_nlon
);
for
(
olon
=
0
;
olon
<
out_nlon
;
olon
++
)
{
...
...
@@ -573,7 +573,7 @@ interpolate(Field &field1, Field &field2)
ilon22
[
olon
]
=
l22
;
}
std
::
vector
<
long
>
ilat1
(
out_nlat
),
ilat2
(
out_nlat
);
Varray
<
long
>
ilat1
(
out_nlat
),
ilat2
(
out_nlat
);
xlat_is_ascending
=
xlat
[
0
]
<=
xlat
[
nxlat
-
1
];
for
(
olat
=
0
;
olat
<
out_nlat
;
olat
++
)
...
...
src/matrix_view.h
View file @
f1227e21
...
...
@@ -4,7 +4,11 @@
// Modified code from https://github.com/pwwiur/Matrix
template
<
class
T
,
int
R
=
0
,
int
C
=
0
>
class
MatrixView
class
// MatrixView
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
MatrixView
{
private:
T
*
arr
;
...
...
src/percentiles_hist.h
View file @
f1227e21
...
...
@@ -32,7 +32,11 @@ struct Histogram
void
*
ptr
=
nullptr
;
};
class
HistogramSet
class
// HistogramSet
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
HistogramSet
{
private:
int
nvars
=
0
;
...
...
src/pmlist.h
View file @
f1227e21
...
...
@@ -31,7 +31,11 @@ struct KeyValues
std
::
vector
<
std
::
string
>
values
;
};
class
KVList
:
public
std
::
list
<
KeyValues
>
class
// KVList
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
KVList
:
public
std
::
list
<
KeyValues
>
{
public:
std
::
string
name
;
...
...
@@ -44,7 +48,11 @@ public:
char
*
get_first_value
(
const
char
*
key
,
const
char
*
replacer
);
};
class
PMList
:
public
std
::
list
<
KVList
>
class
// PMList
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
PMList
:
public
std
::
list
<
KVList
>
{
public:
const
KVList
*
searchKVListVentry
(
const
std
::
string
&
key
,
const
std
::
string
&
value
,
const
std
::
vector
<
std
::
string
>
&
entry
);
...
...
src/remap.h
View file @
f1227e21
...
...
@@ -64,7 +64,11 @@ struct LonLatPoint
LonLatPoint
(
double
_lon
,
double
_lat
)
:
lon
(
_lon
),
lat
(
_lat
)
{};
};
struct
RemapGrid
struct
// RemapGrid
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
RemapGrid
{
int
gridID
;
int
tmpgridID
;
...
...
@@ -100,7 +104,11 @@ struct RemapGrid
Varray
<
double
>
cell_frac
;
// fractional area of grid cells participating in remapping
};
struct
GridSearchBins
struct
// GridSearchBins
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
GridSearchBins
{
unsigned
nbins
;
// num of bins for restricted search
size_t
ncells
;
// total number of grid cells (cell_bound_box)
...
...
@@ -109,7 +117,11 @@ struct GridSearchBins
Varray
<
float
>
cell_bound_box
;
// lon/lat bounding box for use
};
struct
RemapSearch
struct
// RemapSearch
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
RemapSearch
{
RemapGrid
*
srcGrid
;
RemapGrid
*
tgtGrid
;
...
...
@@ -121,7 +133,11 @@ struct RemapSearch
GridCellSearch
gcs
;
};
struct
RemapType
struct
// RemapType
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
RemapType
{
int
nused
;
int
gridID
;
...
...
src/specspace.h
View file @
f1227e21
...
...
@@ -25,7 +25,11 @@
#include "transform.h"
#include "array.h"
class
FC_Transformation
class
// FC_Transformation
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
FC_Transformation
{
public:
bool
use_fftw
=
false
;
...
...
@@ -74,7 +78,11 @@ public:
}
};
class
SP_Transformation
class
// SP_Transformation
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
SP_Transformation
{
public:
FC_Transformation
fcTrans
;
...
...
@@ -125,7 +133,11 @@ public:
}
};
class
DV_Transformation
class
// DV_Transformation
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
DV_Transformation
{
public:
long
ntr
=
0
;
...
...
src/vector3d.h
View file @
f1227e21
...
...
@@ -23,7 +23,11 @@
#include <cstdio>
#include <cmath>
class
Vector3d
class
// Vector3d
#ifdef __GNUG__
__attribute__
((
warn_unused
))
#endif
Vector3d
{
private:
double
X
,
Y
,
Z
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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