Rob Shearman : widl: Include range types in constant BufferLength calculation for server function .
Alexandre Julliard
julliard at winehq.org
Thu Nov 12 10:22:10 CST 2009
Module: wine
Branch: master
Commit: 8e750b0ef6d810465d12566b6f03e6ce28b9451d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e750b0ef6d810465d12566b6f03e6ce28b9451d
Author: Rob Shearman <robertshearman at gmail.com>
Date: Thu Nov 12 10:31:25 2009 +0000
widl: Include range types in constant BufferLength calculation for server function.
---
tools/widl/typegen.c | 8 +++++---
tools/widl/typegen.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index f601ab3..fdb2379 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -216,11 +216,13 @@ enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *att
switch (type_get_type(type))
{
case TYPE_BASIC:
- if (is_attr(attrs, ATTR_RANGE) || is_aliaschain_attr(type, ATTR_RANGE))
+ if (!(flags & TDT_IGNORE_RANGES) &&
+ (is_attr(attrs, ATTR_RANGE) || is_aliaschain_attr(type, ATTR_RANGE)))
return TGT_RANGE;
return TGT_BASIC;
case TYPE_ENUM:
- if (is_attr(attrs, ATTR_RANGE) || is_aliaschain_attr(type, ATTR_RANGE))
+ if (!(flags & TDT_IGNORE_RANGES) &&
+ (is_attr(attrs, ATTR_RANGE) || is_aliaschain_attr(type, ATTR_RANGE)))
return TGT_RANGE;
return TGT_ENUM;
case TYPE_POINTER:
@@ -3012,7 +3014,7 @@ static unsigned int get_required_buffer_size_type(
const type_t *type, const char *name, const attr_list_t *attrs, int toplevel_param, unsigned int *alignment)
{
*alignment = 0;
- switch (typegen_detect_type(type, NULL, TDT_IGNORE_STRINGS))
+ switch (typegen_detect_type(type, NULL, TDT_IGNORE_STRINGS|TDT_IGNORE_RANGES))
{
case TGT_USER_TYPE:
{
diff --git a/tools/widl/typegen.h b/tools/widl/typegen.h
index c414d78..2b2e65d 100644
--- a/tools/widl/typegen.h
+++ b/tools/widl/typegen.h
@@ -40,6 +40,7 @@ enum typegen_detect_flags
{
TDT_ALL_TYPES = 1 << 0,
TDT_IGNORE_STRINGS = 1 << 1,
+ TDT_IGNORE_RANGES = 1 << 2,
};
enum typegen_type
More information about the wine-cvs
mailing list