diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2025-12-12 23:24:51 +0100 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2025-12-12 23:24:51 +0100 |
| commit | 17c792cf4ea3d4ff83ba765de98a448ccd03ba9e (patch) | |
| tree | 11c446a14d941f1c97cf195417d4f16929708eed /cbits | |
| parent | 6de015d8f2a82d5264804f3862892393c0d8d38d (diff) | |
Make arith enums disjoint
This should prevent operation confusion like calling oxarop_binary_*
with IB_QUOT. No error is thrown statically, but at least the nonsense
operation crashes reliably at runtime instead of doing, well, nonsense.
Diffstat (limited to 'cbits')
| -rw-r--r-- | cbits/arith_lists.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/cbits/arith_lists.h b/cbits/arith_lists.h index 432765c..dc9ad1a 100644 --- a/cbits/arith_lists.h +++ b/cbits/arith_lists.h @@ -2,38 +2,38 @@ LIST_BINOP(BO_ADD, 1, +) LIST_BINOP(BO_SUB, 2, -) LIST_BINOP(BO_MUL, 3, *) -LIST_IBINOP(IB_QUOT, 1, quot) -LIST_IBINOP(IB_REM, 2, rem) +LIST_IBINOP(IB_QUOT, 11, quot) +LIST_IBINOP(IB_REM, 12, rem) -LIST_FBINOP(FB_DIV, 1, /) -LIST_FBINOP(FB_POW, 2, **) -LIST_FBINOP(FB_LOGBASE, 3, logBase) -LIST_FBINOP(FB_ATAN2, 4, atan2) +LIST_FBINOP(FB_DIV, 21, /) +LIST_FBINOP(FB_POW, 22, **) +LIST_FBINOP(FB_LOGBASE, 23, logBase) +LIST_FBINOP(FB_ATAN2, 24, atan2) -LIST_UNOP(UO_NEG, 1,) -LIST_UNOP(UO_ABS, 2,) -LIST_UNOP(UO_SIGNUM, 3,) +LIST_UNOP(UO_NEG, 31,) +LIST_UNOP(UO_ABS, 32,) +LIST_UNOP(UO_SIGNUM, 33,) -LIST_FUNOP(FU_RECIP, 1,) -LIST_FUNOP(FU_EXP, 2,) -LIST_FUNOP(FU_LOG, 3,) -LIST_FUNOP(FU_SQRT, 4,) -LIST_FUNOP(FU_SIN, 5,) -LIST_FUNOP(FU_COS, 6,) -LIST_FUNOP(FU_TAN, 7,) -LIST_FUNOP(FU_ASIN, 8,) -LIST_FUNOP(FU_ACOS, 9,) -LIST_FUNOP(FU_ATAN, 10,) -LIST_FUNOP(FU_SINH, 11,) -LIST_FUNOP(FU_COSH, 12,) -LIST_FUNOP(FU_TANH, 13,) -LIST_FUNOP(FU_ASINH, 14,) -LIST_FUNOP(FU_ACOSH, 15,) -LIST_FUNOP(FU_ATANH, 16,) -LIST_FUNOP(FU_LOG1P, 17,) -LIST_FUNOP(FU_EXPM1, 18,) -LIST_FUNOP(FU_LOG1PEXP, 19,) -LIST_FUNOP(FU_LOG1MEXP, 20,) +LIST_FUNOP(FU_RECIP, 41,) +LIST_FUNOP(FU_EXP, 42,) +LIST_FUNOP(FU_LOG, 43,) +LIST_FUNOP(FU_SQRT, 44,) +LIST_FUNOP(FU_SIN, 45,) +LIST_FUNOP(FU_COS, 46,) +LIST_FUNOP(FU_TAN, 47,) +LIST_FUNOP(FU_ASIN, 48,) +LIST_FUNOP(FU_ACOS, 49,) +LIST_FUNOP(FU_ATAN, 50,) +LIST_FUNOP(FU_SINH, 51,) +LIST_FUNOP(FU_COSH, 52,) +LIST_FUNOP(FU_TANH, 53,) +LIST_FUNOP(FU_ASINH, 54,) +LIST_FUNOP(FU_ACOSH, 55,) +LIST_FUNOP(FU_ATANH, 56,) +LIST_FUNOP(FU_LOG1P, 57,) +LIST_FUNOP(FU_EXPM1, 58,) +LIST_FUNOP(FU_LOG1PEXP, 59,) +LIST_FUNOP(FU_LOG1MEXP, 60,) -LIST_REDOP(RO_SUM, 1,) -LIST_REDOP(RO_PRODUCT, 2,) +LIST_REDOP(RO_SUM, 81,) +LIST_REDOP(RO_PRODUCT, 82,) |
