Commit f310fdf3 authored by Alexandre Julliard's avatar Alexandre Julliard

Removed a couple of unneeded helper functions.

parent a9d4b071
...@@ -408,17 +408,27 @@ INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen) ...@@ -408,17 +408,27 @@ INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0; return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0;
} }
/************************************************************************* /**************************************************************************
* COMCTL32_StrRChrHelperA * StrRChrA [COMCTL32.351]
*
* Find the last occurence of a character in string.
* *
* Internal implementation of StrRChrA/StrRChrIA. * PARAMS
* lpszStr [I] String to search in
* lpszEnd [I] Place to end search, or NULL to search until the end of lpszStr
* ch [I] Character to search for.
*
* RETURNS
* Success: A pointer to the last occurrence of ch in lpszStr before lpszEnd,
* or NULL if not found.
* Failure: NULL, if any arguments are invalid.
*/ */
static LPSTR COMCTL32_StrRChrHelperA(LPCSTR lpszStr, LPSTR WINAPI StrRChrA(LPCSTR lpszStr, LPCSTR lpszEnd, WORD ch)
LPCSTR lpszEnd, WORD ch,
BOOL (WINAPI *pChrCmpFn)(WORD,WORD))
{ {
LPCSTR lpszRet = NULL; LPCSTR lpszRet = NULL;
TRACE("(%s,%s,%x)\n", debugstr_a(lpszStr), debugstr_a(lpszEnd), ch);
if (lpszStr) if (lpszStr)
{ {
WORD ch2; WORD ch2;
...@@ -430,7 +440,7 @@ static LPSTR COMCTL32_StrRChrHelperA(LPCSTR lpszStr, ...@@ -430,7 +440,7 @@ static LPSTR COMCTL32_StrRChrHelperA(LPCSTR lpszStr,
{ {
ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | lpszStr[1] : *lpszStr; ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | lpszStr[1] : *lpszStr;
if (!pChrCmpFn(ch, ch2)) if (!COMCTL32_ChrCmpA(ch, ch2))
lpszRet = lpszStr; lpszRet = lpszStr;
lpszStr = CharNextA(lpszStr); lpszStr = CharNextA(lpszStr);
} }
...@@ -438,17 +448,18 @@ static LPSTR COMCTL32_StrRChrHelperA(LPCSTR lpszStr, ...@@ -438,17 +448,18 @@ static LPSTR COMCTL32_StrRChrHelperA(LPCSTR lpszStr,
return (LPSTR)lpszRet; return (LPSTR)lpszRet;
} }
/*************************************************************************
* COMCTL32_StrRChrHelperW /**************************************************************************
* StrRChrW [COMCTL32.359]
* *
* Internal implementation of StrRChrW/StrRChrIW. * See StrRChrA.
*/ */
static LPWSTR COMCTL32_StrRChrHelperW(LPCWSTR lpszStr, LPWSTR WINAPI StrRChrW(LPCWSTR lpszStr, LPCWSTR lpszEnd, WORD ch)
LPCWSTR lpszEnd, WCHAR ch,
BOOL (WINAPI *pChrCmpFn)(WCHAR,WCHAR))
{ {
LPCWSTR lpszRet = NULL; LPCWSTR lpszRet = NULL;
TRACE("(%s,%s,%x)\n", debugstr_w(lpszStr), debugstr_w(lpszEnd), ch);
if (lpszStr) if (lpszStr)
{ {
if (!lpszEnd) if (!lpszEnd)
...@@ -456,7 +467,7 @@ static LPWSTR COMCTL32_StrRChrHelperW(LPCWSTR lpszStr, ...@@ -456,7 +467,7 @@ static LPWSTR COMCTL32_StrRChrHelperW(LPCWSTR lpszStr,
while (*lpszStr && lpszStr <= lpszEnd) while (*lpszStr && lpszStr <= lpszEnd)
{ {
if (!pChrCmpFn(ch, *lpszStr)) if (!COMCTL32_ChrCmpW(ch, *lpszStr))
lpszRet = lpszStr; lpszRet = lpszStr;
lpszStr = CharNextW(lpszStr); lpszStr = CharNextW(lpszStr);
} }
...@@ -465,41 +476,6 @@ static LPWSTR COMCTL32_StrRChrHelperW(LPCWSTR lpszStr, ...@@ -465,41 +476,6 @@ static LPWSTR COMCTL32_StrRChrHelperW(LPCWSTR lpszStr,
} }
/************************************************************************** /**************************************************************************
* StrRChrA [COMCTL32.351]
*
* Find the last occurence of a character in string.
*
* PARAMS
* lpszStr [I] String to search in
* lpszEnd [I] Place to end search, or NULL to search until the end of lpszStr
* ch [I] Character to search for.
*
* RETURNS
* Success: A pointer to the last occurrence of ch in lpszStr before lpszEnd,
* or NULL if not found.
* Failure: NULL, if any arguments are invalid.
*/
LPSTR WINAPI StrRChrA(LPCSTR lpszStr, LPCSTR lpszEnd, WORD ch)
{
TRACE("(%s,%s,%x)\n", debugstr_a(lpszStr), debugstr_a(lpszEnd), ch);
return COMCTL32_StrRChrHelperA(lpszStr, lpszEnd, ch, COMCTL32_ChrCmpA);
}
/**************************************************************************
* StrRChrW [COMCTL32.359]
*
* See StrRChrA.
*/
LPWSTR WINAPI StrRChrW(LPCWSTR lpszStr, LPCWSTR lpszEnd, WORD ch)
{
TRACE("(%s,%s,%x)\n", debugstr_w(lpszStr), debugstr_w(lpszEnd), ch);
return COMCTL32_StrRChrHelperW(lpszStr, lpszEnd, ch, COMCTL32_ChrCmpW);
}
/**************************************************************************
* StrStrA [COMCTL32.354] * StrStrA [COMCTL32.354]
* *
* Find a substring within a string. * Find a substring within a string.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment