diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /protocols/AimOscar/src/links.cpp | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
less TCHARs:
- TCHAR is replaced with wchar_t everywhere;
- LPGENT replaced with either LPGENW or LPGEN;
- fixes for ANSI plugins that improperly used _t functions;
- TCHAR *t removed from MAllStrings;
- ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz*
git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src/links.cpp')
-rw-r--r-- | protocols/AimOscar/src/links.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/protocols/AimOscar/src/links.cpp b/protocols/AimOscar/src/links.cpp index 25ae226baa..ea50d67c58 100644 --- a/protocols/AimOscar/src/links.cpp +++ b/protocols/AimOscar/src/links.cpp @@ -22,7 +22,7 @@ static HANDLE hServiceParseLink; extern OBJLIST<CAimProto> g_Instances;
-static int SingleHexToDecimal(TCHAR c)
+static int SingleHexToDecimal(wchar_t c)
{
if (c >= '0' && c <= '9') return c - '0';
if (c >= 'a' && c <= 'f') return c - 'a' + 10;
@@ -30,9 +30,9 @@ static int SingleHexToDecimal(TCHAR c) return -1;
}
-static TCHAR* url_decode(TCHAR* str)
+static wchar_t* url_decode(wchar_t* str)
{
- TCHAR* s = str, *d = str;
+ wchar_t* s = str, *d = str;
while (*s) {
if (*s == '%') {
@@ -41,7 +41,7 @@ static TCHAR* url_decode(TCHAR* str) int digit2 = SingleHexToDecimal(s[2]);
if (digit2 != -1) {
s += 3;
- *d++ = (TCHAR)((digit1 << 4) | digit2);
+ *d++ = (wchar_t)((digit1 << 4) | digit2);
continue;
}
}
@@ -57,15 +57,15 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam) {
if (lParam == 0) return 1; /* sanity check */
- TCHAR *arg = (TCHAR*)lParam;
+ wchar_t *arg = (wchar_t*)lParam;
/* skip leading prefix */
- arg = _tcschr(arg, ':');
+ arg = wcschr(arg, ':');
if (arg == NULL) return 1; /* parse failed */
for (++arg; *arg == '/'; ++arg);
- arg = NEWTSTR_ALLOCA(arg);
+ arg = NEWWSTR_ALLOCA(arg);
if (g_Instances.getCount() == 0) return 0;
@@ -84,16 +84,16 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam) open chatroom: aim:gochat?roomname=ROOM&exchange=NUM
*/
/* add a contact to the list */
- if (!_tcsnicmp(arg, L"addbuddy?", 9)) {
- TCHAR *tok, *tok2;
+ if (!wcsnicmp(arg, L"addbuddy?", 9)) {
+ wchar_t *tok, *tok2;
char *sn = NULL, *group = NULL;
for (tok = arg + 8; tok != NULL; tok = tok2) {
- tok2 = _tcschr(++tok, '&'); /* first token */
+ tok2 = wcschr(++tok, '&'); /* first token */
if (tok2) *tok2 = 0;
- if (!_tcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
+ if (!wcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
sn = mir_t2a(url_decode(tok + 11));
- if (!_tcsnicmp(tok, L"groupname=", 10) && *(tok + 10) != 0)
+ if (!wcsnicmp(tok, L"groupname=", 10) && *(tok + 10) != 0)
group = mir_utf8encodeT(url_decode(tok + 10)); /* group is currently ignored */
}
if (sn == NULL) {
@@ -111,16 +111,16 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam) return 0;
}
/* send a message to a contact */
- else if (!_tcsnicmp(arg, L"goim?", 5)) {
- TCHAR *tok, *tok2, *msg = NULL;
+ else if (!wcsnicmp(arg, L"goim?", 5)) {
+ wchar_t *tok, *tok2, *msg = NULL;
char *sn = NULL;
for (tok = arg + 4; tok != NULL; tok = tok2) {
- tok2 = _tcschr(++tok, '&'); /* first token */
+ tok2 = wcschr(++tok, '&'); /* first token */
if (tok2) *tok2 = 0;
- if (!_tcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
+ if (!wcsnicmp(tok, L"screenname=", 11) && *(tok + 11) != 0)
sn = mir_t2a(url_decode(tok + 11));
- if (!_tcsnicmp(tok, L"message=", 8) && *(tok + 8) != 0)
+ if (!wcsnicmp(tok, L"message=", 8) && *(tok + 8) != 0)
msg = url_decode(tok + 8);
}
if (sn == NULL) return 1; /* parse failed */
@@ -134,21 +134,21 @@ static INT_PTR ServiceParseAimLink(WPARAM, LPARAM lParam) }
/* open a chatroom */
- else if (!_tcsnicmp(arg, L"gochat?", 7)) {
- TCHAR *tok, *tok2;
+ else if (!wcsnicmp(arg, L"gochat?", 7)) {
+ wchar_t *tok, *tok2;
char *rm = NULL;
int exchange = 0;
for (tok = arg + 6; tok != NULL; tok = tok2) {
- tok2 = _tcschr(++tok, '&'); /* first token */
+ tok2 = wcschr(++tok, '&'); /* first token */
if (tok2) *tok2 = 0;
- if (!_tcsnicmp(tok, L"roomname=", 9) && *(tok + 9) != 0) {
+ if (!wcsnicmp(tok, L"roomname=", 9) && *(tok + 9) != 0) {
rm = mir_t2a(url_decode(tok + 9));
for (char *ch = rm; *ch; ++ch)
if (*ch == '+') *ch = ' ';
}
- if (!_tcsnicmp(tok, L"exchange=", 9))
- exchange = _ttoi(tok + 9);
+ if (!wcsnicmp(tok, L"exchange=", 9))
+ exchange = _wtoi(tok + 9);
}
if (rm == NULL || exchange <= 0) {
mir_free(rm);
|