Re: [HACKERS] Does mbutils.c really need to use L'\0' ?

2010-07-07 Thread Tom Lane
Takahiro Itagaki writes: > I think all of the following codes work in the same way > at least on Windows, where the codes are actually used. > utf16[dstlen] = L'\0'; > utf16[dstlen] = '\0'; > utf16[dstlen] = 0; > utf16[dstlen] = (WCHAR) 0; The last one seems like the best choice,

Re: [HACKERS] Does mbutils.c really need to use L'\0' ?

2010-07-06 Thread Takahiro Itagaki
Tom Lane wrote: > >> I'm dubious that it's worth the trouble. I suggest that it might be > >> best to replace these usages of L'\0' by plain scalar 0. > I'd tend to go with just 0, > which is a reasonably common substitute for non-wide '\0' ... I think all of the following codes work in the sa

Re: [HACKERS] Does mbutils.c really need to use L'\0' ?

2010-07-06 Thread Tom Lane
Andrew Dunstan writes: > Tom Lane wrote: >> I'm dubious that it's worth the trouble. I suggest that it might be >> best to replace these usages of L'\0' by plain scalar 0. Does anyone >> think that wouldn't work or is too grotty? > or maybe 0x, which I gather from >

Re: [HACKERS] Does mbutils.c really need to use L'\0' ?

2010-07-06 Thread Andrew Dunstan
Tom Lane wrote: I grow weary of mopping up after pgindent, as in http://archives.postgresql.org/pgsql-committers/2010-07/msg00069.php The problem evidently is that pgindent hasn't heard of wide character constants. No doubt the best fix would be to teach it about them; but given that we seem

[HACKERS] Does mbutils.c really need to use L'\0' ?

2010-07-06 Thread Tom Lane
I grow weary of mopping up after pgindent, as in http://archives.postgresql.org/pgsql-committers/2010-07/msg00069.php The problem evidently is that pgindent hasn't heard of wide character constants. No doubt the best fix would be to teach it about them; but given that we seem to have next to no u