[Wine-patches] user32: Optimize IsChar*A.
Alexander Morozov
=?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Чт Апр 9 17:41:17 MSD 2009
----------- следующая часть -----------
From 6d60f933e3f34ad134b433003a10a0b320056131 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Thu, 9 Apr 2009 17:23:02 +0400
Subject: [PATCH] user32: Optimize IsChar*A.
---
dlls/user32/lstr.c | 33 +++++++++++++++++++++++++++++++++
include/wine/etersoft.h | 10 ++++++++++
2 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/dlls/user32/lstr.c b/dlls/user32/lstr.c
index 8fff22f..fa5361f 100644
--- a/dlls/user32/lstr.c
+++ b/dlls/user32/lstr.c
@@ -37,6 +37,11 @@
#include "wine/exception.h"
#include "wine/unicode.h"
+#define ETERSOFT_FUNC_LSTR
+#include "wine/etersoft.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(string);
+
/***********************************************************************
* CharNextA (USER32.@)
@@ -378,6 +383,13 @@ DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len )
BOOL WINAPI IsCharLowerA(CHAR x)
{
WCHAR wch;
+
+ LOADETER_FUNC(etersoft_ischarlower);
+ if (etersoft_ischarlower)
+ {
+ int res = etersoft_ischarlower(GetACP(), x);
+ if (res >= 0) return res;
+ }
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharLowerW(wch);
}
@@ -399,6 +411,13 @@ BOOL WINAPI IsCharLowerW(WCHAR x)
BOOL WINAPI IsCharUpperA(CHAR x)
{
WCHAR wch;
+
+ LOADETER_FUNC(etersoft_ischarupper);
+ if (etersoft_ischarupper)
+ {
+ int res = etersoft_ischarupper(GetACP(), x);
+ if (res >= 0) return res;
+ }
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharUpperW(wch);
}
@@ -420,6 +439,13 @@ BOOL WINAPI IsCharUpperW(WCHAR x)
BOOL WINAPI IsCharAlphaNumericA(CHAR x)
{
WCHAR wch;
+
+ LOADETER_FUNC(etersoft_ischaralnum);
+ if (etersoft_ischaralnum)
+ {
+ int res = etersoft_ischaralnum(GetACP(), x);
+ if (res >= 0) return res;
+ }
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharAlphaNumericW(wch);
}
@@ -441,6 +467,13 @@ BOOL WINAPI IsCharAlphaNumericW(WCHAR x)
BOOL WINAPI IsCharAlphaA(CHAR x)
{
WCHAR wch;
+
+ LOADETER_FUNC(etersoft_ischaralpha);
+ if (etersoft_ischaralpha)
+ {
+ int res = etersoft_ischaralpha(GetACP(), x);
+ if (res >= 0) return res;
+ }
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharAlphaW(wch);
}
diff --git a/include/wine/etersoft.h b/include/wine/etersoft.h
index fc29d39..7c179c8 100644
--- a/include/wine/etersoft.h
+++ b/include/wine/etersoft.h
@@ -159,4 +159,14 @@ static int (*etersoft_getwm)(void);
static void (*etersoft_fix_driver)(unsigned long code, void *out_buffer,
unsigned long out_size, long *status, unsigned long *info);
+#ifdef ETERSOFT_FUNC_LSTR
+static int (*etersoft_ischaralnum)(unsigned int cp, char x);
+
+static int (*etersoft_ischaralpha)(unsigned int cp, char x);
+
+static int (*etersoft_ischarlower)(unsigned int cp, char x);
+
+static int (*etersoft_ischarupper)(unsigned int cp, char x);
+#endif
+
#endif
--
1.6.1.3.GIT
Подробная информация о списке рассылки Wine-patches