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
291f8440
Commit
291f8440
authored
Apr 06, 2020
by
Uwe Schulzweida
Browse files
Fix g++ warnings.
parent
ea75dbeb
Changes
9
Show whitespace changes
Inline
Side-by-side
config/default
View file @
291f8440
...
...
@@ -200,8 +200,8 @@ case "${HOSTNAME}" in
--enable-maintainer-mode
\
$CDOLIBS
LDFLAGS
=
"-Wl,-rpath,
$HOME
/local/eccodes-2.3.0/lib"
\
F77
=
gfortran
FFLAGS
=
"-g -O2"
\
CXX
=
g++
CXXFLAGS
=
"-g -pipe -Wall -W -Wfloat-equal -pedantic -O3 -march=native -Wa,-q"
\
CC
=
gcc
CFLAGS
=
"-g -pipe -Wall -W -Wfloat-equal -pedantic -O3 -march=native -Wa,-q"
CXX
=
g++
CXXFLAGS
=
"-g -pipe -Wall -W
extra -Wshadow
-Wfloat-equal -pedantic -O3 -march=native -Wa,-q"
\
CC
=
gcc
CFLAGS
=
"-g -pipe -Wall -W
extra -Wshadow
-Wfloat-equal -pedantic -O3 -march=native -Wa,-q"
fi
;;
# win7 based cygwin virtual machine
...
...
src/cdotest.cc
View file @
291f8440
...
...
@@ -209,17 +209,17 @@ static int
submitCdoCommand
(
const
char
*
argument
)
{
const
char
*
cdoPath
=
getCdoPath
();
char
*
cdo
C
ommand
=
(
char
*
)
Malloc
(
strlen
(
cdoPath
)
+
strlen
(
argument
)
+
8
);
char
*
cdo
_c
ommand
=
(
char
*
)
Malloc
(
strlen
(
cdoPath
)
+
strlen
(
argument
)
+
8
);
int
status
;
cdo
C
ommand
[
0
]
=
'\0'
;
strcat
(
cdo
C
ommand
,
cdoPath
);
strcat
(
cdo
C
ommand
,
" -b 64 "
);
strcat
(
cdo
C
ommand
,
argument
);
cdo
_c
ommand
[
0
]
=
'\0'
;
strcat
(
cdo
_c
ommand
,
cdoPath
);
strcat
(
cdo
_c
ommand
,
" -b 64 "
);
strcat
(
cdo
_c
ommand
,
argument
);
status
=
system
(
cdo
C
ommand
);
Free
(
cdo
C
ommand
);
status
=
system
(
cdo
_c
ommand
);
Free
(
cdo
_c
ommand
);
return
status
;
}
...
...
src/percentiles_hist.cc
View file @
291f8440
...
...
@@ -407,8 +407,6 @@ HistogramSet::addSubVarLevelValues(int varID, int levelID, const Field &field, i
void
HistogramSet
::
Reset
(
int
varID
,
int
levelID
,
int
ptype
)
{
const
auto
nvars
=
this
->
nvars
;
assert
(
nvars
>
0
);
if
(
varID
<
0
||
varID
>=
nvars
)
cdoAbort
(
"Illegal argument: varID %d is undefined (%s)"
,
varID
,
__func__
);
...
...
src/pipe.cc
View file @
291f8440
...
...
@@ -37,8 +37,8 @@ pipe_t::close()
pthread_mutex_unlock
(
m_mutex
);
pthread_cond_signal
(
tsDef
);
pthread_cond_signal
(
tsInq
);
pthread_cond_signal
(
recInq
);
//
pthread_cond_signal
(
isclosed
);
//
pthread_cond_signal
(
recInq
);
pthread_cond_signal
(
isclosed
);
}
void
...
...
@@ -167,12 +167,10 @@ pipe_t::pipeDefTimestep(int p_vlistID, int p_tsID)
{
auto
vlistID
=
p_vlistID
;
numrecs
=
0
;
for
(
int
varID
=
0
;
varID
<
vlistNvars
(
vlistID
);
varID
++
)
for
(
int
i
=
0
;
i
<
vlistNvars
(
vlistID
);
i
++
)
{
if
(
vlistInqVarTimetype
(
vlistID
,
varID
)
!=
TIME_CONSTANT
)
{
numrecs
+=
zaxisInqSize
(
vlistInqVarZaxis
(
vlistID
,
varID
));
}
if
(
vlistInqVarTimetype
(
vlistID
,
i
)
!=
TIME_CONSTANT
)
numrecs
+=
zaxisInqSize
(
vlistInqVarZaxis
(
vlistID
,
i
));
}
Debug
(
PIPE
,
" %s numrecs= %d nvars= %d "
,
name
.
c_str
(),
numrecs
,
vlistNvars
(
vlistID
));
}
...
...
@@ -352,9 +350,9 @@ pipe_t::pipeReadPipeRecord(float *p_data, int vlistID, size_t *p_nmiss)
}
size_t
pipe_t
::
pipeReadRecord
(
int
p_vlistID
,
double
*
p_data
,
size_t
*
nmiss
)
pipe_t
::
pipeReadRecord
(
int
p_vlistID
,
double
*
p_data
,
size_t
*
p_
nmiss
)
{
*
nmiss
=
0
;
*
p_
nmiss
=
0
;
size_t
nvals
=
0
;
// LOCK
...
...
@@ -367,7 +365,7 @@ pipe_t::pipeReadRecord(int p_vlistID, double *p_data, size_t *nmiss)
if
(
hasdata
)
{
nvals
=
pipeReadPipeRecord
(
p_data
,
p_vlistID
,
nmiss
);
nvals
=
pipeReadPipeRecord
(
p_data
,
p_vlistID
,
p_
nmiss
);
}
else
{
...
...
@@ -386,9 +384,9 @@ pipe_t::pipeReadRecord(int p_vlistID, double *p_data, size_t *nmiss)
}
size_t
pipe_t
::
pipeReadRecord
(
int
p_vlistID
,
float
*
p_data
,
size_t
*
nmiss
)
pipe_t
::
pipeReadRecord
(
int
p_vlistID
,
float
*
p_data
,
size_t
*
p_
nmiss
)
{
*
nmiss
=
0
;
*
p_
nmiss
=
0
;
size_t
nvals
=
0
;
// LOCK
...
...
@@ -401,7 +399,7 @@ pipe_t::pipeReadRecord(int p_vlistID, float *p_data, size_t *nmiss)
if
(
hasdata
)
{
nvals
=
pipeReadPipeRecord
(
p_data
,
p_vlistID
,
nmiss
);
nvals
=
pipeReadPipeRecord
(
p_data
,
p_vlistID
,
p_
nmiss
);
}
else
{
...
...
src/pmlist.cc
View file @
291f8440
...
...
@@ -249,8 +249,8 @@ parseNamelist(PMList &pmlist, NamelistParser &parser, char *buf, bool cdocmor)
if
(
it
+
1
<
ntok
&&
tokens
[
it
+
1
].
type
==
NamelistType
::
WORD
)
{
it
++
;
const
auto
&
t
=
tokens
[
it
];
snprintf
(
name
,
sizeof
(
name
),
"%.*s"
,
t
.
end
-
t
.
start
,
buf
+
t
.
start
);
const
auto
&
t
2
=
tokens
[
it
];
snprintf
(
name
,
sizeof
(
name
),
"%.*s"
,
t
2
.
end
-
t
2
.
start
,
buf
+
t
2
.
start
);
name
[
sizeof
(
name
)
-
1
]
=
0
;
}
...
...
src/remap_search_latbins.cc
View file @
291f8440
...
...
@@ -303,15 +303,15 @@ pointInQuad(bool isCyclic, size_t nx, size_t ny, size_t i, size_t j, size_t adds
idx
[
2
]
=
jp1
*
nx
+
ip1
;
// north-east
idx
[
3
]
=
jp1
*
nx
+
i
;
// north
for
(
unsigned
j
=
0
;
j
<
4
;
++
j
)
lons
[
j
]
=
centerLon
[
idx
[
j
]];
for
(
unsigned
j
=
0
;
j
<
4
;
++
j
)
lats
[
j
]
=
centerLat
[
idx
[
j
]];
for
(
unsigned
k
=
0
;
k
<
4
;
++
k
)
lons
[
k
]
=
centerLon
[
idx
[
k
]];
for
(
unsigned
k
=
0
;
k
<
4
;
++
k
)
lats
[
k
]
=
centerLat
[
idx
[
k
]];
unsigned
n
=
quadCrossProducts
(
plon
,
plat
,
lons
,
lats
);
// If cross products all same sign, we found the location
if
(
n
>=
4
)
{
for
(
unsigned
j
=
0
;
j
<
4
;
++
j
)
adds
[
j
]
=
idx
[
j
];
for
(
unsigned
k
=
0
;
k
<
4
;
++
k
)
adds
[
k
]
=
idx
[
k
];
search_result
=
true
;
}
...
...
src/remaplib.cc
View file @
291f8440
...
...
@@ -141,7 +141,7 @@ boundboxFromCenter(bool lonIsCyclic, size_t size, size_t nx, size_t ny, const do
size_t
n4
=
n
<<
2
;
/
*
Find N,S and NE points to this grid point
*/
/
/
Find N,S and NE points to this grid point
size_t
j
=
n
/
nx
;
size_t
i
=
n
-
j
*
nx
;
...
...
@@ -154,10 +154,10 @@ boundboxFromCenter(bool lonIsCyclic, size_t size, size_t nx, size_t ny, const do
idx
[
2
]
=
jp1
*
nx
+
ip1
;
// north-east
idx
[
3
]
=
jp1
*
nx
+
i
;
// north
/
*
Find N,S and NE lat/lon coords and check bounding box
*/
/
/
Find N,S and NE lat/lon coords and check bounding box
for
(
unsigned
j
=
0
;
j
<
4
;
++
j
)
tmp_lons
[
j
]
=
center_lon
[
idx
[
j
]];
for
(
unsigned
j
=
0
;
j
<
4
;
++
j
)
tmp_lats
[
j
]
=
center_lat
[
idx
[
j
]];
for
(
unsigned
k
=
0
;
k
<
4
;
++
k
)
tmp_lons
[
k
]
=
center_lon
[
idx
[
k
]];
for
(
unsigned
k
=
0
;
k
<
4
;
++
k
)
tmp_lats
[
k
]
=
center_lat
[
idx
[
k
]];
bound_box
[
n4
+
0
]
=
tmp_lats
[
0
];
bound_box
[
n4
+
1
]
=
tmp_lats
[
0
];
...
...
src/sellist.cc
View file @
291f8440
...
...
@@ -47,7 +47,7 @@ sellist_init(SelectList &sellist, KVList &kvlist)
++
i
;
}
for
(
int
i
=
0
;
i
<
(
int
)
sellist
.
size
();
++
i
)
for
(
i
=
0
;
i
<
(
int
)
sellist
.
size
();
++
i
)
{
auto
&
e
=
sellist
[
i
];
e
.
flag
=
nullptr
;
...
...
src/zaxis_print.cc
View file @
291f8440
...
...
@@ -119,7 +119,7 @@ zaxisPrintKernel(int zaxisID, FILE *fp)
if
(
type
==
ZAXIS_REFERENCE
)
{
unsigned
char
uuid
[
CDI_UUID_SIZE
];
int
length
=
CDI_UUID_SIZE
;
length
=
CDI_UUID_SIZE
;
memset
(
uuid
,
0
,
length
);
cdiInqKeyBytes
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_UUID
,
uuid
,
&
length
);
if
(
!
cdiUUIDIsNull
(
uuid
))
...
...
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