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 /plugins/Spamotron/src/spamotron.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 'plugins/Spamotron/src/spamotron.cpp')
-rw-r--r-- | plugins/Spamotron/src/spamotron.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index dceac13a6e..a96cc0551b 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -42,10 +42,10 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) char *msgblob;
char protoOption[256] = {0};
int buflen = MAX_BUFFER_LENGTH;
- TCHAR buf[MAX_BUFFER_LENGTH];
- TCHAR *message = NULL, *challengeW = NULL, *tmpW = NULL;
- TCHAR *whitelist = NULL, *ptok;
- TCHAR mexpr[64];
+ wchar_t buf[MAX_BUFFER_LENGTH];
+ wchar_t *message = NULL, *challengeW = NULL, *tmpW = NULL;
+ wchar_t *whitelist = NULL, *ptok;
+ wchar_t mexpr[64];
int maxmsglen = 0, a, b, i;
BOOL bayesEnabled = _getOptB("BayesEnabled", defaultBayesEnabled);
BOOL bCorrectResponse = FALSE;
@@ -132,20 +132,20 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) /*** Check for words in white-list ***/
if (_getOptB("ApproveOnMsgIn", defaultApproveOnMsgIn)) {
- whitelist = (TCHAR*)malloc(2048 * sizeof(TCHAR));
+ whitelist = (wchar_t*)malloc(2048 * sizeof(wchar_t));
if (whitelist != NULL) {
_getOptS(whitelist, 2048, "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist);
if (_isregex(whitelist)) {
if (_regmatch(message, whitelist))
bCorrectResponse = TRUE;
} else {
- ptok = _tcstok(whitelist, L" ");
+ ptok = wcstok(whitelist, L" ");
while (ptok != NULL) {
- if (_tcsstr(message, ptok)) {
+ if (wcsstr(message, ptok)) {
bCorrectResponse = TRUE;
break;
}
- ptok = _tcstok(NULL, L" ");
+ ptok = wcstok(NULL, L" ");
}
}
free(whitelist);
@@ -207,8 +207,8 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) case SPAMOTRON_MODE_MATH:
if (message == NULL)
break;
- _itot(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
- if (_tcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
+ _itow(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
+ if (wcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
bCorrectResponse = TRUE;
}
break;
@@ -232,7 +232,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) // Resubmit pending authorization request
if (_getCOptB(hContact, "AuthEventPending", FALSE)) {
DBVARIANT _dbv;
- TCHAR AuthEventModule[100];
+ wchar_t AuthEventModule[100];
char* szAuthEventModule;
if (db_get(hContact, PLUGIN_NAME, "AuthEvent", &_dbv) == 0) {
DBEVENTINFO *_dbei = (DBEVENTINFO *)malloc(sizeof(DBEVENTINFO));
@@ -344,8 +344,8 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) /*** Send Challenge ***/
- challengeW = (TCHAR *)malloc(maxmsglen*sizeof(TCHAR));
- tmpW = (TCHAR *)malloc(maxmsglen*sizeof(TCHAR));
+ challengeW = (wchar_t *)malloc(maxmsglen*sizeof(wchar_t));
+ tmpW = (wchar_t *)malloc(maxmsglen*sizeof(wchar_t));
switch (_getOptB("Mode", defaultMode)) {
case SPAMOTRON_MODE_PLAIN:
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
|