Remove use of uintptr_t

signals
Gavin Howard 4 years ago
parent 05761ed2b8
commit cecef89c3c
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 2
      README.md
  2. 2
      src/parse.c
  3. 2
      src/program.c

@ -25,8 +25,6 @@ This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD
This `bc` only requires a C99-compatible compiler and a (mostly) POSIX
2008-compatible system with the XSI (X/Open System Interfaces) option group.
Be aware that this `bc` requires some items in C99 that are considered optional,
such as `uintptr_t`.
Since POSIX 2008 with XSI requires the existence of a C99 compiler as `c99`, any
POSIX and XSI-compatible system will have everything needed.

@ -81,7 +81,7 @@ void bc_parse_number(BcParse *p) {
size_t idx = SIZE_MAX;
if (exp) {
idx = ((uintptr_t) exp) - ((uintptr_t) p->l.str.v);
idx = ((size_t) (exp - p->l.str.v));
*exp = 0;
}
#endif // BC_ENABLE_EXTRA_MATH

@ -112,7 +112,7 @@ static char* bc_program_name(const char *restrict code, size_t *restrict bgn) {
assert(ptr);
s = bc_vm_malloc(((uintptr_t) ptr) - ((uintptr_t) str) + 1);
s = bc_vm_malloc(((size_t) (ptr - str)) + 1);
for (i = 0; (c = (uchar) code[(*bgn)++]) && c != BC_PARSE_STREND; ++i)
s[i] = (char) c;

Loading…
Cancel
Save