diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2018-01-08 22:48:19 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2018-01-19 01:39:33 +0100 |
commit | db084380729ecb18021aa0a5b3074c1faffb18c1 (patch) | |
tree | 91c49c311598f0abc294f4dfb8c7ea625f2085d6 /protocols/Gadu-Gadu/src/keepalive.cpp | |
parent | 44a8248b1b19375130144a783d1758e1f83d3c88 (diff) |
Gadu-Gadu: code cleaning
Diffstat (limited to 'protocols/Gadu-Gadu/src/keepalive.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/keepalive.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/protocols/Gadu-Gadu/src/keepalive.cpp b/protocols/Gadu-Gadu/src/keepalive.cpp index 426f72d0f0..ef937e06b3 100644 --- a/protocols/Gadu-Gadu/src/keepalive.cpp +++ b/protocols/Gadu-Gadu/src/keepalive.cpp @@ -21,17 +21,17 @@ #include "gg.h"
/* NOTE: Eventhough SetTimer seems to support UINT_PTR for idEvent, it seems that TimerProc
- * does not get full pointer but just 2 byte lower bytes.
- */
+* does not get full pointer but just 2 byte lower bytes.
+*/
#define MAX_TIMERS 8
-GGPROTO *g_timers[MAX_TIMERS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
+GGPROTO *g_timers[MAX_TIMERS] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
static VOID CALLBACK gg_keepalive(HWND, UINT, UINT_PTR idEvent, DWORD)
{
int i;
-
+
//Search for GGPROTO* context
- for(i = 0; i < MAX_TIMERS; i++)
+ for (i = 0; i < MAX_TIMERS; i++)
if (g_timers[i]->timer == idEvent)
break;
@@ -40,9 +40,9 @@ static VOID CALLBACK gg_keepalive(HWND, UINT, UINT_PTR idEvent, DWORD) GGPROTO *gg = g_timers[i];
if (gg->isonline())
{
- #ifdef DEBUGMODE
+#ifdef DEBUGMODE
gg->debugLogA("gg_keepalive(): Sending keep-alive");
- #endif
+#endif
gg->gg_EnterCriticalSection(&gg->sess_mutex, "gg_keepalive", 68, "sess_mutex", 1);
gg_ping(gg->sess);
gg->gg_LeaveCriticalSection(&gg->sess_mutex, "gg_keepalive", 68, 1, "sess_mutex", 1);
@@ -55,12 +55,12 @@ void GGPROTO::keepalive_init() if (getByte(GG_KEY_KEEPALIVE, GG_KEYDEF_KEEPALIVE))
{
int i;
- for(i = 0; i < MAX_TIMERS && g_timers[i] != nullptr; i++);
+ for (i = 0; i < MAX_TIMERS && g_timers[i] != nullptr; i++);
if (i < MAX_TIMERS)
{
- #ifdef DEBUGMODE
+#ifdef DEBUGMODE
debugLogA("keepalive_init(): Initializing Timer %d", i);
- #endif
+#endif
timer = SetTimer(nullptr, 0, 1000 * 30, gg_keepalive);
g_timers[i] = this;
}
@@ -76,7 +76,7 @@ void GGPROTO::keepalive_destroy() {
int i;
KillTimer(nullptr, timer);
- for(i = 0; i < MAX_TIMERS; i++)
+ for (i = 0; i < MAX_TIMERS; i++)
if (g_timers[i] == this) {
g_timers[i] = nullptr;
break;
|