Francois Gouget wrote:
On Mon, 15 Jul 2002, Shachar Shemesh wrote:
LPWSTR lpText = (LPWSTR)lParam;
lpText[0] = '\0';
Shouldn't it be
LPWSTR lpText = (LPWSTR)lParam;
lpText[0] = L'\0';
It does not matter. Both are equivalent to:
lpText[0] = 0;
'\0' is a single byte 0 value (IOW a char) which is expanded to 16bits, and assigned to the WCHAR. L'\0' is a 32bit 0 Unicode character (a wchar_t) which is scaled down to 16bits and assigned to the WCHAR. And the last one is a 32bit integer which too is scaled down to 16bits and assigned to the WCHAR.
The thing is Unix C compilers don't have 16bit literal Unicode characters (except in some cases g++ 3.x) so you cannot write code that does not imvolve a conversion of some sort.
Not trying to be a hard head here, and I'm not even remotely trying to suggest that this particular line of code is a crucial point. It's just that my understanding of this project and the way code should be with it, all WINE DLLs are actually WineLib code. All WineLib code should duel compile on Windows and Unix. In theory, there should not be a problem compiling our sources of USER.DLL on Visual C, and running it on Windows instead of the native DLL (far fetched example, I know).
If VC does have a "one correct way", while gcc doesn't, shouldn't we prefer the VC correct one?