Skip to content
GitLab
Menu
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
9b0114f2
Commit
9b0114f2
authored
May 23, 2011
by
Uwe Schulzweida
Browse files
check pointer arguments of streamRead/streamWrite
parent
f5ea1c22
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/stream.c
View file @
9b0114f2
...
...
@@ -1468,10 +1468,12 @@ void streamReadVar(int streamID, int varID, double *data, int *nmiss)
int
filetype
;
stream_t
*
streamptr
;
streamptr
=
stream_to_pointer
(
stream
ID
);
if
(
CDI_Debug
)
Message
(
"streamID = %d varID = %d"
,
streamID
,
var
ID
);
if
(
CDI_Debug
)
Message
(
"streamID = %d varID = %d"
,
streamID
,
varID
);
check_parg
(
data
);
check_parg
(
nmiss
);
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
...
...
@@ -1549,10 +1551,11 @@ void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
int
filetype
;
stream_t
*
streamptr
;
streamptr
=
stream_to_pointer
(
stream
ID
);
if
(
CDI_Debug
)
Message
(
"streamID = %d varID = %d"
,
streamID
,
var
ID
);
if
(
CDI_Debug
)
Message
(
"streamID = %d varID = %d"
,
streamID
,
varID
);
check_parg
(
data
);
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
...
...
@@ -1634,6 +1637,11 @@ void streamReadVarSlice(int streamID, int varID, int levelID, double *data, int
int
ierr
=
0
;
stream_t
*
streamptr
;
if
(
CDI_Debug
)
Message
(
"streamID = %d varID = %d"
,
streamID
,
varID
);
check_parg
(
data
);
check_parg
(
nmiss
);
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
...
...
@@ -1714,10 +1722,11 @@ void streamWriteVarSlice(int streamID, int varID, int levelID, const double *dat
int
ierr
=
0
;
stream_t
*
streamptr
;
streamptr
=
stream_to_pointer
(
stream
ID
);
if
(
CDI_Debug
)
Message
(
"streamID = %d varID = %d"
,
streamID
,
var
ID
);
if
(
CDI_Debug
)
Message
(
"streamID = %d varID = %d"
,
streamID
,
varID
);
check_parg
(
data
);
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
...
...
src/stream_int.h
View file @
9b0114f2
...
...
@@ -58,6 +58,8 @@ char *strdup(const char *s);
#endif
#define check_parg(arg) if ( arg == 0 ) Warning("Argument '" #arg "' not allocated!")
#if defined (__xlC__)
/* performance problems on IBM */
#ifndef DBL_IS_NAN
# define DBL_IS_NAN(x) ((x) != (x))
...
...
src/stream_record.c
View file @
9b0114f2
...
...
@@ -131,6 +131,9 @@ void streamInqRecord(int streamID, int *varID, int *levelID)
int
lindex
;
stream_t
*
streamptr
;
check_parg
(
varID
);
check_parg
(
levelID
);
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
...
...
@@ -296,6 +299,9 @@ void streamReadRecord(int streamID, double *data, int *nmiss)
int
filetype
;
stream_t
*
streamptr
;
check_parg
(
data
);
check_parg
(
nmiss
);
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
...
...
@@ -360,6 +366,8 @@ void streamWriteRecord(int streamID, const double *data, int nmiss)
int
filetype
;
stream_t
*
streamptr
;
check_parg
(
data
);
streamptr
=
stream_to_pointer
(
streamID
);
stream_check_ptr
(
__func__
,
streamptr
);
...
...
Write
Preview
Supports
Markdown
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