aboutsummaryrefslogtreecommitdiffstats
path: root/rdoff/rdoff.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-04-12 16:54:50 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-04-12 16:54:50 +0000
commit038d861eded9bfc75529e23ba8d5d6edd5e3ef98 (patch)
tree8383e607cb9bdcba3beef5d831e8a0f6e175f28c /rdoff/rdoff.c
parent2030bd21f4923d4ddd4c093f8756451fc35220f8 (diff)
downloadnasm-038d861eded9bfc75529e23ba8d5d6edd5e3ef98.tar.gz
nasm-038d861eded9bfc75529e23ba8d5d6edd5e3ef98.tar.xz
nasm-038d861eded9bfc75529e23ba8d5d6edd5e3ef98.zip
Remove obsolete types; add <inttypes.h> where needed; header fixes
- Remove obsolete types like "uint32"; use "uint32_t" consistently. - Make sure we include <inttypes.h> where needed. - Header file guards should be FOO_H or SUBDIR_FOO_H; _FOO_H infringes on the C implementation's namespace and should only be used when writing libc! - Change a few "int8_t" back to "char" where appropriate. There are a lot more places where that should be done, though. - Clean up the check for getuid/getgid in rdoff/rdlar.h.
Diffstat (limited to 'rdoff/rdoff.c')
-rw-r--r--rdoff/rdoff.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/rdoff/rdoff.c b/rdoff/rdoff.c
index fdafc92a..c5644670 100644
--- a/rdoff/rdoff.c
+++ b/rdoff/rdoff.c
@@ -57,7 +57,7 @@ memorybuffer *newmembuf()
void membufwrite(memorybuffer * const b, void *data, int bytes)
{
- uint16 w;
+ uint16_t w;
int32_t l;
if (b->next) { /* memory buffer full - use next buffer */
@@ -88,7 +88,7 @@ void membufwrite(memorybuffer * const b, void *data, int bytes)
break;
case -2:
- w = *(uint16 *) data;
+ w = *(uint16_t *) data;
b->buffer[b->length++] = w & 0xFF;
w >>= 8;
b->buffer[b->length++] = w & 0xFF;
@@ -152,9 +152,9 @@ int32_t translateint32_t(int32_t in)
return r;
}
-uint16 translateint16_t(uint16 in)
+uint16_t translateint16_t(uint16_t in)
{
- uint16 r;
+ uint16_t r;
uint8_t *i;
i = (uint8_t *)&in;
@@ -171,7 +171,7 @@ static int8_t *knownsegtypes[8] = {
};
/* Get a textual string describing the segment type */
-int8_t *translatesegmenttype(uint16 type)
+int8_t *translatesegmenttype(uint16_t type)
{
if (type < 8)
return knownsegtypes[type];
@@ -228,7 +228,7 @@ int rdfopenhere(rdffile * f, FILE * fp, int *refcount, const int8_t *name)
int8_t buf[8];
int32_t initpos;
int32_t l;
- uint16 s;
+ uint16_t s;
if (translateint32_t(0x01020304) != 0x01020304) {
/* fix this to be portable! */
@@ -354,14 +354,14 @@ int rdfloadseg(rdffile * f, int segment, void *buffer)
case RDOFF_HEADER:
fpos = f->header_ofs;
slen = f->header_len;
- f->header_loc = (byte *) buffer;
+ f->header_loc = (uint8_t *) buffer;
f->header_fp = 0;
break;
default:
if (segment < f->nsegs) {
fpos = f->seg[segment].offset;
slen = f->seg[segment].length;
- f->seg[segment].data = (byte *) buffer;
+ f->seg[segment].data = (uint8_t *) buffer;
} else {
return rdf_errno = RDF_ERR_SEGMENT;
}