widl: Yet more const attributes.
This commit is contained in:
parent
511463f3a5
commit
f1bb0a474b
|
@ -66,13 +66,13 @@ static int print_client( const char *format, ... )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void print_message_buffer_size(func_t *func)
|
static void print_message_buffer_size(const func_t *func)
|
||||||
{
|
{
|
||||||
unsigned int total_size = 0;
|
unsigned int total_size = 0;
|
||||||
|
|
||||||
if (func->args)
|
if (func->args)
|
||||||
{
|
{
|
||||||
var_t *var = func->args;
|
const var_t *var = func->args;
|
||||||
while (NEXT_LINK(var)) var = NEXT_LINK(var);
|
while (NEXT_LINK(var)) var = NEXT_LINK(var);
|
||||||
while (var)
|
while (var)
|
||||||
{
|
{
|
||||||
|
@ -90,8 +90,8 @@ static void print_message_buffer_size(func_t *func)
|
||||||
|
|
||||||
static void write_function_stubs(type_t *iface)
|
static void write_function_stubs(type_t *iface)
|
||||||
{
|
{
|
||||||
func_t *func = iface->funcs;
|
const func_t *func = iface->funcs;
|
||||||
char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
||||||
int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE);
|
int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE);
|
||||||
var_t *var;
|
var_t *var;
|
||||||
int method_count = 0;
|
int method_count = 0;
|
||||||
|
@ -101,8 +101,8 @@ static void write_function_stubs(type_t *iface)
|
||||||
while (NEXT_LINK(func)) func = NEXT_LINK(func);
|
while (NEXT_LINK(func)) func = NEXT_LINK(func);
|
||||||
while (func)
|
while (func)
|
||||||
{
|
{
|
||||||
var_t *def = func->def;
|
const var_t *def = func->def;
|
||||||
var_t* explicit_handle_var;
|
const var_t* explicit_handle_var;
|
||||||
unsigned int type_offset_func;
|
unsigned int type_offset_func;
|
||||||
|
|
||||||
/* check for a defined binding handle */
|
/* check for a defined binding handle */
|
||||||
|
@ -301,7 +301,7 @@ static void write_stubdescdecl(type_t *iface)
|
||||||
|
|
||||||
static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
|
static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
|
||||||
{
|
{
|
||||||
char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
||||||
|
|
||||||
print_client("static const MIDL_STUB_DESC %s_StubDesc =\n", iface->name);
|
print_client("static const MIDL_STUB_DESC %s_StubDesc =\n", iface->name);
|
||||||
print_client("{\n");
|
print_client("{\n");
|
||||||
|
@ -341,7 +341,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 long ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||||
UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
|
const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
|
||||||
|
|
||||||
print_client("static const RPC_CLIENT_INTERFACE %s___RpcClientInterface =\n", iface->name );
|
print_client("static const RPC_CLIENT_INTERFACE %s___RpcClientInterface =\n", iface->name );
|
||||||
print_client("{\n");
|
print_client("{\n");
|
||||||
|
@ -423,7 +423,7 @@ static void write_formatstringsdecl(type_t *iface)
|
||||||
|
|
||||||
static void write_implicithandledecl(type_t *iface)
|
static void write_implicithandledecl(type_t *iface)
|
||||||
{
|
{
|
||||||
char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
||||||
|
|
||||||
if (implicit_handle)
|
if (implicit_handle)
|
||||||
{
|
{
|
||||||
|
|
|
@ -491,16 +491,16 @@ void write_externdef(const var_t *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_library(const char *name, attr_t *attr) {
|
void write_library(const char *name, attr_t *attr) {
|
||||||
UUID *uuid = get_attrp(attr, ATTR_UUID);
|
const UUID *uuid = get_attrp(attr, ATTR_UUID);
|
||||||
fprintf(header, "\n");
|
fprintf(header, "\n");
|
||||||
write_guid("LIBID", name, uuid);
|
write_guid("LIBID", name, uuid);
|
||||||
fprintf(header, "\n");
|
fprintf(header, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var_t* get_explicit_handle_var(func_t* func)
|
const var_t* get_explicit_handle_var(const func_t* func)
|
||||||
{
|
{
|
||||||
var_t* var;
|
const var_t* var;
|
||||||
|
|
||||||
if (!func->args)
|
if (!func->args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -535,7 +535,7 @@ int is_local(attr_t *a)
|
||||||
return is_attr(a, ATTR_LOCAL);
|
return is_attr(a, ATTR_LOCAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
var_t *is_callas(attr_t *a)
|
const var_t *is_callas(attr_t *a)
|
||||||
{
|
{
|
||||||
return get_attrp(a, ATTR_CALLAS);
|
return get_attrp(a, ATTR_CALLAS);
|
||||||
}
|
}
|
||||||
|
@ -893,7 +893,7 @@ static void write_com_interface(type_t *iface)
|
||||||
static void write_rpc_interface(const type_t *iface)
|
static void write_rpc_interface(const type_t *iface)
|
||||||
{
|
{
|
||||||
unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION);
|
unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION);
|
||||||
char *var = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
const char *var = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
||||||
|
|
||||||
if (!iface->funcs) return;
|
if (!iface->funcs) return;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern const char* get_name(const var_t *v);
|
||||||
extern void write_type(FILE *h, type_t *t, const var_t *v, const char *n);
|
extern void write_type(FILE *h, type_t *t, const var_t *v, const char *n);
|
||||||
extern int is_object(attr_t *a);
|
extern int is_object(attr_t *a);
|
||||||
extern int is_local(attr_t *a);
|
extern int is_local(attr_t *a);
|
||||||
extern var_t *is_callas(attr_t *a);
|
extern const var_t *is_callas(attr_t *a);
|
||||||
extern void write_args(FILE *h, var_t *arg, const char *name, int obj, int do_indent);
|
extern void write_args(FILE *h, var_t *arg, const char *name, int obj, int do_indent);
|
||||||
extern void write_array(FILE *h, const expr_t *v, int field);
|
extern void write_array(FILE *h, const expr_t *v, int field);
|
||||||
extern void write_forward(type_t *iface);
|
extern void write_forward(type_t *iface);
|
||||||
|
@ -43,7 +43,7 @@ extern void write_constdef(const var_t *v);
|
||||||
extern void write_externdef(const var_t *v);
|
extern void write_externdef(const var_t *v);
|
||||||
extern void write_library(const char *name, attr_t *attr);
|
extern void write_library(const char *name, attr_t *attr);
|
||||||
extern void write_user_types(void);
|
extern void write_user_types(void);
|
||||||
extern var_t* get_explicit_handle_var(func_t* func);
|
extern const var_t* get_explicit_handle_var(const func_t* func);
|
||||||
|
|
||||||
static inline int is_string_type(const attr_t *attrs, int ptr_level, const expr_t *array)
|
static inline int is_string_type(const attr_t *attrs, int ptr_level, const expr_t *array)
|
||||||
{
|
{
|
||||||
|
|
|
@ -889,13 +889,13 @@ static void write_proxy(type_t *iface)
|
||||||
fprintf(proxy, " * %s interface\n", iface->name);
|
fprintf(proxy, " * %s interface\n", iface->name);
|
||||||
fprintf(proxy, " */\n");
|
fprintf(proxy, " */\n");
|
||||||
while (cur) {
|
while (cur) {
|
||||||
var_t *def = cur->def;
|
const var_t *def = cur->def;
|
||||||
if (!is_local(def->attrs)) {
|
if (!is_local(def->attrs)) {
|
||||||
var_t *cas = is_callas(def->attrs);
|
const var_t *cas = is_callas(def->attrs);
|
||||||
const char *cname = cas ? cas->name : NULL;
|
const char *cname = cas ? cas->name : NULL;
|
||||||
int idx = cur->idx;
|
int idx = cur->idx;
|
||||||
if (cname) {
|
if (cname) {
|
||||||
func_t *m = iface->funcs;
|
const func_t *m = iface->funcs;
|
||||||
while (m && strcmp(get_name(m->def), cname))
|
while (m && strcmp(get_name(m->def), cname))
|
||||||
m = NEXT_LINK(m);
|
m = NEXT_LINK(m);
|
||||||
idx = m->idx;
|
idx = m->idx;
|
||||||
|
|
|
@ -68,9 +68,9 @@ static int print_server(const char *format, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void write_parameters_init(func_t *func)
|
static void write_parameters_init(const func_t *func)
|
||||||
{
|
{
|
||||||
var_t *var;
|
const var_t *var;
|
||||||
|
|
||||||
if (!func->args)
|
if (!func->args)
|
||||||
return;
|
return;
|
||||||
|
@ -91,16 +91,16 @@ static void write_function_stubs(type_t *iface)
|
||||||
{
|
{
|
||||||
char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
||||||
int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE);
|
int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE);
|
||||||
func_t *func = iface->funcs;
|
const func_t *func = iface->funcs;
|
||||||
var_t *var;
|
const var_t *var;
|
||||||
var_t* explicit_handle_var;
|
const var_t* explicit_handle_var;
|
||||||
unsigned int proc_offset = 0;
|
unsigned int proc_offset = 0;
|
||||||
unsigned int type_offset = 2;
|
unsigned int type_offset = 2;
|
||||||
|
|
||||||
while (NEXT_LINK(func)) func = NEXT_LINK(func);
|
while (NEXT_LINK(func)) func = NEXT_LINK(func);
|
||||||
while (func)
|
while (func)
|
||||||
{
|
{
|
||||||
var_t *def = func->def;
|
const var_t *def = func->def;
|
||||||
unsigned long buffer_size = 0;
|
unsigned long buffer_size = 0;
|
||||||
unsigned int type_offset_func;
|
unsigned int type_offset_func;
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ static void write_function_stubs(type_t *iface)
|
||||||
|
|
||||||
if (func->args)
|
if (func->args)
|
||||||
{
|
{
|
||||||
var_t *var = func->args;
|
const var_t *var = func->args;
|
||||||
while (NEXT_LINK(var)) var = NEXT_LINK(var);
|
while (NEXT_LINK(var)) var = NEXT_LINK(var);
|
||||||
while (var)
|
while (var)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1338,7 +1338,7 @@ unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment)
|
||||||
return get_required_buffer_size_type(var->type, var->ptr_level, var->array, var->name, alignment);
|
return get_required_buffer_size_type(var->type, var->ptr_level, var->array, var->name, alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
void marshall_arguments(FILE *file, int indent, func_t *func,
|
void marshall_arguments(FILE *file, int indent, const func_t *func,
|
||||||
unsigned int *type_offset, enum pass pass)
|
unsigned int *type_offset, enum pass pass)
|
||||||
{
|
{
|
||||||
unsigned int last_size = 0;
|
unsigned int last_size = 0;
|
||||||
|
@ -1533,7 +1533,7 @@ void marshall_arguments(FILE *file, int indent, func_t *func,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void unmarshall_arguments(FILE *file, int indent, func_t *func,
|
void unmarshall_arguments(FILE *file, int indent, const func_t *func,
|
||||||
unsigned int *type_offset, enum pass pass)
|
unsigned int *type_offset, enum pass pass)
|
||||||
{
|
{
|
||||||
unsigned int last_size = 0;
|
unsigned int last_size = 0;
|
||||||
|
|
|
@ -30,8 +30,8 @@ enum pass
|
||||||
void write_procformatstring(FILE *file, type_t *iface);
|
void write_procformatstring(FILE *file, type_t *iface);
|
||||||
void write_typeformatstring(FILE *file, type_t *iface);
|
void write_typeformatstring(FILE *file, type_t *iface);
|
||||||
unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment);
|
unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment);
|
||||||
void marshall_arguments(FILE *file, int indent, func_t *func, unsigned int *type_offset, enum pass pass);
|
void marshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass);
|
||||||
void unmarshall_arguments(FILE *file, int indent, func_t *func, unsigned int *type_offset, enum pass pass);
|
void unmarshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass);
|
||||||
size_t get_size_procformatstring_var(const var_t *var);
|
size_t get_size_procformatstring_var(const var_t *var);
|
||||||
size_t get_size_typeformatstring_var(const var_t *var);
|
size_t get_size_typeformatstring_var(const var_t *var);
|
||||||
int write_expr_eval_routines(FILE *file, const char *iface);
|
int write_expr_eval_routines(FILE *file, const char *iface);
|
||||||
|
|
Loading…
Reference in New Issue