Replace 8 and 16 bit custom types by stdint.h types

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2017-12-31 13:46:52 +01:00
parent c24cab6d1d
commit 13c0684497
20 changed files with 75 additions and 59 deletions

View File

@@ -1,3 +1,4 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -7,7 +8,7 @@
#include "link/mylink.h"
#include "link/main.h"
static BBOOL
static uint8_t
symboldefined(char *name)
{
struct sSection *pSect;
@@ -31,7 +32,7 @@ symboldefined(char *name)
return (0);
}
static BBOOL
static uint8_t
addmodulecontaining(char *name)
{
struct sSection **ppLSect;

View File

@@ -5,6 +5,7 @@
#include <ctype.h>
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -18,8 +19,8 @@
struct sSymbol **tSymbols;
struct sSection *pSections = NULL;
struct sSection *pLibSections = NULL;
UBYTE dummymem;
BBOOL oReadLib = 0;
uint8_t dummymem;
uint8_t oReadLib = 0;
/*
* The usual byte order stuff
@@ -39,10 +40,10 @@ readlong(FILE * f)
return (r);
}
UWORD
uint16_t
readword(FILE * f)
{
UWORD r;
uint16_t r;
r = fgetc(f);
r |= fgetc(f) << 8;
@@ -228,7 +229,7 @@ obj_ReadRGBSection(FILE * f)
SLONG nNumberOfPatches;
struct sPatch **ppPatch, *pPatch;
if (fread(pSection->pData, sizeof(UBYTE),
if (fread(pSection->pData, sizeof(uint8_t),
pSection->nByteSize, f) != pSection->nByteSize) {
err(1, "Read error.");
}
@@ -257,7 +258,7 @@ obj_ReadRGBSection(FILE * f)
err(1, NULL);
}
if (fread(pPatch->pRPN, sizeof(UBYTE),
if (fread(pPatch->pRPN, sizeof(uint8_t),
pPatch->nRPNSize, f) != pPatch->nRPNSize) {
errx(1, "Read error.");
}

View File

@@ -1,3 +1,4 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -11,13 +12,13 @@
char *tzOutname;
char *tzOverlayname = NULL;
SLONG MaxOverlayBank;
int32_t MaxOverlayBank;
void
writehome(FILE * f, FILE * f_overlay)
{
struct sSection *pSect;
UBYTE *mem;
uint8_t *mem;
mem = malloc(MaxAvail[BANK_ROM0]);
if (!mem)
@@ -51,10 +52,10 @@ writehome(FILE * f, FILE * f_overlay)
}
void
writebank(FILE * f, FILE * f_overlay, SLONG bank)
writebank(FILE * f, FILE * f_overlay, int32_t bank)
{
struct sSection *pSect;
UBYTE *mem;
uint8_t *mem;
mem = malloc(MaxAvail[bank]);
if (!mem)
@@ -103,7 +104,7 @@ out_SetOverlayname(char *tzOverlayfile)
void
Output(void)
{
SLONG i;
int32_t i;
FILE *f;
FILE *f_overlay = NULL;

View File

@@ -1,3 +1,4 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -86,7 +87,7 @@ SLONG
calcrpn(struct sPatch * pPatch)
{
SLONG t, size;
UBYTE *rpn;
uint8_t *rpn;
rpnp = 0;
@@ -232,7 +233,7 @@ Patch(void)
if (t >= -128 && t <= 255) {
t &= 0xFF;
pSect->pData[pPatch->nOffset] =
(UBYTE) t;
(uint8_t) t;
} else {
errx(1,
"%s(%ld) : Value must be 8-bit",