Ignore:
Timestamp:
Aug 30, 2018, 10:26:27 PM (3 years ago)
Author:
viala@…
Message:

Rewrite if-then-else return function into switch case.

For safety reason and performance:

1) Safety: GCC complain with a warning if you forgot an enum variant.
2) code-gen just outperform naive if-then-else.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/process.h

    r503 r527  
    5656 ********************************************************************************************/
    5757
    58 enum process_sigactions
     58typedef enum process_sigactions
    5959{
    6060    BLOCK_ALL_THREADS    = 0x11,
    6161    UNBLOCK_ALL_THREADS  = 0x22,
    6262    DELETE_ALL_THREADS   = 0x33,
    63 };
     63} process_sigactions_t;
    6464
    6565/*********************************************************************************************
     
    275275 * @ return a string pointer.
    276276 ********************************************************************************************/
    277 char * process_action_str( uint32_t sigaction_type );
     277const char * process_action_str( process_sigactions_t sigaction_type );
    278278
    279279/*********************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.