summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-08-15 13:06:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-08-15 13:06:48 +0300
commitee57c7fe7f30f82a2a2c637125ce3ee31d008576 (patch)
tree5305652292e7639e2f42b770c9f112fc31265ad8 /src/mir_core
parent23a26c75b274fcc6ebf3ae69a857cffa2b84fa52 (diff)
Windows string types removed from m_core.h
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/cmdline.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mir_core/src/cmdline.cpp b/src/mir_core/src/cmdline.cpp
index 2acfac2185..1f1616c81c 100644
--- a/src/mir_core/src/cmdline.cpp
+++ b/src/mir_core/src/cmdline.cpp
@@ -27,11 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct CmdLineParam
{
- __inline CmdLineParam(LPCTSTR _name, LPCTSTR _value) :
+ __inline CmdLineParam(const wchar_t *_name, const wchar_t *_value) :
name(_name), value(_value)
{}
- LPCTSTR name, value;
+ const wchar_t *name, *value;
};
static int CompareParams(const CmdLineParam *p1, const CmdLineParam *p2)
@@ -41,11 +41,11 @@ static int CompareParams(const CmdLineParam *p1, const CmdLineParam *p2)
static OBJLIST<CmdLineParam> arParams(5, CompareParams);
-MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine)
+MIR_CORE_DLL(void) CmdLine_Parse(const wchar_t *ptszCmdLine)
{
bool bPrevSpace = true;
- for (LPTSTR p = ptszCmdLine; *p; p++) {
- if ( *p == ' ' || *p == '\t') {
+ for (wchar_t *p = NEWWSTR_ALLOCA(ptszCmdLine); *p; p++) {
+ if (*p == ' ' || *p == '\t') {
*p = 0;
bPrevSpace = true;
continue;
@@ -59,12 +59,12 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine)
}
else continue; // skip a text that isn't an option
- wchar_t *pOptionName = p+1;
+ wchar_t *pOptionName = p + 1;
if ((p = wcspbrk(pOptionName, L" \t=:")) == nullptr) { // no more text in string
arParams.insert(new CmdLineParam(pOptionName, L""));
break;
}
-
+
if (*p == ' ' || *p == '\t') {
arParams.insert(new CmdLineParam(pOptionName, L""));
p--; // the cycle will wipe this space automatically
@@ -81,7 +81,7 @@ MIR_CORE_DLL(void) CmdLine_Parse(LPTSTR ptszCmdLine)
}
}
-MIR_CORE_DLL(LPCTSTR) CmdLine_GetOption(const wchar_t* ptszParameter)
+MIR_CORE_DLL(const wchar_t*) CmdLine_GetOption(const wchar_t* ptszParameter)
{
CmdLineParam tmp(ptszParameter, nullptr);
int idx = arParams.getIndex(&tmp);