diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-03 16:02:14 +0200 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-03 16:02:14 +0200 |
commit | 3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a (patch) | |
tree | 412a28ef6a572efc7039df1c363bf47a3dec4b19 /plugins/Spamotron/src | |
parent | 9a6f750a482d1d1ebf4281bb7bf8133e547ad438 (diff) |
mir_forkThread<typename> - stronger typizatioin for thread function parameter
Diffstat (limited to 'plugins/Spamotron/src')
-rw-r--r-- | plugins/Spamotron/src/bayes.cpp | 2 | ||||
-rw-r--r-- | plugins/Spamotron/src/spamotron.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp index dc4d23e635..c4fde0f693 100644 --- a/plugins/Spamotron/src/bayes.cpp +++ b/plugins/Spamotron/src/bayes.cpp @@ -276,7 +276,7 @@ void bayes_approve_contact(MCONTACT hContact) void dequeue_messages()
{
- time_t t = time(nullptr);
+ time_t t = time(0);
sqlite3_stmt *stmt;
const char *message;
wchar_t *messageW;
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index 0a628931f2..f23b7861e9 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -57,9 +57,9 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) /*** Dequeue and learn messages ***/
if (bayesEnabled && _getOptB("BayesAutolearnNotApproved", defaultBayesAutolearnNotApproved))
- if (time(nullptr) - last_queue_check > 4*3600) { // dequeue every 4 hours
+ if (time(0) - last_queue_check > 4*3600) { // dequeue every 4 hours
dequeue_messages();
- last_queue_check = time(nullptr);
+ last_queue_check = time(0);
}
/*** Check for conditional and unconditional approval ***/
@@ -375,7 +375,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) else
_getOptS(challengeW, maxmsglen, "Challenge", defaultChallenge);
_getOptS(buf, buflen, "Response", defaultResponse);
- srand(time(nullptr));
+ srand(time(0));
_setCOptD(hContact, "ResponseNum", rand() % get_response_num(buf));
ReplaceVarsNum(challengeW, maxmsglen, _getCOptD(hContact, "ResponseNum", 0));
ProtoChainSend(hContact, PSS_MESSAGE, 0, T2Utf(challengeW));
@@ -507,14 +507,14 @@ extern "C" __declspec(dllexport) int Load() {
mir_getLP(&pluginInfo);
- srand((unsigned)time(nullptr));
+ srand((unsigned)time(0));
bayesdb = nullptr;
if (_getOptB("BayesEnabled", defaultBayesEnabled)) {
if (CheckBayes()) {
OpenBayes();
if (_getOptB("BayesAutolearnNotApproved", defaultBayesAutolearnNotApproved)) {
dequeue_messages();
- last_queue_check = time(nullptr);
+ last_queue_check = time(0);
}
}
}
|