Changeset 1647


Ignore:
Timestamp:
02/06/12 03:29:30 (2 years ago)
Author:
reyalp
Message:

cosmetic cleanup in action_stack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/action_stack.c

    r1602 r1647  
    5252     
    5353    action_stack_t* stack = tmp[num_stacks]; 
    54     stack->action_process = proc_func; 
     54    if(proc_func) { 
     55        stack->action_process = proc_func; 
     56    } else { 
     57        stack->action_process = action_stack_standard; 
     58    } 
     59 
    5560    stack->stack_ptr = 0; 
    5661    stack->comp_id = task_comp_id; 
     
    184189    { 
    185190        /* setup timer */ 
    186         long action = action_get_prev(p); 
    187         /* delay of -1 signals indefinite (actually 1 day) delay*/  
    188         action_stacks[active_stack]->delay_target_ticks = t+((action == -1)?86400000:action); 
     191        long delay = action_get_prev(p); 
     192        /* delay of -1 signals indefinite (actually 1 day) delay*/ 
     193        if(delay == -1) { 
     194            delay = 86400000; 
     195        } 
     196        action_stacks[active_stack]->delay_target_ticks = t+delay; 
    189197        return 0; 
    190198    } 
     
    204212// Can only be called from an action stack 
    205213int action_stack_standard(long p) 
    206 {         
    207     long t; 
    208      
     214{ 
    209215    switch (p) 
    210216    { 
     
    275281    if (stack->stack_ptr > -1) 
    276282    { 
    277         long stack_arg = action_get_prev(1); 
    278         if (stack->action_process) 
    279             stack->action_process(stack_arg); 
    280         else 
    281             action_stack_standard(stack_arg); 
     283        stack->action_process(action_get_prev(1)); 
    282284    } 
    283285    else 
     
    289291void action_stack_process_all() 
    290292{ 
    291     int i; 
    292     for (i = num_stacks - 1; i >= 0; --i) 
    293     { 
    294         active_stack = i; 
    295         action_stack_process(i); 
    296     } 
    297      
     293    for (active_stack = num_stacks - 1; active_stack >= 0; --active_stack) 
     294    { 
     295        action_stack_process(active_stack); 
     296    } 
     297 
    298298    active_stack = -1; 
    299299} 
Note: See TracChangeset for help on using the changeset viewer.