[janitor] tools -Wwrite-strings cleanup

Alexandre Julliard julliard at winehq.org
Fri Oct 8 19:08:31 CDT 2004


Daniel Marmier <d.marmier at bluewin.ch> writes:

> -static type_t std_bool = { "boolean" };
> -static type_t std_int = { "int" };
> -static type_t std_int64 = { "__int64" };
> -static type_t std_uhyper = { "MIDL_uhyper" };
> +static char name_bool[] = "boolean";
> +static char name_int[] = "int";
> +static char name_int64[] = "__int64";
> +static char name_uhyper[] = "MIDL_uhyper";
> +
> +static type_t std_bool = { name_bool };
> +static type_t std_int = { name_int };
> +static type_t std_int64 = { name_int64 };
> +static type_t std_uhyper = { name_uhyper };
> +
> +static char name_tagged_union[] = "tagged_union";

You should never need to declare non-const strings. If you need that,
it's because some other types are not properly declared const, and
this is what needs to be fixed. The only case where a non-const string
would be appropriate is if the string itself really needs to be
written to, but that's a very rare case.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list