Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ac323a20
Commit
ac323a20
authored
Jun 20, 2012
by
Francois Gouget
Committed by
Alexandre Julliard
Jun 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Simplify the string comparison functions a bit and use the CSTR_XXX macros.
parent
e215f28a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
30 deletions
+16
-30
string.c
dlls/comctl32/string.c
+16
-30
No files found.
dlls/comctl32/string.c
View file @
ac323a20
...
...
@@ -77,7 +77,7 @@ static BOOL COMCTL32_ChrCmpHelperA(WORD ch1, WORD ch2, DWORD dwFlags)
else
str2
[
1
]
=
'\0'
;
return
CompareStringA
(
GetThreadLocale
(),
dwFlags
,
str1
,
-
1
,
str2
,
-
1
)
-
2
;
return
CompareStringA
(
GetThreadLocale
(),
dwFlags
,
str1
,
-
1
,
str2
,
-
1
)
-
CSTR_EQUAL
;
}
/*************************************************************************
...
...
@@ -117,7 +117,7 @@ static BOOL COMCTL32_ChrCmpIA(WORD ch1, WORD ch2)
*/
static
inline
BOOL
COMCTL32_ChrCmpIW
(
WCHAR
ch1
,
WCHAR
ch2
)
{
return
CompareStringW
(
GetThreadLocale
(),
NORM_IGNORECASE
,
&
ch1
,
1
,
&
ch2
,
1
)
-
2
;
return
CompareStringW
(
GetThreadLocale
(),
NORM_IGNORECASE
,
&
ch1
,
1
,
&
ch2
,
1
)
-
CSTR_EQUAL
;
}
/**************************************************************************
...
...
@@ -299,12 +299,8 @@ LPSTR WINAPI StrChrA(LPCSTR lpszStr, WORD ch)
*/
INT
WINAPI
StrCmpNIA
(
LPCSTR
lpszStr
,
LPCSTR
lpszComp
,
INT
iLen
)
{
INT
iRet
;
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszComp
),
iLen
);
iRet
=
CompareStringA
(
GetThreadLocale
(),
NORM_IGNORECASE
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
return
iRet
==
CSTR_LESS_THAN
?
-
1
:
iRet
==
CSTR_GREATER_THAN
?
1
:
0
;
return
CompareStringA
(
GetThreadLocale
(),
NORM_IGNORECASE
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/*************************************************************************
...
...
@@ -314,12 +310,8 @@ INT WINAPI StrCmpNIA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
*/
INT
WINAPI
StrCmpNIW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszComp
,
INT
iLen
)
{
INT
iRet
;
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszComp
),
iLen
);
iRet
=
CompareStringW
(
GetThreadLocale
(),
NORM_IGNORECASE
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
return
iRet
==
CSTR_LESS_THAN
?
-
1
:
iRet
==
CSTR_GREATER_THAN
?
1
:
0
;
return
CompareStringW
(
GetThreadLocale
(),
NORM_IGNORECASE
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/*************************************************************************
...
...
@@ -496,12 +488,8 @@ LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
*/
INT
WINAPI
StrCmpNA
(
LPCSTR
lpszStr
,
LPCSTR
lpszComp
,
INT
iLen
)
{
INT
iRet
;
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszComp
),
iLen
);
iRet
=
CompareStringA
(
GetThreadLocale
(),
0
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
return
iRet
==
CSTR_LESS_THAN
?
-
1
:
iRet
==
CSTR_GREATER_THAN
?
1
:
0
;
return
CompareStringA
(
GetThreadLocale
(),
0
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/**************************************************************************
...
...
@@ -511,12 +499,8 @@ INT WINAPI StrCmpNA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
*/
INT
WINAPI
StrCmpNW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszComp
,
INT
iLen
)
{
INT
iRet
;
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszComp
),
iLen
);
iRet
=
CompareStringW
(
GetThreadLocale
(),
0
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
return
iRet
==
CSTR_LESS_THAN
?
-
1
:
iRet
==
CSTR_GREATER_THAN
?
1
:
0
;
return
CompareStringW
(
GetThreadLocale
(),
0
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/**************************************************************************
...
...
@@ -877,10 +861,11 @@ BOOL WINAPI IntlStrEqWorkerA(BOOL bCase, LPCSTR lpszStr, LPCSTR lpszComp,
TRACE
(
"(%d,%s,%s,%d)
\n
"
,
bCase
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszComp
),
iLen
);
/* FIXME: Th
ese flags are
undocumented and unknown by our CompareString.
* We need
defines for them
.
/* FIXME: Th
is flag is
undocumented and unknown by our CompareString.
* We need
a define for it
.
*/
dwFlags
|=
bCase
?
0x10000000
:
0x10000001
;
dwFlags
=
0x10000000
;
if
(
!
bCase
)
dwFlags
|=
NORM_IGNORECASE
;
iRet
=
CompareStringA
(
GetThreadLocale
(),
dwFlags
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
...
...
@@ -888,7 +873,7 @@ BOOL WINAPI IntlStrEqWorkerA(BOOL bCase, LPCSTR lpszStr, LPCSTR lpszComp,
if
(
!
iRet
)
iRet
=
CompareStringA
(
2048
,
dwFlags
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
return
iRet
==
2
?
TRUE
:
FALSE
;
return
iRet
==
CSTR_EQUAL
;
}
/*************************************************************************
...
...
@@ -905,10 +890,11 @@ BOOL WINAPI IntlStrEqWorkerW(BOOL bCase, LPCWSTR lpszStr, LPCWSTR lpszComp,
TRACE
(
"(%d,%s,%s,%d)
\n
"
,
bCase
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszComp
),
iLen
);
/* FIXME: Th
ese flags are
undocumented and unknown by our CompareString.
* We need
defines for them
.
/* FIXME: Th
is flag is
undocumented and unknown by our CompareString.
* We need
a define for it
.
*/
dwFlags
=
bCase
?
0x10000000
:
0x10000001
;
dwFlags
=
0x10000000
;
if
(
!
bCase
)
dwFlags
|=
NORM_IGNORECASE
;
iRet
=
CompareStringW
(
GetThreadLocale
(),
dwFlags
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
...
...
@@ -916,5 +902,5 @@ BOOL WINAPI IntlStrEqWorkerW(BOOL bCase, LPCWSTR lpszStr, LPCWSTR lpszComp,
if
(
!
iRet
)
iRet
=
CompareStringW
(
2048
,
dwFlags
,
lpszStr
,
iLen
,
lpszComp
,
iLen
);
return
iRet
==
2
?
TRUE
:
FALSE
;
return
iRet
==
CSTR_EQUAL
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment