[1/2] widl: Move is_ptr() and is_array() to header.h and make them inline.
Dmitry Timoshkov
dmitry at baikal.ru
Wed Mar 19 05:26:18 CDT 2014
All other helpers are already in header.h, and these helpers do not belong
exclusively to typelib.c.
---
tools/widl/header.h | 10 ++++++++++
tools/widl/typelib.c | 10 ----------
tools/widl/widltypes.h | 3 ---
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/tools/widl/header.h b/tools/widl/header.h
index 3af57d6..8ca1cf1 100644
--- a/tools/widl/header.h
+++ b/tools/widl/header.h
@@ -58,6 +58,16 @@ extern const var_t *get_func_handle_var( const type_t *iface, const var_t *func,
extern int has_out_arg_or_return(const var_t *func);
extern int is_const_decl(const var_t *var);
+static inline int is_ptr(const type_t *t)
+{
+ return type_get_type(t) == TYPE_POINTER;
+}
+
+static inline int is_array(const type_t *t)
+{
+ return type_get_type(t) == TYPE_ARRAY;
+}
+
static inline int last_ptr(const type_t *type)
{
return is_ptr(type) && !is_declptr(type_pointer_get_ref(type));
diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c
index e3fc0b9..8632fdf 100644
--- a/tools/widl/typelib.c
+++ b/tools/widl/typelib.c
@@ -49,16 +49,6 @@
static typelib_t *typelib;
-int is_ptr(const type_t *t)
-{
- return type_get_type(t) == TYPE_POINTER;
-}
-
-int is_array(const type_t *t)
-{
- return type_get_type(t) == TYPE_ARRAY;
-}
-
/* List of oleauto types that should be recognized by name.
* (most of) these seem to be intrinsic types in mktyplib.
* This table MUST be alphabetically sorted on the kw field.
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 30b6560..47c8844 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -544,9 +544,6 @@ type_t *alloc_type(void);
void set_all_tfswrite(int val);
void clear_all_offsets(void);
-int is_ptr(const type_t *t);
-int is_array(const type_t *t);
-
#define tsENUM 1
#define tsSTRUCT 2
#define tsUNION 3
--
1.9.1
More information about the wine-patches
mailing list