msvcrt: Do not use wide character constants.
Michael Stefaniuc
mstefani at redhat.de
Fri Jun 22 16:39:31 CDT 2007
They aren't needed and the implicit cast from the 32bit wchar_t to the
16bit WCHAR isn't that much better than the (Wine) normal implicit cast
from the 8bit char.
---
dlls/msvcrt/file.c | 2 +-
dlls/msvcrt/scanf.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 14b7311..1be1a10 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -2764,7 +2764,7 @@ int CDECL MSVCRT_fputws(const MSVCRT_wchar_t *s, MSVCRT_FILE* file)
return MSVCRT_fwrite(s,sizeof(*s),len,file) == len ? 0 : MSVCRT_EOF;
for (i=0; i<len; i++)
{
- if ((s[i] == L'\n') && (MSVCRT_fputc('\r', file) == MSVCRT_EOF))
+ if ((s[i] == '\n') && (MSVCRT_fputc('\r', file) == MSVCRT_EOF))
return MSVCRT_WEOF;
if (MSVCRT_fputwc(s[i], file) == MSVCRT_WEOF)
return MSVCRT_WEOF;
diff --git a/dlls/msvcrt/scanf.c b/dlls/msvcrt/scanf.c
index c035845..c51c5ab 100644
--- a/dlls/msvcrt/scanf.c
+++ b/dlls/msvcrt/scanf.c
@@ -50,10 +50,10 @@ static int char2digit(char c, int base) {
* given base, or -1 if the given character is not a digit of the base.
*/
static int wchar2digit(MSVCRT_wchar_t c, int base) {
- if ((c>=L'0') && (c<=L'9') && (c<=L'0'+base-1)) return (c-L'0');
+ if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
if (base<=10) return -1;
- if ((c>=L'A') && (c<=L'Z') && (c<=L'A'+base-11)) return (c-L'A'+10);
- if ((c>=L'a') && (c<=L'z') && (c<=L'a'+base-11)) return (c-L'a'+10);
+ if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
+ if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
return -1;
}
--
1.5.0.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070622/ee8549db/attachment.pgp
More information about the wine-patches
mailing list