Commit ef6971da authored by Alexandre Julliard's avatar Alexandre Julliard

widl: Replace unsigned long and size_t by unsigned int where appropriate.

parent 844c8a18
...@@ -387,7 +387,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines) ...@@ -387,7 +387,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
static void write_clientinterfacedecl(type_t *iface) 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 UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
const str_list_t *endpoints = get_attrp(iface->attrs, ATTR_ENDPOINT); const str_list_t *endpoints = get_attrp(iface->attrs, ATTR_ENDPOINT);
......
...@@ -502,7 +502,7 @@ static const unsigned char Lookup_224[128 * 3] = { ...@@ -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 * skind and lcid, while the low word is based on a repeated string
* hash of skind/str. * 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 nOffset, nMask = skind == SYS_MAC ? 1 : 0;
ULONG nHiWord, nLoWord = 0x0deadbee; ULONG nHiWord, nLoWord = 0x0deadbee;
......
...@@ -28,6 +28,6 @@ typedef enum tag_syskind_t { ...@@ -28,6 +28,6 @@ typedef enum tag_syskind_t {
SYS_MAC SYS_MAC
} syskind_t; } 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 #endif
...@@ -274,7 +274,7 @@ void write_type_right(FILE *h, type_t *t, int is_field) ...@@ -274,7 +274,7 @@ void write_type_right(FILE *h, type_t *t, int is_field)
t = type_array_get_element(t); t = type_array_get_element(t);
} }
for ( ; t->declarray; 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, ...@@ -1485,9 +1485,9 @@ static void set_type(var_t *v, decl_spec_t *decl_spec, const declarator_t *decl,
if (0) if (0)
{ {
unsigned int align = 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); 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) ...@@ -248,8 +248,8 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
static void write_dispatchtable(type_t *iface) static void write_dispatchtable(type_t *iface)
{ {
unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION); unsigned int ver = get_attrv(iface->attrs, ATTR_VERSION);
unsigned long method_count = 0; unsigned int method_count = 0;
const statement_t *stmt; const statement_t *stmt;
print_server("static RPC_DISPATCH_FUNCTION %s_table[] =\n", iface->name); 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) ...@@ -323,7 +323,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
static void write_serverinterfacedecl(type_t *iface) 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); UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
const str_list_t *endpoints = get_attrp(iface->attrs, ATTR_ENDPOINT); const str_list_t *endpoints = get_attrp(iface->attrs, ATTR_ENDPOINT);
......
...@@ -45,10 +45,10 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix, ...@@ -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); 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, void write_remoting_arguments(FILE *file, int indent, const var_t *func, const char *local_var_prefix,
enum pass pass, enum remoting_phase phase); 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); unsigned int 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); unsigned int get_size_procformatstring_func(const var_t *func);
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);
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);
void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char *local_var_prefix ); 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 ); void declare_stub_args( FILE *file, int indent, const var_t *func );
int write_expr_eval_routines(FILE *file, const char *iface); 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); ...@@ -56,7 +56,7 @@ void write_expr_eval_routine_list(FILE *file, const char *iface);
void write_user_quad_list(FILE *file); void write_user_quad_list(FILE *file);
void write_endpoints( FILE *f, const char *prefix, const str_list_t *list ); void write_endpoints( FILE *f, const char *prefix, const str_list_t *list );
void write_exceptions( FILE *file ); 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); 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 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); void print(FILE *file, int indent, const char *format, va_list ap);
......
...@@ -79,7 +79,7 @@ type_t *type_new_module(char *name) ...@@ -79,7 +79,7 @@ type_t *type_new_module(char *name)
} }
type_t *type_new_array(const char *name, type_t *element, int declarray, 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); type_t *t = make_type(RPC_FC_LGFARRAY, element);
if (name) t->name = xstrdup(name); if (name) t->name = xstrdup(name);
......
...@@ -29,7 +29,7 @@ type_t *type_new_pointer(type_t *ref, attr_list_t *attrs); ...@@ -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_alias(type_t *t, const char *name);
type_t *type_new_module(char *name); type_t *type_new_module(char *name);
type_t *type_new_array(const char *name, type_t *element, int declarray, 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_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(type_t *iface, var_list_t *props, func_list_t *methods);
void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface); 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) ...@@ -192,7 +192,7 @@ static inline int type_array_has_variance(const type_t *type)
return (type->details.array.length_is != NULL); 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); type = type_get_real_type(type);
assert(type_get_type(type) == TYPE_ARRAY); assert(type_get_type(type) == TYPE_ARRAY);
......
...@@ -292,7 +292,7 @@ struct module_details ...@@ -292,7 +292,7 @@ struct module_details
struct array_details struct array_details
{ {
unsigned long dim; unsigned int dim;
expr_t *size_is, *length_is; expr_t *size_is, *length_is;
}; };
......
...@@ -1086,12 +1086,12 @@ static int encode_var( ...@@ -1086,12 +1086,12 @@ static int encode_var(
chat("array with %d dimensions\n", num_dims); chat("array with %d dimensions\n", num_dims);
encode_var(typelib, atype, var, &target_type, width, alignment, NULL); 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 = (void *)&typelib->typelib_segment_data[MSFT_SEG_ARRAYDESC][arrayoffset];
arraydata[0] = target_type; arraydata[0] = target_type;
arraydata[1] = num_dims; arraydata[1] = num_dims;
arraydata[1] |= ((num_dims * 2 * sizeof(long)) << 16); arraydata[1] |= ((num_dims * 2 * sizeof(int)) << 16);
arraydata += 2; arraydata += 2;
for (atype = type; atype->declarray; atype = type_array_get_element(atype)) for (atype = type; atype->declarray; atype = type_array_get_element(atype))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment