comctl32_tests: Janitorial: write-strings warning fix

Vitaliy Margolen wine-devel at kievinfo.com
Sat May 27 13:18:22 CDT 2006


Saturday, May 27, 2006, 11:57:33 AM, Andrew Talbot wrote:
> Changelog:
>     comctl32_tests: Janitorial: write-strings warning fix.

> diff -urN a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c
> --- a/dlls/comctl32/tests/tab.c	2006-05-27 17:25:57.000000000 +0100
> +++ b/dlls/comctl32/tests/tab.c	2006-05-27 18:45:43.000000000 +0100
> @@ -57,6 +57,9 @@
>  {
>      HWND handle;
>      TCITEM tcNewTab;
> +    static char text1[] = "Tab 1",
> +    text2[] = "Wide Tab 2",
> +    text3[] = "T 3";
 
>      handle = CreateWindow (
>  	WC_TABCONTROLA,
> @@ -71,13 +74,13 @@
>      SendMessage (handle, WM_SETFONT, 0, (LPARAM) hFont);
 
>      tcNewTab.mask = mask;
> -    tcNewTab.pszText = "Tab 1";
> +    tcNewTab.pszText = text1;
>      tcNewTab.iImage = 0;
>      SendMessage (handle, TCM_INSERTITEM, 0, (LPARAM) &tcNewTab);
> -    tcNewTab.pszText = "Wide Tab 2";
> +    tcNewTab.pszText = text2;
>      tcNewTab.iImage = 1;
>      SendMessage (handle, TCM_INSERTITEM, 1, (LPARAM) &tcNewTab);
> -    tcNewTab.pszText = "T 3";
> +    tcNewTab.pszText = text3;
>      tcNewTab.iImage = 2;
>      SendMessage (handle, TCM_INSERTITEM, 2, (LPARAM) &tcNewTab);
 

What warning are you talking about here? It's ascii constant text.
It should not be ever written to. Nor I ever seen a single warning from
this code.

Vitaliy Margolen






More information about the wine-devel mailing list