Alexandre Julliard : widl:
Use unsigned int instead of size_t to avoid printf format warnings.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jun 14 06:51:07 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 043fd66907c2ca2697a8c8dd47b388487d8dcc81
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=043fd66907c2ca2697a8c8dd47b388487d8dcc81
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Jun 13 14:13:49 2006 +0200
widl: Use unsigned int instead of size_t to avoid printf format warnings.
---
tools/widl/server.c | 4 +++-
tools/widl/typegen.c | 20 ++++++++++----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/tools/widl/server.c b/tools/widl/server.c
index 6d00748..97f5102 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -154,13 +154,15 @@ static void assign_out_args(const func_t
if (has_size)
{
+ unsigned int size;
type_t *type = var->type;
while (type->type == 0 && type->ref)
type = type->ref;
fprintf(server, " = NdrAllocate(&_StubMsg, ");
write_expr(server, size_is, 1);
- fprintf(server, " * %u);\n", get_type_memsize(type));
+ size = get_type_memsize(type);
+ fprintf(server, " * %u);\n", size);
}
else if (!is_string)
{
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 19e4664..20db78c 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -596,7 +596,7 @@ size_t get_type_memsize(const type_t *ty
static int write_pointers(FILE *file, const attr_t *attrs,
const type_t *type, int ptr_level,
const expr_t *array, int level,
- size_t *typestring_offset)
+ unsigned int *typestring_offset)
{
int pointers_written = 0;
const var_t *v;
@@ -702,7 +702,7 @@ static size_t write_pointer_description(
static size_t write_string_tfs(FILE *file, const attr_t *attrs,
const type_t *type, const expr_t *array,
- const char *name, size_t *typestring_offset)
+ const char *name, unsigned int *typestring_offset)
{
const expr_t *size_is = get_attrp(attrs, ATTR_SIZEIS);
int has_size = size_is && (size_is->type != EXPR_VOID);
@@ -782,7 +782,7 @@ static size_t write_string_tfs(FILE *fil
static size_t write_array_tfs(FILE *file, const attr_t *attrs,
const type_t *type, const expr_t *array,
- const char *name, size_t *typestring_offset)
+ const char *name, unsigned int *typestring_offset)
{
const expr_t *length_is = get_attrp(attrs, ATTR_LENGTHIS);
const expr_t *size_is = get_attrp(attrs, ATTR_SIZEIS);
@@ -1050,9 +1050,9 @@ #undef CASE_BASETYPE
}
static size_t write_struct_tfs(FILE *file, const type_t *type,
- const char *name, size_t *typestring_offset)
+ const char *name, unsigned int *typestring_offset)
{
- size_t total_size;
+ unsigned int total_size;
const var_t *array;
size_t start_offset;
size_t array_offset;
@@ -1210,7 +1210,7 @@ static size_t write_struct_tfs(FILE *fil
}
}
-static void write_pointer_only_tfs(FILE *file, const attr_t *attrs, size_t offset, size_t *typeformat_offset)
+static void write_pointer_only_tfs(FILE *file, const attr_t *attrs, size_t offset, unsigned int *typeformat_offset)
{
int in_attr, out_attr;
unsigned char flags = 0;
@@ -1234,14 +1234,14 @@ static void write_pointer_only_tfs(FILE
static size_t write_union_tfs(FILE *file, const attr_t *attrs,
const type_t *type, const char *name,
- size_t *typeformat_offset)
+ unsigned int *typeformat_offset)
{
error("write_union_tfs: Unimplemented\n");
return *typeformat_offset;
}
static size_t write_typeformatstring_var(FILE *file, int indent,
- const var_t *var, size_t *typeformat_offset)
+ const var_t *var, unsigned int *typeformat_offset)
{
const type_t *type = var->type;
int ptr_level = var->ptr_level;
@@ -1350,7 +1350,7 @@ void write_typeformatstring(FILE *file,
{
int indent = 0;
var_t *var;
- size_t typeformat_offset;
+ unsigned int typeformat_offset;
const ifref_t *iface = ifaces;
print_file(file, indent, "static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =\n");
@@ -1855,7 +1855,7 @@ size_t get_size_procformatstring_var(con
size_t get_size_typeformatstring_var(const var_t *var)
{
- size_t type_offset = 0;
+ unsigned int type_offset = 0;
write_typeformatstring_var(NULL, 0, var, &type_offset);
return type_offset;
}
More information about the wine-cvs
mailing list