X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftoken.h;h=68b806245d5e9f6404c9ad067cf85449b2754e9b;hb=1a933570580a0337ce75baf8bdac4229e6fbbb2b;hp=fcf3f4e49f5b3ced600063831438944539db3cb3;hpb=2f5af21b263403997e154658635d6b6e6eaab453;p=m6w6%2Fext-psi diff --git a/src/token.h b/src/token.h index fcf3f4e..68b8062 100644 --- a/src/token.h +++ b/src/token.h @@ -94,13 +94,14 @@ static inline size_t psi_t_size(token_t t) return SIZEOF_FLOAT; case PSI_T_DOUBLE: return SIZEOF_DOUBLE; + case PSI_T_VOID: case PSI_T_POINTER: case PSI_T_FUNCTION: return SIZEOF_VOID_P; case PSI_T_ENUM: return SIZEOF_INT; default: - assert(0); + assert(!t); } return 0; } @@ -108,12 +109,12 @@ static inline size_t psi_t_size(token_t t) static inline const char *psi_t_indent(unsigned level) { static const char indent[] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; - return &indent[32 - MAX(0, MIN(32, level))]; + return &indent[32 - MIN(32, level)]; } static inline const char *psi_t_indirection(unsigned pointer_level) { static const char indir[] = "********************************"; - return &indir[32 - MAX(0, MIN(32, pointer_level))]; + return &indir[32 - MIN(32, pointer_level)]; } struct psi_token {