Re: Write-strings warning fix

2006-08-25 Thread Andrew Talbot
Dan Hipschman wrote: > The strings are allocated in the lexer (parser.l): > > yylval.str = xstrdup(kw); > > The patch that was actually committed (using xstrdup) is most consistent. Thank you for enlightening me on that, Dan. And I am also grateful that the patch I submitted was kindly

Re: Write-strings warning fix

2006-08-25 Thread Dan Hipschman
On Fri, Aug 25, 2006 at 11:08:03AM +0100, Andrew Talbot wrote: > What confused me - especially with my ignorance of yacc - is that I couldn't > find a corresponding xmalloc() that assigns the char * variables that the > above free() frees. make_var() gains storage for a var_t type, but the > free()

Re: wldap32: Write-strings warning fix

2006-08-11 Thread Andrew Talbot
Hans Leidekker wrote: > On Friday 11 August 2006 00:58, Andrew Talbot wrote: > >> -INT CDECL ber_printf(BerElement*,PCHAR,...); >> +INT CDECL ber_printf(BerElement*,LPCSTR,...); > > This is an API defined by Microsoft, we can't change > its prototype. > > -Hans Thanks, Hans. They surprised me

Re: wldap32: Write-strings warning fix

2006-08-11 Thread Hans Leidekker
On Friday 11 August 2006 00:58, Andrew Talbot wrote: > -INT CDECL ber_printf(BerElement*,PCHAR,...); > +INT CDECL ber_printf(BerElement*,LPCSTR,...); This is an API defined by Microsoft, we can't change its prototype. -Hans

Re: shell32: Write-strings warning fix

2006-06-07 Thread Andrew Talbot
Andrew Talbot wrote: > Robert Shearman wrote: >> Sorry, this is wrong. If InsertMenuItemA writes to the string then it >> will be corrupted and will display the wrong thing for further uses in >> the process. > > A MENUITEMINFOA's dwTypeData is currently declared as writeable (LPSTR); > what it i

Re: shell32: Write-strings warning fix

2006-06-07 Thread Andrew Talbot
Robert Shearman wrote: > Sorry, this is wrong. If InsertMenuItemA writes to the string then it > will be corrupted and will display the wrong thing for further uses in > the process. A MENUITEMINFOA's dwTypeData is currently declared as writeable (LPSTR); what it is initialised from will not affec

Re: shell32: Write-strings warning fix

2006-06-07 Thread Robert Shearman
Andrew Talbot wrote: Changelog: shell32: Write-strings warning fix. diff -urN a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c --- a/dlls/shell32/shlview.c2006-05-23 17:24:50.0 +0100 +++ b/dlls/shell32/shlview.c2006-06-07 19:37:41.0 +0100 @@ -779,7 +779,9

Re: comctl32_tests: Janitorial: write-strings warning fix

2006-05-30 Thread Francois Gouget
On Sun, 28 May 2006, Vitaliy Margolen wrote: Sunday, May 28, 2006, 12:19:30 PM, Andrew Talbot wrote: On reflection, I think I need to look at constifying the structure members, where possible, rather than unconstifying the values that are fed to them. Exactly. Except that's the part that we c

Re: comctl32_tests: Janitorial: write-strings warning fix

2006-05-28 Thread Vitaliy Margolen
Sunday, May 28, 2006, 12:19:30 PM, Andrew Talbot wrote: > On reflection, I think I need to look at constifying the structure members, > where possible, rather than unconstifying the values that are fed to them. Exactly. Except that's the part that we can't do nothing about - that's the way they ar

Re: comctl32_tests: Janitorial: write-strings warning fix

2006-05-28 Thread Andrew Talbot
On reflection, I think I need to look at constifying the structure members, where possible, rather than unconstifying the values that are fed to them. -- Andy.

Re: comctl32_tests: Janitorial: write-strings warning fix

2006-05-27 Thread Andrew Talbot
Robert Shearman wrote: > > Absolutely. We should avoid regressions at all costs, but making literal > strings non-writable should help to uncover bugs. > Of course, what I am doing with the structure members is to say "These have been declared as writeable (LPSTR pszXYZ); I don't know whether th

Re: comctl32_tests: Janitorial: write-strings warning fix

2006-05-27 Thread Robert Shearman
Andrew Talbot wrote: Because I have had at least one patch like this accepted, I assumed what I was doing was OK. I guess another way of preventing this warning would be to use: x.pszText = (LPSTR) "string"; Assuming there is no danger in using this method, then it is neater for a single as

Re: comctl32_tests: Janitorial: write-strings warning fix

2006-05-27 Thread Andrew Talbot
Hi Vitaliy, I am having a go at the janitorial project of fixing certain compiler warnings suggested at http://wiki.winehq.org/CompilerWarnings/. When the -Wwrite-strings flag is set, code like this: char *a = "string"; produces the message "warning: assignment discards qualifiers from poin

Re: comctl32_tests: Janitorial: write-strings warning fix

2006-05-27 Thread Vitaliy Margolen
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.0 +0100 > +++

Re: comdlg32: Janitorial: write-strings warning fix

2006-05-24 Thread Uwe Bonnes
> "Michael" == Michael Stefaniuc <[EMAIL PROTECTED]> writes: Michael> Uwe Bonnes wrote: >>> "Andrew" == Andrew Talbot <[EMAIL PROTECTED]> >>> writes: >> Andrew> Changelog: Janitorial: Fix a write-strings compiler warning in Andrew> dlls/comdlg32/printdlg.c >

Re: comdlg32: Janitorial: write-strings warning fix

2006-05-24 Thread Michael Stefaniuc
Uwe Bonnes wrote: >>"Andrew" == Andrew Talbot <[EMAIL PROTECTED]> writes: > > > Andrew> Changelog: Janitorial: Fix a write-strings compiler warning in > Andrew> dlls/comdlg32/printdlg.c > > What is a "white-string" warning? Where have you seen the wHite-string? I see only wRite-strin

Re: comdlg32: Janitorial: write-strings warning fix

2006-05-24 Thread Uwe Bonnes
> "Andrew" == Andrew Talbot <[EMAIL PROTECTED]> writes: Andrew> Changelog: Janitorial: Fix a write-strings compiler warning in Andrew> dlls/comdlg32/printdlg.c What is a "white-string" warning? -- Uwe Bonnes[EMAIL PROTECTED] Institut fuer Kernphysik Schlossgartenst