widl: Replace unsigned long and size_t by unsigned int where appropriate.
This commit is contained in:
parent
844c8a1804
commit
ef6971da40
|
@ -387,7 +387,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
|
|||
|
||||
static void write_clientinterfacedecl(type_t *iface)
|
||||
{
|
||||
unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||
unsigned int ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||
const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
|
||||
const str_list_t *endpoints = get_attrp(iface->attrs, ATTR_ENDPOINT);
|
||||
|
||||
|
|
|
@ -502,7 +502,7 @@ static const unsigned char Lookup_224[128 * 3] = {
|
|||
* skind and lcid, while the low word is based on a repeated string
|
||||
* hash of skind/str.
|
||||
*/
|
||||
unsigned long lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr)
|
||||
unsigned int lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr)
|
||||
{
|
||||
ULONG nOffset, nMask = skind == SYS_MAC ? 1 : 0;
|
||||
ULONG nHiWord, nLoWord = 0x0deadbee;
|
||||
|
|
|
@ -28,6 +28,6 @@ typedef enum tag_syskind_t {
|
|||
SYS_MAC
|
||||
} syskind_t;
|
||||
|
||||
extern unsigned long lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr);
|
||||
extern unsigned int lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -274,7 +274,7 @@ void write_type_right(FILE *h, type_t *t, int is_field)
|
|||
t = type_array_get_element(t);
|
||||
}
|
||||
for ( ; t->declarray; t = type_array_get_element(t))
|
||||
fprintf(h, "[%lu]", type_array_get_dim(t));
|
||||
fprintf(h, "[%u]", type_array_get_dim(t));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1485,9 +1485,9 @@ static void set_type(var_t *v, decl_spec_t *decl_spec, const declarator_t *decl,
|
|||
if (0)
|
||||
{
|
||||
unsigned int align = 0;
|
||||
size_t size = type_memsize(v->type, &align);
|
||||
unsigned int size = type_memsize(v->type, &align);
|
||||
|
||||
if (0xffffffffuL / size < (unsigned long) dim->cval)
|
||||
if (0xffffffffu / size < dim->cval)
|
||||
error_loc("%s: total array size is too large\n", v->name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -248,8 +248,8 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
|
|||
|
||||
static void write_dispatchtable(type_t *iface)
|
||||
{
|
||||
unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||
unsigned long method_count = 0;
|
||||
unsigned int ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||
unsigned int method_count = 0;
|
||||
const statement_t *stmt;
|
||||
|
||||
print_server("static RPC_DISPATCH_FUNCTION %s_table[] =\n", iface->name);
|
||||
|
@ -323,7 +323,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
|
|||
|
||||
static void write_serverinterfacedecl(type_t *iface)
|
||||
{
|
||||
unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||
unsigned int ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||
UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
|
||||
const str_list_t *endpoints = get_attrp(iface->attrs, ATTR_ENDPOINT);
|
||||
|
||||
|
|
|
@ -59,12 +59,12 @@ struct expr_eval_routine
|
|||
const expr_t *expr;
|
||||
};
|
||||
|
||||
static size_t fields_memsize(const var_list_t *fields, unsigned int *align);
|
||||
static size_t write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff);
|
||||
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align);
|
||||
static unsigned int write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff);
|
||||
static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
const char *name, int write_ptr, unsigned int *tfsoff);
|
||||
static const var_t *find_array_or_string_in_struct(const type_t *type);
|
||||
static size_t write_string_tfs(FILE *file, const attr_list_t *attrs,
|
||||
static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
|
||||
type_t *type,
|
||||
const char *name, unsigned int *typestring_offset);
|
||||
|
||||
|
@ -309,7 +309,7 @@ static unsigned char get_array_type(const type_t *type)
|
|||
if (!size_is)
|
||||
{
|
||||
unsigned int align = 0;
|
||||
size_t size = type_memsize(elem_type, &align);
|
||||
unsigned int size = type_memsize(elem_type, &align);
|
||||
if (size * type_array_get_dim(type) > 0xffffuL)
|
||||
fc = RPC_FC_LGFARRAY;
|
||||
else
|
||||
|
@ -664,13 +664,13 @@ int decl_indirect(const type_t *t)
|
|||
&& !is_array(t));
|
||||
}
|
||||
|
||||
static size_t write_procformatstring_type(FILE *file, int indent,
|
||||
const char *name,
|
||||
const type_t *type,
|
||||
const attr_list_t *attrs,
|
||||
int is_return)
|
||||
static unsigned int write_procformatstring_type(FILE *file, int indent,
|
||||
const char *name,
|
||||
const type_t *type,
|
||||
const attr_list_t *attrs,
|
||||
int is_return)
|
||||
{
|
||||
size_t size;
|
||||
unsigned int size;
|
||||
|
||||
int is_in = is_attr(attrs, ATTR_IN);
|
||||
int is_out = is_attr(attrs, ATTR_OUT);
|
||||
|
@ -789,9 +789,9 @@ static int write_base_type(FILE *file, unsigned char fc, unsigned int *typestrin
|
|||
}
|
||||
|
||||
/* write conformance / variance descriptor */
|
||||
static size_t write_conf_or_var_desc(FILE *file, const type_t *structure,
|
||||
unsigned int baseoff, const type_t *type,
|
||||
const expr_t *expr)
|
||||
static unsigned int write_conf_or_var_desc(FILE *file, const type_t *structure,
|
||||
unsigned int baseoff, const type_t *type,
|
||||
const expr_t *expr)
|
||||
{
|
||||
unsigned char operator_type = 0;
|
||||
unsigned char conftype = RPC_FC_NORMAL_CONFORMANCE;
|
||||
|
@ -885,7 +885,7 @@ static size_t write_conf_or_var_desc(FILE *file, const type_t *structure,
|
|||
const type_t *correlation_variable = NULL;
|
||||
unsigned char correlation_variable_type;
|
||||
unsigned char param_type = 0;
|
||||
size_t offset = 0;
|
||||
unsigned int offset = 0;
|
||||
const var_t *var;
|
||||
var_list_t *fields = type_struct_get_fields(structure);
|
||||
|
||||
|
@ -981,17 +981,17 @@ static size_t write_conf_or_var_desc(FILE *file, const type_t *structure,
|
|||
return 4;
|
||||
}
|
||||
|
||||
static size_t fields_memsize(const var_list_t *fields, unsigned int *align)
|
||||
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align)
|
||||
{
|
||||
int have_align = FALSE;
|
||||
size_t size = 0;
|
||||
unsigned int size = 0;
|
||||
const var_t *v;
|
||||
|
||||
if (!fields) return 0;
|
||||
LIST_FOR_EACH_ENTRY( v, fields, const var_t, entry )
|
||||
{
|
||||
unsigned int falign = 0;
|
||||
size_t fsize = type_memsize(v->type, &falign);
|
||||
unsigned int fsize = type_memsize(v->type, &falign);
|
||||
if (!have_align)
|
||||
{
|
||||
*align = falign;
|
||||
|
@ -1005,9 +1005,9 @@ static size_t fields_memsize(const var_list_t *fields, unsigned int *align)
|
|||
return size;
|
||||
}
|
||||
|
||||
static size_t union_memsize(const var_list_t *fields, unsigned int *pmaxa)
|
||||
static unsigned int union_memsize(const var_list_t *fields, unsigned int *pmaxa)
|
||||
{
|
||||
size_t size, maxs = 0;
|
||||
unsigned int size, maxs = 0;
|
||||
unsigned int align = *pmaxa;
|
||||
const var_t *v;
|
||||
|
||||
|
@ -1038,7 +1038,7 @@ int get_padding(const var_list_t *fields)
|
|||
{
|
||||
type_t *ft = f->type;
|
||||
unsigned int align = 0;
|
||||
size_t size = type_memsize(ft, &align);
|
||||
unsigned int size = type_memsize(ft, &align);
|
||||
if (salign == -1)
|
||||
salign = align;
|
||||
offset = ROUND_SIZE(offset, align);
|
||||
|
@ -1048,9 +1048,9 @@ int get_padding(const var_list_t *fields)
|
|||
return ROUNDING(offset, salign);
|
||||
}
|
||||
|
||||
size_t type_memsize(const type_t *t, unsigned int *align)
|
||||
unsigned int type_memsize(const type_t *t, unsigned int *align)
|
||||
{
|
||||
size_t size = 0;
|
||||
unsigned int size = 0;
|
||||
|
||||
if (type_is_alias(t))
|
||||
size = type_memsize(type_alias_get_aliasee(t), align);
|
||||
|
@ -1149,7 +1149,7 @@ void write_full_pointer_free(FILE *file, int indent, const var_t *func)
|
|||
fprintf(file, "\n");
|
||||
}
|
||||
|
||||
static unsigned int write_nonsimple_pointer(FILE *file, const type_t *type, size_t offset)
|
||||
static unsigned int write_nonsimple_pointer(FILE *file, const type_t *type, unsigned int offset)
|
||||
{
|
||||
short absoff = type_pointer_get_ref(type)->typestring_offset;
|
||||
short reloff = absoff - (offset + 2);
|
||||
|
@ -1183,7 +1183,7 @@ static void print_start_tfs_comment(FILE *file, type_t *t, unsigned int tfsoff)
|
|||
print_file(file, 0, ") */\n");
|
||||
}
|
||||
|
||||
static size_t write_pointer_tfs(FILE *file, type_t *type, unsigned int *typestring_offset)
|
||||
static unsigned int write_pointer_tfs(FILE *file, type_t *type, unsigned int *typestring_offset)
|
||||
{
|
||||
unsigned int offset = *typestring_offset;
|
||||
|
||||
|
@ -1227,8 +1227,8 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
|
|||
unsigned int align = 0, ualign = 0;
|
||||
const char *name = NULL;
|
||||
type_t *utype = get_user_type(type, &name);
|
||||
size_t usize = user_type_has_variable_size(utype) ? 0 : type_memsize(utype, &ualign);
|
||||
size_t size = type_memsize(type, &align);
|
||||
unsigned int usize = user_type_has_variable_size(utype) ? 0 : type_memsize(utype, &ualign);
|
||||
unsigned int size = type_memsize(type, &align);
|
||||
unsigned short funoff = user_type_offset(name);
|
||||
short reloff;
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ static void write_member_type(FILE *file, const type_t *cont,
|
|||
{
|
||||
if (is_embedded_complex(type) && !is_conformant_array(type))
|
||||
{
|
||||
size_t absoff;
|
||||
unsigned int absoff;
|
||||
short reloff;
|
||||
|
||||
if (is_union(type->type) && is_attr(attrs, ATTR_SWITCHIS))
|
||||
|
@ -1367,7 +1367,7 @@ static void write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff)
|
|||
|
||||
static int write_no_repeat_pointer_descriptions(
|
||||
FILE *file, type_t *type,
|
||||
size_t *offset_in_memory, size_t *offset_in_buffer,
|
||||
unsigned int *offset_in_memory, unsigned int *offset_in_buffer,
|
||||
unsigned int *typestring_offset)
|
||||
{
|
||||
int written = 0;
|
||||
|
@ -1375,7 +1375,7 @@ static int write_no_repeat_pointer_descriptions(
|
|||
|
||||
if (is_ptr(type) || (!type->declarray && is_conformant_array(type)))
|
||||
{
|
||||
size_t memsize;
|
||||
unsigned int memsize;
|
||||
|
||||
print_file(file, 2, "0x%02x, /* FC_NO_REPEAT */\n", RPC_FC_NO_REPEAT);
|
||||
print_file(file, 2, "0x%02x, /* FC_PAD */\n", RPC_FC_PAD);
|
||||
|
@ -1420,7 +1420,7 @@ static int write_no_repeat_pointer_descriptions(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t padding;
|
||||
unsigned int padding;
|
||||
align = 0;
|
||||
type_memsize(v->type, &align);
|
||||
padding = ROUNDING(*offset_in_memory, align);
|
||||
|
@ -1434,7 +1434,7 @@ static int write_no_repeat_pointer_descriptions(
|
|||
}
|
||||
else
|
||||
{
|
||||
size_t memsize;
|
||||
unsigned int memsize;
|
||||
align = 0;
|
||||
memsize = type_memsize(type, &align);
|
||||
*offset_in_memory += memsize;
|
||||
|
@ -1448,7 +1448,7 @@ static int write_no_repeat_pointer_descriptions(
|
|||
|
||||
static int write_pointer_description_offsets(
|
||||
FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
size_t *offset_in_memory, size_t *offset_in_buffer,
|
||||
unsigned int *offset_in_memory, unsigned int *offset_in_buffer,
|
||||
unsigned int *typestring_offset)
|
||||
{
|
||||
int written = 0;
|
||||
|
@ -1458,7 +1458,7 @@ static int write_pointer_description_offsets(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t memsize;
|
||||
unsigned int memsize;
|
||||
|
||||
/* pointer instance */
|
||||
/* FIXME: sometimes from end of structure, sometimes from beginning */
|
||||
|
@ -1499,7 +1499,7 @@ static int write_pointer_description_offsets(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t padding;
|
||||
unsigned int padding;
|
||||
align = 0;
|
||||
type_memsize(v->type, &align);
|
||||
padding = ROUNDING(*offset_in_memory, align);
|
||||
|
@ -1515,7 +1515,7 @@ static int write_pointer_description_offsets(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t memsize;
|
||||
unsigned int memsize;
|
||||
align = 0;
|
||||
memsize = type_memsize(type, &align);
|
||||
*offset_in_memory += memsize;
|
||||
|
@ -1532,7 +1532,7 @@ static int write_pointer_description_offsets(
|
|||
* it is the number of type format characters written */
|
||||
static int write_fixed_array_pointer_descriptions(
|
||||
FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
size_t *offset_in_memory, size_t *offset_in_buffer,
|
||||
unsigned int *offset_in_memory, unsigned int *offset_in_buffer,
|
||||
unsigned int *typestring_offset)
|
||||
{
|
||||
unsigned int align;
|
||||
|
@ -1549,8 +1549,8 @@ static int write_fixed_array_pointer_descriptions(
|
|||
if (pointer_count > 0)
|
||||
{
|
||||
unsigned int increment_size;
|
||||
size_t offset_of_array_pointer_mem = 0;
|
||||
size_t offset_of_array_pointer_buf = 0;
|
||||
unsigned int offset_of_array_pointer_mem = 0;
|
||||
unsigned int offset_of_array_pointer_buf = 0;
|
||||
|
||||
align = 0;
|
||||
increment_size = type_memsize(type_array_get_element(type), &align);
|
||||
|
@ -1575,7 +1575,7 @@ static int write_fixed_array_pointer_descriptions(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t padding;
|
||||
unsigned int padding;
|
||||
align = 0;
|
||||
type_memsize(v->type, &align);
|
||||
padding = ROUNDING(*offset_in_memory, align);
|
||||
|
@ -1591,7 +1591,7 @@ static int write_fixed_array_pointer_descriptions(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t memsize;
|
||||
unsigned int memsize;
|
||||
align = 0;
|
||||
memsize = type_memsize(type, &align);
|
||||
*offset_in_memory += memsize;
|
||||
|
@ -1608,7 +1608,7 @@ static int write_fixed_array_pointer_descriptions(
|
|||
* it is the number of type format characters written */
|
||||
static int write_conformant_array_pointer_descriptions(
|
||||
FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
size_t offset_in_memory, unsigned int *typestring_offset)
|
||||
unsigned int offset_in_memory, unsigned int *typestring_offset)
|
||||
{
|
||||
unsigned int align;
|
||||
int pointer_count = 0;
|
||||
|
@ -1623,8 +1623,8 @@ static int write_conformant_array_pointer_descriptions(
|
|||
if (pointer_count > 0)
|
||||
{
|
||||
unsigned int increment_size;
|
||||
size_t offset_of_array_pointer_mem = offset_in_memory;
|
||||
size_t offset_of_array_pointer_buf = offset_in_memory;
|
||||
unsigned int offset_of_array_pointer_mem = offset_in_memory;
|
||||
unsigned int offset_of_array_pointer_buf = offset_in_memory;
|
||||
|
||||
align = 0;
|
||||
increment_size = type_memsize(type_array_get_element(type), &align);
|
||||
|
@ -1653,7 +1653,7 @@ static int write_conformant_array_pointer_descriptions(
|
|||
* it is the number of type format characters written */
|
||||
static int write_varying_array_pointer_descriptions(
|
||||
FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
size_t *offset_in_memory, size_t *offset_in_buffer,
|
||||
unsigned int *offset_in_memory, unsigned int *offset_in_buffer,
|
||||
unsigned int *typestring_offset)
|
||||
{
|
||||
unsigned int align;
|
||||
|
@ -1695,7 +1695,7 @@ static int write_varying_array_pointer_descriptions(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t padding;
|
||||
unsigned int padding;
|
||||
|
||||
if (is_array(v->type) && type_array_has_variance(v->type))
|
||||
{
|
||||
|
@ -1719,7 +1719,7 @@ static int write_varying_array_pointer_descriptions(
|
|||
{
|
||||
if (offset_in_memory && offset_in_buffer)
|
||||
{
|
||||
size_t memsize;
|
||||
unsigned int memsize;
|
||||
align = 0;
|
||||
memsize = type_memsize(type, &align);
|
||||
*offset_in_memory += memsize;
|
||||
|
@ -1735,8 +1735,8 @@ static int write_varying_array_pointer_descriptions(
|
|||
static void write_pointer_description(FILE *file, type_t *type,
|
||||
unsigned int *typestring_offset)
|
||||
{
|
||||
size_t offset_in_buffer;
|
||||
size_t offset_in_memory;
|
||||
unsigned int offset_in_buffer;
|
||||
unsigned int offset_in_memory;
|
||||
|
||||
/* pass 1: search for single instance of a pointer (i.e. don't descend
|
||||
* into arrays) */
|
||||
|
@ -1784,11 +1784,11 @@ int is_declptr(const type_t *t)
|
|||
return is_ptr(t) || (is_conformant_array(t) && !t->declarray);
|
||||
}
|
||||
|
||||
static size_t write_string_tfs(FILE *file, const attr_list_t *attrs,
|
||||
type_t *type,
|
||||
const char *name, unsigned int *typestring_offset)
|
||||
static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
|
||||
type_t *type,
|
||||
const char *name, unsigned int *typestring_offset)
|
||||
{
|
||||
size_t start_offset;
|
||||
unsigned int start_offset;
|
||||
unsigned char rtype;
|
||||
|
||||
if (is_declptr(type))
|
||||
|
@ -1825,11 +1825,11 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs,
|
|||
|
||||
if (type->declarray && !is_conformant_array(type))
|
||||
{
|
||||
unsigned long dim = type_array_get_dim(type);
|
||||
unsigned int dim = type_array_get_dim(type);
|
||||
|
||||
/* FIXME: multi-dimensional array */
|
||||
if (0xffffuL < dim)
|
||||
error("array size for parameter %s exceeds %u bytes by %lu bytes\n",
|
||||
if (0xffffu < dim)
|
||||
error("array size for parameter %s exceeds %u bytes by %u bytes\n",
|
||||
name, 0xffffu, dim - 0xffffu);
|
||||
|
||||
if (rtype == RPC_FC_CHAR)
|
||||
|
@ -1877,14 +1877,14 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs,
|
|||
}
|
||||
}
|
||||
|
||||
static size_t write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
const char *name, unsigned int *typestring_offset)
|
||||
static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
const char *name, unsigned int *typestring_offset)
|
||||
{
|
||||
const expr_t *length_is = type_array_get_variance(type);
|
||||
const expr_t *size_is = type_array_get_conformance(type);
|
||||
unsigned int align = 0;
|
||||
size_t size;
|
||||
size_t start_offset;
|
||||
unsigned int size;
|
||||
unsigned int start_offset;
|
||||
int real_type;
|
||||
int has_pointer;
|
||||
int pointer_type = get_attrv(attrs, ATTR_POINTERTYPE);
|
||||
|
@ -1934,8 +1934,8 @@ static size_t write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type
|
|||
if (real_type == RPC_FC_SMVARRAY || real_type == RPC_FC_LGVARRAY)
|
||||
{
|
||||
unsigned int elalign = 0;
|
||||
size_t elsize = type_memsize(type_array_get_element(type), &elalign);
|
||||
unsigned long dim = type_array_get_dim(type);
|
||||
unsigned int elsize = type_memsize(type_array_get_element(type), &elalign);
|
||||
unsigned int dim = type_array_get_dim(type);
|
||||
|
||||
if (real_type == RPC_FC_LGVARRAY)
|
||||
{
|
||||
|
@ -2026,7 +2026,7 @@ static void write_struct_members(FILE *file, const type_t *type,
|
|||
if (!ft->declarray || !is_conformant_array(ft))
|
||||
{
|
||||
unsigned int align = 0;
|
||||
size_t size = type_memsize(ft, &align);
|
||||
unsigned int size = type_memsize(ft, &align);
|
||||
if (salign == -1)
|
||||
salign = align;
|
||||
if ((align - 1) & offset)
|
||||
|
@ -2065,14 +2065,14 @@ static void write_struct_members(FILE *file, const type_t *type,
|
|||
write_end(file, typestring_offset);
|
||||
}
|
||||
|
||||
static size_t write_struct_tfs(FILE *file, type_t *type,
|
||||
const char *name, unsigned int *tfsoff)
|
||||
static unsigned int write_struct_tfs(FILE *file, type_t *type,
|
||||
const char *name, unsigned int *tfsoff)
|
||||
{
|
||||
const type_t *save_current_structure = current_structure;
|
||||
unsigned int total_size;
|
||||
const var_t *array;
|
||||
size_t start_offset;
|
||||
size_t array_offset;
|
||||
unsigned int start_offset;
|
||||
unsigned int array_offset;
|
||||
int has_pointers = 0;
|
||||
unsigned int align = 0;
|
||||
unsigned int corroff;
|
||||
|
@ -2191,11 +2191,11 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
|
|||
return start_offset;
|
||||
}
|
||||
|
||||
static size_t write_pointer_only_tfs(FILE *file, const attr_list_t *attrs, int pointer_type,
|
||||
unsigned char flags, size_t offset,
|
||||
unsigned int *typeformat_offset)
|
||||
static unsigned int write_pointer_only_tfs(FILE *file, const attr_list_t *attrs, int pointer_type,
|
||||
unsigned char flags, unsigned int offset,
|
||||
unsigned int *typeformat_offset)
|
||||
{
|
||||
size_t start_offset = *typeformat_offset;
|
||||
unsigned int start_offset = *typeformat_offset;
|
||||
short reloff = offset - (*typeformat_offset + 2);
|
||||
int in_attr, out_attr;
|
||||
in_attr = is_attr(attrs, ATTR_IN);
|
||||
|
@ -2247,13 +2247,13 @@ static void write_branch_type(FILE *file, const type_t *t, unsigned int *tfsoff)
|
|||
*tfsoff += 2;
|
||||
}
|
||||
|
||||
static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
|
||||
static unsigned int write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
|
||||
{
|
||||
unsigned int align = 0;
|
||||
unsigned int start_offset;
|
||||
size_t size = type_memsize(type, &align);
|
||||
unsigned int size = type_memsize(type, &align);
|
||||
var_list_t *fields;
|
||||
size_t nbranch = 0;
|
||||
unsigned int nbranch = 0;
|
||||
type_t *deftype = NULL;
|
||||
short nodeftype = 0xffff;
|
||||
var_t *f;
|
||||
|
@ -2376,11 +2376,11 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
|
|||
return start_offset;
|
||||
}
|
||||
|
||||
static size_t write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
unsigned int *typeformat_offset)
|
||||
static unsigned int write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
|
||||
unsigned int *typeformat_offset)
|
||||
{
|
||||
size_t i;
|
||||
size_t start_offset = *typeformat_offset;
|
||||
unsigned int i;
|
||||
unsigned int start_offset = *typeformat_offset;
|
||||
expr_t *iid = get_attrp(attrs, ATTR_IIDIS);
|
||||
|
||||
if (iid)
|
||||
|
@ -2416,11 +2416,11 @@ static size_t write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
|
|||
return start_offset;
|
||||
}
|
||||
|
||||
static size_t write_contexthandle_tfs(FILE *file, const type_t *type,
|
||||
const var_t *var,
|
||||
unsigned int *typeformat_offset)
|
||||
static unsigned int write_contexthandle_tfs(FILE *file, const type_t *type,
|
||||
const var_t *var,
|
||||
unsigned int *typeformat_offset)
|
||||
{
|
||||
size_t start_offset = *typeformat_offset;
|
||||
unsigned int start_offset = *typeformat_offset;
|
||||
unsigned char flags = 0;
|
||||
|
||||
if (is_attr(current_iface->attrs, ATTR_STRICTCONTEXTHANDLE))
|
||||
|
@ -2464,11 +2464,11 @@ static size_t write_contexthandle_tfs(FILE *file, const type_t *type,
|
|||
return start_offset;
|
||||
}
|
||||
|
||||
static size_t write_typeformatstring_var(FILE *file, int indent, const var_t *func,
|
||||
type_t *type, const var_t *var,
|
||||
unsigned int *typeformat_offset)
|
||||
static unsigned int write_typeformatstring_var(FILE *file, int indent, const var_t *func,
|
||||
type_t *type, const var_t *var,
|
||||
unsigned int *typeformat_offset)
|
||||
{
|
||||
size_t offset;
|
||||
unsigned int offset;
|
||||
|
||||
if (is_context_handle(type))
|
||||
return write_contexthandle_tfs(file, type, var, typeformat_offset);
|
||||
|
@ -2485,7 +2485,7 @@ static size_t write_typeformatstring_var(FILE *file, int indent, const var_t *fu
|
|||
if (is_array(type))
|
||||
{
|
||||
int ptr_type;
|
||||
size_t off;
|
||||
unsigned int off;
|
||||
off = write_array_tfs(file, var->attrs, type, var->name, typeformat_offset);
|
||||
ptr_type = get_attrv(var->attrs, ATTR_POINTERTYPE);
|
||||
/* Top level pointers to conformant arrays may be handled specially
|
||||
|
@ -2541,7 +2541,7 @@ static size_t write_typeformatstring_var(FILE *file, int indent, const var_t *fu
|
|||
}
|
||||
else if (last_ptr(type))
|
||||
{
|
||||
size_t start_offset = *typeformat_offset;
|
||||
unsigned int start_offset = *typeformat_offset;
|
||||
int in_attr = is_attr(var->attrs, ATTR_IN);
|
||||
int out_attr = is_attr(var->attrs, ATTR_OUT);
|
||||
const type_t *base = type_pointer_get_ref(type);
|
||||
|
@ -2638,8 +2638,8 @@ static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *ty
|
|||
return retmask;
|
||||
}
|
||||
|
||||
static size_t process_tfs_stmts(FILE *file, const statement_list_t *stmts,
|
||||
type_pred_t pred, unsigned int *typeformat_offset)
|
||||
static unsigned int process_tfs_stmts(FILE *file, const statement_list_t *stmts,
|
||||
type_pred_t pred, unsigned int *typeformat_offset)
|
||||
{
|
||||
const var_t *var;
|
||||
const statement_t *stmt;
|
||||
|
@ -2694,7 +2694,7 @@ static size_t process_tfs_stmts(FILE *file, const statement_list_t *stmts,
|
|||
return *typeformat_offset + 1;
|
||||
}
|
||||
|
||||
static size_t process_tfs(FILE *file, const statement_list_t *stmts, type_pred_t pred)
|
||||
static unsigned int process_tfs(FILE *file, const statement_list_t *stmts, type_pred_t pred)
|
||||
{
|
||||
unsigned int typeformat_offset = 2;
|
||||
|
||||
|
@ -3073,7 +3073,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
|
|||
int in_attr, out_attr, pointer_type;
|
||||
const type_t *type = var->type;
|
||||
unsigned char rtype;
|
||||
size_t start_offset = type->typestring_offset;
|
||||
unsigned int start_offset = type->typestring_offset;
|
||||
|
||||
pointer_type = get_attrv(var->attrs, ATTR_POINTERTYPE);
|
||||
if (!pointer_type)
|
||||
|
@ -3288,16 +3288,16 @@ void write_remoting_arguments(FILE *file, int indent, const var_t *func, const c
|
|||
}
|
||||
|
||||
|
||||
size_t get_size_procformatstring_type(const char *name, const type_t *type, const attr_list_t *attrs)
|
||||
unsigned int get_size_procformatstring_type(const char *name, const type_t *type, const attr_list_t *attrs)
|
||||
{
|
||||
return write_procformatstring_type(NULL, 0, name, type, attrs, FALSE);
|
||||
}
|
||||
|
||||
|
||||
size_t get_size_procformatstring_func(const var_t *func)
|
||||
unsigned int get_size_procformatstring_func(const var_t *func)
|
||||
{
|
||||
const var_t *var;
|
||||
size_t size = 0;
|
||||
unsigned int size = 0;
|
||||
|
||||
/* argument list size */
|
||||
if (type_get_function_args(func->type))
|
||||
|
@ -3313,10 +3313,10 @@ size_t get_size_procformatstring_func(const var_t *func)
|
|||
return size;
|
||||
}
|
||||
|
||||
size_t get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred)
|
||||
unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred)
|
||||
{
|
||||
const statement_t *stmt;
|
||||
size_t size = 1;
|
||||
unsigned int size = 1;
|
||||
|
||||
if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
|
||||
{
|
||||
|
@ -3345,7 +3345,7 @@ size_t get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred
|
|||
return size;
|
||||
}
|
||||
|
||||
size_t get_size_typeformatstring(const statement_list_t *stmts, type_pred_t pred)
|
||||
unsigned int get_size_typeformatstring(const statement_list_t *stmts, type_pred_t pred)
|
||||
{
|
||||
set_all_tfswrite(FALSE);
|
||||
return process_tfs(NULL, stmts, pred);
|
||||
|
|
|
@ -45,10 +45,10 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix,
|
|||
enum pass pass, const var_t *var, const char *varname);
|
||||
void write_remoting_arguments(FILE *file, int indent, const var_t *func, const char *local_var_prefix,
|
||||
enum pass pass, enum remoting_phase phase);
|
||||
size_t get_size_procformatstring_type(const char *name, const type_t *type, const attr_list_t *attrs);
|
||||
size_t get_size_procformatstring_func(const var_t *func);
|
||||
size_t get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred);
|
||||
size_t get_size_typeformatstring(const statement_list_t *stmts, type_pred_t pred);
|
||||
unsigned int get_size_procformatstring_type(const char *name, const type_t *type, const attr_list_t *attrs);
|
||||
unsigned int get_size_procformatstring_func(const var_t *func);
|
||||
unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred);
|
||||
unsigned int get_size_typeformatstring(const statement_list_t *stmts, type_pred_t pred);
|
||||
void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char *local_var_prefix );
|
||||
void declare_stub_args( FILE *file, int indent, const var_t *func );
|
||||
int write_expr_eval_routines(FILE *file, const char *iface);
|
||||
|
@ -56,7 +56,7 @@ void write_expr_eval_routine_list(FILE *file, const char *iface);
|
|||
void write_user_quad_list(FILE *file);
|
||||
void write_endpoints( FILE *f, const char *prefix, const str_list_t *list );
|
||||
void write_exceptions( FILE *file );
|
||||
size_t type_memsize(const type_t *t, unsigned int *align);
|
||||
unsigned int type_memsize(const type_t *t, unsigned int *align);
|
||||
int decl_indirect(const type_t *t);
|
||||
void write_parameters_init(FILE *file, int indent, const var_t *func, const char *local_var_prefix);
|
||||
void print(FILE *file, int indent, const char *format, va_list ap);
|
||||
|
|
|
@ -79,7 +79,7 @@ type_t *type_new_module(char *name)
|
|||
}
|
||||
|
||||
type_t *type_new_array(const char *name, type_t *element, int declarray,
|
||||
unsigned long dim, expr_t *size_is, expr_t *length_is)
|
||||
unsigned int dim, expr_t *size_is, expr_t *length_is)
|
||||
{
|
||||
type_t *t = make_type(RPC_FC_LGFARRAY, element);
|
||||
if (name) t->name = xstrdup(name);
|
||||
|
|
|
@ -29,7 +29,7 @@ type_t *type_new_pointer(type_t *ref, attr_list_t *attrs);
|
|||
type_t *type_new_alias(type_t *t, const char *name);
|
||||
type_t *type_new_module(char *name);
|
||||
type_t *type_new_array(const char *name, type_t *element, int declarray,
|
||||
unsigned long dim, expr_t *size_is, expr_t *length_is);
|
||||
unsigned int dim, expr_t *size_is, expr_t *length_is);
|
||||
void type_interface_define(type_t *iface, type_t *inherit, statement_list_t *stmts);
|
||||
void type_dispinterface_define(type_t *iface, var_list_t *props, func_list_t *methods);
|
||||
void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface);
|
||||
|
@ -192,7 +192,7 @@ static inline int type_array_has_variance(const type_t *type)
|
|||
return (type->details.array.length_is != NULL);
|
||||
}
|
||||
|
||||
static inline unsigned long type_array_get_dim(const type_t *type)
|
||||
static inline unsigned int type_array_get_dim(const type_t *type)
|
||||
{
|
||||
type = type_get_real_type(type);
|
||||
assert(type_get_type(type) == TYPE_ARRAY);
|
||||
|
|
|
@ -292,7 +292,7 @@ struct module_details
|
|||
|
||||
struct array_details
|
||||
{
|
||||
unsigned long dim;
|
||||
unsigned int dim;
|
||||
expr_t *size_is, *length_is;
|
||||
};
|
||||
|
||||
|
|
|
@ -1086,12 +1086,12 @@ static int encode_var(
|
|||
|
||||
chat("array with %d dimensions\n", num_dims);
|
||||
encode_var(typelib, atype, var, &target_type, width, alignment, NULL);
|
||||
arrayoffset = ctl2_alloc_segment(typelib, MSFT_SEG_ARRAYDESC, (2 + 2 * num_dims) * sizeof(long), 0);
|
||||
arrayoffset = ctl2_alloc_segment(typelib, MSFT_SEG_ARRAYDESC, (2 + 2 * num_dims) * sizeof(int), 0);
|
||||
arraydata = (void *)&typelib->typelib_segment_data[MSFT_SEG_ARRAYDESC][arrayoffset];
|
||||
|
||||
arraydata[0] = target_type;
|
||||
arraydata[1] = num_dims;
|
||||
arraydata[1] |= ((num_dims * 2 * sizeof(long)) << 16);
|
||||
arraydata[1] |= ((num_dims * 2 * sizeof(int)) << 16);
|
||||
|
||||
arraydata += 2;
|
||||
for (atype = type; atype->declarray; atype = type_array_get_element(atype))
|
||||
|
|
Loading…
Reference in New Issue