-Changed's unsigned long's to u32. Should be more 64-bit compatible

This commit is contained in:
cyberwarriorx 2006-06-04 22:32:56 +00:00
parent 74257346de
commit ac6ea9b9a4
2 changed files with 9 additions and 9 deletions

View File

@ -23,7 +23,7 @@
void FIFOInit(FIFO * fifo) void FIFOInit(FIFO * fifo)
{ {
unsigned long i; u32 i;
fifo->begin = 0; fifo->begin = 0;
fifo->end = 0; fifo->end = 0;
@ -34,7 +34,7 @@ void FIFOInit(FIFO * fifo)
fifo->error = FALSE; fifo->error = FALSE;
} }
void FIFOAdd(FIFO * fifo, unsigned long v) void FIFOAdd(FIFO * fifo, u32 v)
{ {
if(fifo->full) if(fifo->full)
{ {
@ -47,14 +47,14 @@ void FIFOAdd(FIFO * fifo, unsigned long v)
fifo->empty = FALSE; fifo->empty = FALSE;
} }
unsigned long FIFOValue(FIFO * fifo) u32 FIFOValue(FIFO * fifo)
{ {
if(fifo->empty) if(fifo->empty)
{ {
fifo->error = TRUE; fifo->error = TRUE;
return 0; return 0;
} }
unsigned long v = fifo->data[fifo->begin]; u32 v = fifo->data[fifo->begin];
fifo->begin = (fifo->begin + 1)& 0x1FFF; fifo->begin = (fifo->begin + 1)& 0x1FFF;
fifo->empty = (fifo->begin == fifo->end); fifo->empty = (fifo->begin == fifo->end);
return v; return v;

View File

@ -30,17 +30,17 @@ extern "C" {
typedef struct typedef struct
{ {
unsigned long data[0x2000]; u32 data[0x2000];
unsigned long begin; u32 begin;
unsigned long end; u32 end;
BOOL full; BOOL full;
BOOL empty; BOOL empty;
BOOL error; BOOL error;
} FIFO; } FIFO;
void FIFOInit(FIFO * fifo); void FIFOInit(FIFO * fifo);
void FIFOAdd(FIFO * fifo, unsigned long v); void FIFOAdd(FIFO * fifo, u32 v);
unsigned long FIFOValue(FIFO * fifo); u32 FIFOValue(FIFO * fifo);
#ifdef __cplusplus #ifdef __cplusplus
} }