From 1006496256ea36d8b1ba22739db6a70987f1987e Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Mon, 16 Mar 2020 12:38:02 +0200 Subject: [PATCH] Use uint32_t instead of u_int32_t --- tiny/eval1 | 2 +- tiny/eval2 | 2 +- tiny/evalt | 2 +- tiny/flutils.c | 22 +++++++++++----------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tiny/eval1 b/tiny/eval1 index d7140c2..31d4fdf 100644 --- a/tiny/eval1 +++ b/tiny/eval1 @@ -4,7 +4,7 @@ value_t eval_sexpr(value_t e, value_t *penv) value_t *rest; cons_t *c; symbol_t *sym; - u_int32_t saveSP; + uint32_t saveSP; int i, nargs, noeval=0; number_t s, n; diff --git a/tiny/eval2 b/tiny/eval2 index c663a8c..bc68a37 100644 --- a/tiny/eval2 +++ b/tiny/eval2 @@ -4,7 +4,7 @@ value_t eval_sexpr(value_t e, value_t *penv) value_t *rest; cons_t *c; symbol_t *sym; - u_int32_t saveSP; + uint32_t saveSP; int i, nargs, noeval=0; number_t s, n; diff --git a/tiny/evalt b/tiny/evalt index 776ddaa..acd0a5e 100644 --- a/tiny/evalt +++ b/tiny/evalt @@ -4,7 +4,7 @@ value_t eval_sexpr(value_t e, value_t *penv) value_t *rest; cons_t *c; symbol_t *sym; - u_int32_t saveSP; + uint32_t saveSP; int i, nargs, noeval=0; number_t s, n; diff --git a/tiny/flutils.c b/tiny/flutils.c index 7cd4023..f32b99c 100644 --- a/tiny/flutils.c +++ b/tiny/flutils.c @@ -1,6 +1,6 @@ -u_int32_t *bitvector_resize(u_int32_t *b, size_t n) +uint32_t *bitvector_resize(uint32_t *b, size_t n) { - u_int32_t *p; + uint32_t *p; size_t sz = ((n+31)>>5) * 4; p = realloc(b, sz); if (p == NULL) return NULL; @@ -8,12 +8,12 @@ u_int32_t *bitvector_resize(u_int32_t *b, size_t n) return p; } -u_int32_t *mk_bitvector(size_t n) +uint32_t *mk_bitvector(size_t n) { return bitvector_resize(NULL, n); } -void bitvector_set(u_int32_t *b, u_int32_t n, u_int32_t c) +void bitvector_set(uint32_t *b, uint32_t n, uint32_t c) { if (c) b[n>>5] |= (1<<(n&31)); @@ -21,7 +21,7 @@ void bitvector_set(u_int32_t *b, u_int32_t n, u_int32_t c) b[n>>5] &= ~(1<<(n&31)); } -u_int32_t bitvector_get(u_int32_t *b, u_int32_t n) +uint32_t bitvector_get(uint32_t *b, uint32_t n) { return b[n>>5] & (1<<(n&31)); } @@ -73,7 +73,7 @@ void ltable_adjoin(ltable_t *t, unsigned long item) ltable_insert(t, item); } -static const u_int32_t offsetsFromUTF8[6] = { +static const uint32_t offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; @@ -94,24 +94,24 @@ int u8_seqlen(const char c) return trailingBytesForUTF8[(unsigned int)(unsigned char)c] + 1; } -#define UEOF ((u_int32_t)EOF) +#define UEOF ((uint32_t)EOF) -u_int32_t u8_fgetc(FILE *f) +uint32_t u8_fgetc(FILE *f) { int amt=0, sz, c; - u_int32_t ch=0; + uint32_t ch=0; c = fgetc(f); if (c == EOF) return UEOF; - ch = (u_int32_t)c; + ch = (uint32_t)c; amt = sz = u8_seqlen(ch); while (--amt) { ch <<= 6; c = fgetc(f); if (c == EOF) return UEOF; - ch += (u_int32_t)c; + ch += (uint32_t)c; } ch -= offsetsFromUTF8[sz-1];