From e809f0bd8c21558d030acf0bd2b7cf87fdc001ce Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 19 Mar 2014 19:26:18 +0900 Subject: [PATCH] widl: Move is_ptr() and is_array() to header.h and make them inline. --- 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 3af57d6b190..8ca1cf15713 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 e3fc0b97c41..8632fdfe2ed 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 30b6560f3d5..47c88447d9c 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