* Stop all timers of index func_index at this spot. * */
| 2413 | * |
| 2414 | */ |
| 2415 | void |
| 2416 | spot_stop_timers(coordxy x, coordxy y, short func_index) |
| 2417 | { |
| 2418 | timeout_proc cleanup_func; |
| 2419 | timer_element *curr, *prev, *next_timer = 0; |
| 2420 | long where = (((long) x << 16) | ((long) y)); |
| 2421 | |
| 2422 | for (prev = 0, curr = gt.timer_base; curr; curr = next_timer) { |
| 2423 | next_timer = curr->next; |
| 2424 | if (curr->kind == TIMER_LEVEL && curr->func_index == func_index |
| 2425 | && curr->arg.a_long == where) { |
| 2426 | if (prev) |
| 2427 | prev->next = curr->next; |
| 2428 | else |
| 2429 | gt.timer_base = curr->next; |
| 2430 | if ((cleanup_func = timeout_funcs[curr->func_index].cleanup) != 0) |
| 2431 | (*cleanup_func)(&curr->arg, curr->timeout); |
| 2432 | (void) memset((genericptr_t) curr, 0, sizeof(timer_element)); |
| 2433 | free((genericptr_t) curr); |
| 2434 | } else { |
| 2435 | prev = curr; |
| 2436 | } |
| 2437 | } |
| 2438 | } |
| 2439 | |
| 2440 | /* |
| 2441 | * When is the spot timer of type func_index going to expire? |
no outgoing calls
no test coverage detected