diff options
| author | xHire <xhire@tuxportal.cz> | 2009-05-26 00:44:42 +0200 |
|---|---|---|
| committer | xHire <xhire@tuxportal.cz> | 2009-05-26 01:12:04 +0200 |
| commit | 409083e69d4bb9d8b1eb492b3474c86e093f2de8 (patch) | |
| tree | 741e3214c07578cde88e700895f203706284017c /src/base/protect.c | |
| parent | b992c007c186fddf31f67a7ed0bd5789cfb9b85e (diff) | |
Rewritten messages/comments in code of base
Rectified the coding style in code of base
Diffstat (limited to 'src/base/protect.c')
| -rw-r--r-- | src/base/protect.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/base/protect.c b/src/base/protect.c index a384734..754fa26 100644 --- a/src/base/protect.c +++ b/src/base/protect.c @@ -1,4 +1,3 @@ - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -22,7 +21,7 @@ protect_t *newProtect() return new; } -void refreshLastMove(protect_t * p) +void refreshLastMove(protect_t *p) { my_time_t currentTime; my_time_t interval; @@ -40,26 +39,32 @@ void refreshLastMove(protect_t * p) my_index = p->avarage / PROTECT_SPEED_AVARAGE; p->avarage = 0; p->count = 0; -#if 0 + +/* if (my_index < PROTECT_SPEED_INTERVAL_TIMEOUT) { p->isDown = TRUE; } -#endif - //printf("speed index = %d\n", my_index); +*/ + + /*printf("speed index = %d\n", my_index);*/ } } -void rereshLastPing(protect_t * p) +void rereshLastPing(protect_t *p) { - //my_time_t currentTime; - //my_time_t interval; - //currentTime = timer_get_current_time(); - //interval = currentTime - p->lastPing; + /* + my_time_t currentTime; + my_time_t interval; + currentTime = timer_get_current_time(); + interval = currentTime - p->lastPing; + */ + p->lastPing = timer_get_current_time(); - //printf("interval = %d\n", interval); + + /*printf("interval = %d\n", interval);*/ } -bool_t isDown(protect_t * p) +bool_t isDown(protect_t *p) { my_time_t currentTime; my_time_t interval; @@ -67,13 +72,14 @@ bool_t isDown(protect_t * p) currentTime = timer_get_current_time(); interval = currentTime - p->lastPing; - if (interval > PROTECT_PING_INTERVAL_TIMEOUT) + if (interval > PROTECT_PING_INTERVAL_TIMEOUT) { p->isDown = TRUE; + } return p->isDown; } -void destroyProtect(protect_t * p) +void destroyProtect(protect_t *p) { assert(p != NULL); free(p); |