No description
- C 96.5%
- Makefile 3.5%
Unsigned to signed cast is implementation defined (though in practice it has the expected 2's complement semantics on essentially every relevant platform). However, the only reason we used one in the first place was to take advantage of arithmetic right shift broadcasting the sign bit to the full length of a 32-bit integer. This requires right shift of negative numbers to be defined as arithmetic – in C it is instead UB. The remaining unsigned-to-unsigned casts would have been all defined, but it is easier to keep the codebase UB-free by just banning all direct casts. Since we do want to convert between 32-bit and 64-bit integers, introduce meri_casts.h as a way to make the intent clear and warn on any extra unintended implicit casts at the callsite. |
||
|---|---|---|
| .gitignore | ||
| Makefile | ||
| Makefile.common | ||
| Makefile.win | ||
| meri_bigint.c | ||
| meri_bigint.h | ||
| meri_casts.h | ||
| meri_object.c | ||
| meri_object.h | ||
| test_bigint.c | ||
| tests.c | ||
| tests.h | ||