Re: include: Safely discard the const qualifier using the discard_const macro

2006-10-07 Thread Hans Leidekker
On Saturday 07 October 2006 12:03, Andrew Talbot wrote: > The problem with that is that sometimes these functions are called with > writeable strings, and the return value is used to modify the original Yes, that's why I suggested making a copy or writing a local wrapper that removes the constnes

Re: include: Safely discard the const qualifier using the discard_const macro

2006-10-07 Thread Andrew Talbot
Hans Leidekker wrote: > An alternative would be to make the return value const. The problem with that is that sometimes these functions are called with writeable strings, and the return value is used to modify the original string, something like: static WCHAR stringW = {'s','t','r','i','n','

Re: include: Safely discard the const qualifier using the discard_const macro

2006-10-07 Thread Hans Leidekker
On Saturday 07 October 2006 10:27, Andrew Talbot wrote: > I think this sort of double casting is the way to go. I would just mention An alternative would be to make the return value const. Although these functions are wide character equivalents of POSIX functions they are Wine internal functions,

Re: include: Safely discard the const qualifier using the discard_const macro

2006-10-07 Thread Andrew Talbot
James Hawkins wrote: > Hi, > > This patch is based on a patch written by Stefan Huehner in 2005. > With the -Wcast-qual warning turned on, these five wine-internal > unicode functions produce over 1400 warnings: > > strchrW, strrchrW, strpbrkW, memchrW, memrchrW > > This patch gets rid of those