Commit Graph

13 Commits

Author SHA1 Message Date
Jan (janneke) Nieuwenhuizen b601eb64af
mescc: Mes C Library: ntoab: Use unsigned base.
This fixes 60-math, 60-math-itoa, 70-printf-simple, 70-printf.

* lib/mes/ntoab.c (ntoab): Use unsigned base.
* include/mes/lib.h: Update prototype.
2020-12-13 22:19:06 +01:00
Danny Milosavljevic 821d1b8fe9
ntoab: Simplify LONG_MIN case.
* lib/mes/ntoab.c (ntoab): Simplify LONG_MIN case.

Co-Authored-By: Nathalie Kopaczewski <natkopa@gmail.com>
2020-06-17 00:21:57 +02:00
Danny Milosavljevic b11510f4da
ntoab: Handle LONG_MIN case.
* lib/mes/ntoab.c (ntoab): Handle LONG_MIN case.
* lib/tests/scaffold/60-math.c (main): Add test for INT_MIN and hex.
2020-06-15 11:26:43 +02:00
Danny Milosavljevic b0347bf53d
ntoab: Make sure not to get stuck on base 1.
* lib/mes/ntoab.c (ntoab): Make sure not to get stuck on base 1.
2020-06-03 20:56:51 +02:00
Jan Nieuwenhuizen 49aff4ec1c
ntoab: Use __mesabi_uldiv only for arm.
* lib/mes/ntoab.c (ntoab)[__MESC__ && __arm__]: Use __mesabi_uldiv.
* build-aux/check-mescc.sh (XFAIL_TESTS): 70-printf-simple.c and
70-printf.c now pass for x86_64 mescc.
2019-09-09 16:04:13 +02:00
Danny Milosavljevic 08774a9c74
Fix ntoab.
Follow-up to b5b19304b59fefbed923b146ec8c8d495556fa76.

* lib/mes/ntoab.c (ntoab): Fix non-MESC case.
2019-07-01 20:04:26 +02:00
Danny Milosavljevic 9b0efad295
ntoab: Use __mesabi_uldiv only on __MESC__.
* lib/mes/ntoab.c (ntoab): Use __mesabi_uldiv only on __MESC__.
2019-06-14 17:45:32 +02:00
Danny Milosavljevic a63b0bae44
ntoab: Include "assert.h".
* lib/mes/ntoab.c: #include "assert.h".
2019-06-14 01:27:15 +02:00
Danny Milosavljevic c35124ab54
mescc: Mes C Library: Use __mesabi_uldiv.
* lib/mes/ntoab.c (ntoab): Use __mesabi_uldiv.
2019-06-14 01:02:40 +02:00
Jan Nieuwenhuizen c33d6d00bc
mes: Run build-aux/indent.sh.
* src/mes.c: Re-indent.
* src: Likewise.
* include: Likewise.
* lib: Likewise.
* scaffold: Likewise.
2019-05-18 13:27:42 +02:00
Jan Nieuwenhuizen 3ed82d7010
mescc: Mes C Library: Cleanup includes.
* include/mes/lib-mini.h: Move from include/libmes-mini.h.  Update users.
* include/mes/lib.h: Move from include/libmes.h.  Update users.
2019-05-08 00:25:41 +02:00
Jan Nieuwenhuizen 66019c8421
mescc: Mes C Library: Fix compile warnings.
* include/libmes.h (dtoab, itoa, ltoa, ntoab, ultoa, utoa): Return
char* (WAS: char const*).
* lib/*/*c: Update, add missing includes.
2019-03-03 10:04:33 +01:00
Jan Nieuwenhuizen a08baf2d48
mescc: Mes C Library: Explode libmes.c.
* include/libmes.h: Add declarations.
* lib/abtol.c: New file, explode from lib/libmes.c.
* lib/ctype/isdigit.c: Likewise.
* lib/ctype/isnumber.c: Likewise.
* lib/ctype/isspace.c: Likewise.
* lib/ctype/isxdigit.c: Likewise.
* lib/mes/abtol.c: Likewise.
* lib/mes/eputc.c: Likewise.
* lib/mes/eputs.c: Likewise.
* lib/mes/fdgetc.c: Likewise.
* lib/mes/fdputc.c: Likewise.
* lib/mes/fdputs.c: Likewise.
* lib/mes/fdungetc.c: Likewise.
* lib/mes/itoa.c: Likewise.
* lib/mes/ltoab.c: Likewise.
* lib/mes/ntoab.c: Likewise.
* lib/mes/utoa.c: Likewise.
* lib/stdlib/atoi.c: Likewise.
* lib/libmes.c: Include explodings.
2018-08-16 11:43:27 +02:00