mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Fixed all lib file warnings (#240)
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
/* RAM_POS: 0x800C77F0 */
|
||||
|
||||
#include "audio_internal.h"
|
||||
#include "macros.h"
|
||||
|
||||
void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size) {
|
||||
void *alHeapDBAlloc(UNUSED u8 *file, UNUSED s32 line, ALHeap *hp, s32 num, s32 size) {
|
||||
s32 bytes;
|
||||
u8 *ptr = 0;
|
||||
|
||||
|
||||
@@ -45,11 +45,15 @@ void alSynSetFXMix(ALSynth *synth, ALVoice *v, u8 fxmix)
|
||||
update->delta = synth->paramSamples + v->pvoice->offset;
|
||||
update->type = AL_FILTER_SET_FXAMT;
|
||||
|
||||
//Ignore GCC warnings for this line, as there's no other way to match this.
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
//Differs from ultralib
|
||||
if (fxmix < 0)
|
||||
update->data.i = -fxmix;
|
||||
else
|
||||
update->data.i = fxmix;
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
update->next = 0;
|
||||
|
||||
|
||||
+8
-9
@@ -40,7 +40,7 @@ extern u32 cnt_index, adpcm_num, adpcm_cnt, adpcm_max, adpcm_min, lastCnt[];
|
||||
static
|
||||
Acmd *_decodeChunk(Acmd *ptr, ALLoadFilter *f, s32 tsam, s32 nbytes, s16 outp, s16 inp, u32 flags);
|
||||
|
||||
Acmd *alAdpcmPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p)
|
||||
Acmd *alAdpcmPull(void *filter, s16 *outp, s32 outCount, UNUSED s32 sampleOffset, Acmd *p)
|
||||
{
|
||||
Acmd *ptr = p;
|
||||
s16 inp;
|
||||
@@ -70,7 +70,7 @@ Acmd *alAdpcmPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd
|
||||
aLoadADPCM(ptr++, f->bookSize,
|
||||
K0_TO_PHYS(f->table->waveInfo.adpcmWave.book->book));
|
||||
|
||||
looped = (outCount + f->sample > f->loop.end) && (f->loop.count != 0);
|
||||
looped = ((u32)(outCount + f->sample) > f->loop.end) && (f->loop.count != 0);
|
||||
if (looped)
|
||||
nSam = f->loop.end - f->sample;
|
||||
else
|
||||
@@ -127,13 +127,13 @@ Acmd *alAdpcmPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd
|
||||
* -1 is loop forever - the loop count is not exact now
|
||||
* for small loops!
|
||||
*/
|
||||
if ((f->loop.count != -1) && (f->loop.count != 0))
|
||||
if ((f->loop.count != -1U) && (f->loop.count != 0))
|
||||
f->loop.count--;
|
||||
|
||||
/*
|
||||
* What's left to compute.
|
||||
*/
|
||||
nSam = MIN(outCount, f->loop.end - f->loop.start);
|
||||
nSam = MIN((u32)outCount, f->loop.end - f->loop.start);
|
||||
tsam = nSam - ADPCMFSIZE + f->lastsam;
|
||||
if (tsam<0) tsam = 0;
|
||||
nframes = (tsam+ADPCMFSIZE-1)>>LFSAMPLES;
|
||||
@@ -209,7 +209,7 @@ Acmd *alAdpcmPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd
|
||||
return ptr;
|
||||
}
|
||||
|
||||
Acmd *alRaw16Pull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p)
|
||||
Acmd *alRaw16Pull(void *filter, s16 *outp, s32 outCount, UNUSED s32 sampleOffset, Acmd *p)
|
||||
{
|
||||
Acmd *ptr = p;
|
||||
s32 nbytes;
|
||||
@@ -222,12 +222,11 @@ Acmd *alRaw16Pull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd
|
||||
s32 op;
|
||||
|
||||
ALLoadFilter *f = (ALLoadFilter *)filter;
|
||||
ALFilter *a = (ALFilter *) filter;
|
||||
|
||||
if (outCount == 0)
|
||||
return ptr;
|
||||
|
||||
if ((outCount + f->sample > f->loop.end) && (f->loop.count != 0)){
|
||||
if (((u32)(outCount + f->sample) > f->loop.end) && (f->loop.count != 0)){
|
||||
|
||||
nSam = f->loop.end - f->sample;
|
||||
nbytes = nSam<<1;
|
||||
@@ -261,13 +260,13 @@ Acmd *alRaw16Pull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd
|
||||
/*
|
||||
* -1 is loop forever
|
||||
*/
|
||||
if ((f->loop.count != -1) && (f->loop.count != 0))
|
||||
if ((f->loop.count != -1U) && (f->loop.count != 0))
|
||||
f->loop.count--;
|
||||
|
||||
/*
|
||||
* What to compute.
|
||||
*/
|
||||
nSam = MIN(outCount, f->loop.end - f->loop.start);
|
||||
nSam = MIN((u32)outCount, f->loop.end - f->loop.start);
|
||||
nbytes = nSam<<1;
|
||||
|
||||
/*
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "audio_internal.h"
|
||||
#include "PR/os.h"
|
||||
#include "PR/abi.h"
|
||||
|
||||
// TODO: this comes from a header
|
||||
#ident "$Revision: 1.49 $"
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
/**
|
||||
* This gets called inside of _PrintF, but it is just a fake pointer returned
|
||||
*/
|
||||
static void *is_proutSyncPrintf(void *str, const char *buf, size_t n) {
|
||||
return ((void *) 1); /* return a fake pointer so that it's not NULL */
|
||||
static char *is_proutSyncPrintf(UNUSED char *str, UNUSED const char *buf, UNUSED size_t n) {
|
||||
return ((char *) 1); /* return a fake pointer so that it's not NULL */
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,9 +20,8 @@ static void *is_proutSyncPrintf(void *str, const char *buf, size_t n) {
|
||||
* Could still be an earlier version of osSyncPrintf
|
||||
*/
|
||||
void rmonPrintf(const char *format, ...) {
|
||||
s32 written;
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
written = _Printf(is_proutSyncPrintf, NULL, format, args);
|
||||
_Printf(is_proutSyncPrintf, NULL, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ s32 _Printf(outfun prout, char *dst, const char *fmt, va_list args) {
|
||||
x.length = 'L';
|
||||
fmt_ptr++;
|
||||
}
|
||||
_Putfld(&x, &args, *fmt_ptr, ac);
|
||||
_Putfld(&x, (va_list *)&args, *fmt_ptr, ac);
|
||||
x.width -= x.n0 + x.num_leading_zeros + x.part2_len + x.num_mid_zeros
|
||||
+ x.part3_len + x.num_trailing_zeros;
|
||||
if (!(x.flags & FLAGS_MINUS))
|
||||
|
||||
@@ -208,10 +208,9 @@ s32 __osCheckId(OSPfs *pfs)
|
||||
ret = __osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp);
|
||||
if (ret != 0)
|
||||
{
|
||||
if (ret != 2)
|
||||
if (ret != PFS_ERR_NEW_PACK)
|
||||
return ret;
|
||||
else
|
||||
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp));
|
||||
ERRCK(__osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp));
|
||||
}
|
||||
|
||||
for (k = 0; k < ARRLEN(temp); k++)
|
||||
|
||||
Reference in New Issue
Block a user