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
libcdi
Commits
d677659b
Commit
d677659b
authored
Nov 05, 2014
by
Thomas Jahns
🤸
Browse files
Convert trivial wrappers to inline functions.
parent
9a30ba0f
Changes
3
Show whitespace changes
Inline
Side-by-side
src/gribapi.c
View file @
d677659b
...
...
@@ -59,7 +59,7 @@ void gribContainersNew(stream_t * streamptr)
int
editionNumber
=
2
;
if
(
streamptr
->
filetype
==
FILETYPE_GRB
)
editionNumber
=
1
;
(
void
)
editionNumber
;
#if defined (HAVE_LIBCGRIBEX)
if
(
streamptr
->
filetype
==
FILETYPE_GRB
)
{
...
...
src/gribapi.h
View file @
d677659b
#ifndef _GRIBAPI_H
#define _GRIBAPI_H
#ifdef HAVE_LIBGRIBAPI
# include "error.h"
# include <grib_api.h>
#endif
#define GRIBAPI_MISSVAL -9.E33
/* GRIB2 Level Types */
...
...
@@ -45,8 +50,25 @@
const
char
*
gribapiLibraryVersionString
(
void
);
void
gribContainersNew
(
stream_t
*
streamptr
);
void
gribContainersDelete
(
stream_t
*
streamptr
);
void
*
gribHandleNew
(
int
editionNumber
);
void
gribHandleDelete
(
void
*
gh
);
#ifdef HAVE_LIBGRIBAPI
static
inline
void
*
gribHandleNew
(
int
editionNumber
)
{
void
*
gh
=
(
editionNumber
==
1
)
?
(
void
*
)
grib_handle_new_from_samples
(
NULL
,
"GRIB1"
)
:
(
void
*
)
grib_handle_new_from_samples
(
NULL
,
"GRIB2"
);
if
(
gh
==
NULL
)
Error
(
"grib_handle_new_from_samples failed!"
);
return
gh
;
}
static
inline
void
gribHandleDelete
(
void
*
gh
)
{
grib_handle_delete
(
gh
);
}
#else
#define gribHandleNew(editionNumber) (NULL)
#define gribHandleDelete(gh)
#endif
typedef
struct
{
int
init
;
...
...
src/stream_gribapi.c
View file @
d677659b
...
...
@@ -3088,30 +3088,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
}
#endif
void
*
gribHandleNew
(
int
editionNumber
)
{
void
*
gh
=
NULL
;
#if defined (HAVE_LIBGRIB_API)
if
(
editionNumber
==
1
)
gh
=
(
void
*
)
grib_handle_new_from_samples
(
NULL
,
"GRIB1"
);
else
gh
=
(
void
*
)
grib_handle_new_from_samples
(
NULL
,
"GRIB2"
);
if
(
gh
==
NULL
)
Error
(
"grib_handle_new_from_samples failed!"
);
#endif
return
(
gh
);
}
void
gribHandleDelete
(
void
*
gh
)
{
#if defined (HAVE_LIBGRIB_API)
grib_handle_delete
(
gh
);
#endif
}
/* #define GRIBAPIENCODETEST 1 */
#ifdef HAVE_LIBGRIB_API
...
...
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