Skip to content
Snippets Groups Projects
Commit 502ce990 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Simplify accessor cdiDefAccesstype.

parent 6c3e1753
No related branches found
No related tags found
No related merge requests found
......@@ -2103,24 +2103,15 @@ int streamInqFileID(int streamID)
void cdiDefAccesstype(int streamID, int type)
{
stream_t *streamptr;
streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
stream_t *streamptr = reshGetVal(streamID, &streamOps);
if ( streamptr->accesstype == CDI_UNDEFID )
{
streamptr->accesstype = type;
}
else
{
if ( streamptr->accesstype != type )
{
if ( streamptr->accesstype == TYPE_REC )
Error("Changing access type from REC to VAR not allowed!");
else
Error("Changing access type from VAR to REC not allowed!");
}
}
else if ( streamptr->accesstype != type )
Error("Changing access type from %s not allowed!",
streamptr->accesstype == TYPE_REC ? "REC to VAR" : "VAR to REC");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment