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
16f64d3e
Commit
16f64d3e
authored
Apr 04, 2014
by
Thomas Jahns
🤸
Browse files
Add static const specification to immutable string table.
parent
486e4609
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
16f64d3e
...
...
@@ -578,7 +578,7 @@ int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, char
/* GRID routines */
void
gridName
(
int
gridtype
,
char
*
gridname
);
char
*
gridNamePtr
(
int
gridtype
);
const
char
*
gridNamePtr
(
int
gridtype
);
void
gridCompress
(
int
gridID
);
...
...
src/cdi_int.h
View file @
16f64d3e
...
...
@@ -279,7 +279,7 @@ void stream_check_ptr(const char *caller, stream_t *streamptr);
int
streamInqFileID
(
int
streamID
);
int
zaxisInqLevelID
(
int
zaxisID
,
double
level
);
char
*
gridNamePtr
(
int
gridtype
);
const
char
*
gridNamePtr
(
int
gridtype
);
char
*
zaxisNamePtr
(
int
leveltype
);
void
streamCheckID
(
const
char
*
caller
,
int
streamID
);
...
...
src/grid.c
View file @
16f64d3e
...
...
@@ -26,7 +26,9 @@
#endif
char
*
Grids
[]
=
{
/* the value in the second pair of brackets must match the length of
* the longest string (including terminating NUL) */
static
const
char
Grids
[][
17
]
=
{
/* 0 */
"undefined"
,
/* 1 */
"generic"
,
/* 2 */
"gaussian"
,
...
...
@@ -531,9 +533,9 @@ void gridDestroyP ( void * gridptr )
}
char
*
gridNamePtr
(
int
gridtype
)
const
char
*
gridNamePtr
(
int
gridtype
)
{
char
*
name
;
const
char
*
name
;
int
size
=
(
int
)
(
sizeof
(
Grids
)
/
sizeof
(
char
*
));
if
(
gridtype
>=
0
&&
gridtype
<
size
)
...
...
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