widl: Include range types in constant BufferLength calculation for server function.

This commit is contained in:
Rob Shearman 2009-11-12 10:31:25 +00:00 committed by Alexandre Julliard
parent 03f87bc1c3
commit 8e750b0ef6
2 changed files with 6 additions and 3 deletions

View File

@ -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:
{

View File

@ -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