Use uint32_t instead of u_int32_t
This commit is contained in:
parent
2bc5c43022
commit
1006496256
|
@ -4,7 +4,7 @@ value_t eval_sexpr(value_t e, value_t *penv)
|
||||||
value_t *rest;
|
value_t *rest;
|
||||||
cons_t *c;
|
cons_t *c;
|
||||||
symbol_t *sym;
|
symbol_t *sym;
|
||||||
u_int32_t saveSP;
|
uint32_t saveSP;
|
||||||
int i, nargs, noeval=0;
|
int i, nargs, noeval=0;
|
||||||
number_t s, n;
|
number_t s, n;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ value_t eval_sexpr(value_t e, value_t *penv)
|
||||||
value_t *rest;
|
value_t *rest;
|
||||||
cons_t *c;
|
cons_t *c;
|
||||||
symbol_t *sym;
|
symbol_t *sym;
|
||||||
u_int32_t saveSP;
|
uint32_t saveSP;
|
||||||
int i, nargs, noeval=0;
|
int i, nargs, noeval=0;
|
||||||
number_t s, n;
|
number_t s, n;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ value_t eval_sexpr(value_t e, value_t *penv)
|
||||||
value_t *rest;
|
value_t *rest;
|
||||||
cons_t *c;
|
cons_t *c;
|
||||||
symbol_t *sym;
|
symbol_t *sym;
|
||||||
u_int32_t saveSP;
|
uint32_t saveSP;
|
||||||
int i, nargs, noeval=0;
|
int i, nargs, noeval=0;
|
||||||
number_t s, n;
|
number_t s, n;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
size_t sz = ((n+31)>>5) * 4;
|
||||||
p = realloc(b, sz);
|
p = realloc(b, sz);
|
||||||
if (p == NULL) return NULL;
|
if (p == NULL) return NULL;
|
||||||
|
@ -8,12 +8,12 @@ u_int32_t *bitvector_resize(u_int32_t *b, size_t n)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
u_int32_t *mk_bitvector(size_t n)
|
uint32_t *mk_bitvector(size_t n)
|
||||||
{
|
{
|
||||||
return bitvector_resize(NULL, 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)
|
if (c)
|
||||||
b[n>>5] |= (1<<(n&31));
|
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));
|
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));
|
return b[n>>5] & (1<<(n&31));
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ void ltable_adjoin(ltable_t *t, unsigned long item)
|
||||||
ltable_insert(t, item);
|
ltable_insert(t, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u_int32_t offsetsFromUTF8[6] = {
|
static const uint32_t offsetsFromUTF8[6] = {
|
||||||
0x00000000UL, 0x00003080UL, 0x000E2080UL,
|
0x00000000UL, 0x00003080UL, 0x000E2080UL,
|
||||||
0x03C82080UL, 0xFA082080UL, 0x82082080UL
|
0x03C82080UL, 0xFA082080UL, 0x82082080UL
|
||||||
};
|
};
|
||||||
|
@ -94,24 +94,24 @@ int u8_seqlen(const char c)
|
||||||
return trailingBytesForUTF8[(unsigned int)(unsigned char)c] + 1;
|
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;
|
int amt=0, sz, c;
|
||||||
u_int32_t ch=0;
|
uint32_t ch=0;
|
||||||
|
|
||||||
c = fgetc(f);
|
c = fgetc(f);
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
return UEOF;
|
return UEOF;
|
||||||
ch = (u_int32_t)c;
|
ch = (uint32_t)c;
|
||||||
amt = sz = u8_seqlen(ch);
|
amt = sz = u8_seqlen(ch);
|
||||||
while (--amt) {
|
while (--amt) {
|
||||||
ch <<= 6;
|
ch <<= 6;
|
||||||
c = fgetc(f);
|
c = fgetc(f);
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
return UEOF;
|
return UEOF;
|
||||||
ch += (u_int32_t)c;
|
ch += (uint32_t)c;
|
||||||
}
|
}
|
||||||
ch -= offsetsFromUTF8[sz-1];
|
ch -= offsetsFromUTF8[sz-1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue