mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-11 14:30:08 +00:00
Silence compiler warnings on Mac
This commit is contained in:
parent
3ce9149b6f
commit
29e8502f23
@ -943,7 +943,7 @@ static void MB_Update()
|
||||
|
||||
int nBytesRemaining = dwByteOffset - dwCurrentPlayCursor;
|
||||
#else
|
||||
int nBytesRemaining = dwCurrentPlayCursor;
|
||||
int nBytesRemaining = (int)dwCurrentPlayCursor;
|
||||
//LOG("Mockingboard : sound buffer position : %d", nBytesRemaining);
|
||||
#endif
|
||||
if(nBytesRemaining < 0)
|
||||
|
@ -138,8 +138,8 @@ long SoundSystemCreate(const char *sound_device, SoundSystemStruct **sound_struc
|
||||
}
|
||||
|
||||
(*sound_struct)->implementation_specific = ctx;
|
||||
(*sound_struct)->CreateSoundBuffer = OpenALCreateSoundBuffer;
|
||||
(*sound_struct)->DestroySoundBuffer = OpenALDestroySoundBuffer;
|
||||
(*sound_struct)->CreateSoundBuffer = (HRESULT (*)(DSBUFFERDESC *, LPDIRECTSOUNDBUFFER *, void *))OpenALCreateSoundBuffer;
|
||||
(*sound_struct)->DestroySoundBuffer = (HRESULT (*)(LPDIRECTSOUNDBUFFER *))OpenALDestroySoundBuffer;
|
||||
|
||||
return 0;
|
||||
} while(0);
|
||||
@ -330,7 +330,7 @@ static ALVoice *NewVoice(ALBufferParamsStruct *params)
|
||||
voice->avail_buffers = node;
|
||||
}
|
||||
|
||||
voice->rate = params->lpwfxFormat->nSamplesPerSec;
|
||||
voice->rate = (ALuint)params->lpwfxFormat->nSamplesPerSec;
|
||||
|
||||
// Emulator supports only mono and stereo
|
||||
if (params->lpwfxFormat->nChannels == 2)
|
||||
@ -343,7 +343,7 @@ static ALVoice *NewVoice(ALBufferParamsStruct *params)
|
||||
}
|
||||
|
||||
/* Allocate enough space for the temp buffer, given the format */
|
||||
voice->buffersize = params->dwBufferBytes;
|
||||
voice->buffersize = (ALsizei)params->dwBufferBytes;
|
||||
voice->data = malloc(voice->buffersize);
|
||||
if (voice->data == NULL)
|
||||
{
|
||||
@ -405,7 +405,7 @@ static long ALPlay(void *_this, unsigned long reserved1, unsigned long reserved2
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long _ALProcessPlayBuffers(ALVoice *voice, ALuint *bytes_queued)
|
||||
static int _ALProcessPlayBuffers(ALVoice *voice, ALuint *bytes_queued)
|
||||
{
|
||||
ALint processed = 0;
|
||||
int err = 0;
|
||||
@ -537,7 +537,7 @@ static long ALBegin(void *_this, unsigned long unused, unsigned long write_bytes
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long _ALSubmitBufferToOpenAL(ALVoice *voice)
|
||||
static int _ALSubmitBufferToOpenAL(ALVoice *voice)
|
||||
{
|
||||
int err =0;
|
||||
|
||||
@ -636,7 +636,7 @@ static long ALCommit(void *_this, void *unused_audio_ptr1, unsigned long audio_b
|
||||
static long ALCommitStaticBuffer(void *_this, unsigned long audio_bytes1)
|
||||
{
|
||||
ALVoice *voice = (ALVoice*)_this;
|
||||
voice->replay_index = audio_bytes1;
|
||||
voice->replay_index = (ALsizei)audio_bytes1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -719,19 +719,19 @@ static long OpenALCreateSoundBuffer(ALBufferParamsStruct *params, ALSoundBufferS
|
||||
}
|
||||
|
||||
(*soundbuf_struct)->_this = voice;
|
||||
(*soundbuf_struct)->SetVolume = ALSetVolume;
|
||||
(*soundbuf_struct)->GetVolume = ALGetVolume;
|
||||
(*soundbuf_struct)->GetCurrentPosition = ALGetPosition;
|
||||
(*soundbuf_struct)->Stop = ALStop;
|
||||
(*soundbuf_struct)->Restore = ALRestore;
|
||||
(*soundbuf_struct)->Play = ALPlay;
|
||||
(*soundbuf_struct)->Lock = ALBegin;
|
||||
(*soundbuf_struct)->Unlock = ALCommit;
|
||||
(*soundbuf_struct)->GetStatus = ALGetStatus;
|
||||
(*soundbuf_struct)->SetVolume = (HRESULT (*)(void *, LONG))ALSetVolume;
|
||||
(*soundbuf_struct)->GetVolume = (HRESULT (*)(void *, LPLONG))ALGetVolume;
|
||||
(*soundbuf_struct)->GetCurrentPosition = (HRESULT (*)(void *, LPDWORD, LPDWORD))ALGetPosition;
|
||||
(*soundbuf_struct)->Stop = (HRESULT (*)(void *))ALStop;
|
||||
(*soundbuf_struct)->Restore = (HRESULT (*)(void *))ALRestore;
|
||||
(*soundbuf_struct)->Play = (HRESULT (*)(void *, DWORD, DWORD, DWORD))ALPlay;
|
||||
(*soundbuf_struct)->Lock = (HRESULT (*)(void *, DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD))ALBegin;
|
||||
(*soundbuf_struct)->Unlock = (HRESULT (*)(void *, LPVOID, DWORD, LPVOID, DWORD))ALCommit;
|
||||
(*soundbuf_struct)->GetStatus = (HRESULT (*)(void *, LPDWORD))ALGetStatus;
|
||||
|
||||
// mockingboard-specific hacks
|
||||
(*soundbuf_struct)->UnlockStaticBuffer = ALCommitStaticBuffer;
|
||||
(*soundbuf_struct)->Replay = ALReplay;
|
||||
(*soundbuf_struct)->UnlockStaticBuffer = (HRESULT (*)(void *, DWORD))ALCommitStaticBuffer;
|
||||
(*soundbuf_struct)->Replay = (HRESULT (*)(void *))ALReplay;
|
||||
|
||||
return 0;
|
||||
} while(0);
|
||||
|
@ -47,7 +47,7 @@ static char **sound_devices = NULL;
|
||||
static char *sound_devices[MAX_SOUND_DEVICES];
|
||||
static GUID sound_device_guid[MAX_SOUND_DEVICES];
|
||||
#endif
|
||||
static int num_sound_devices = 0;
|
||||
static long num_sound_devices = 0;
|
||||
|
||||
#ifdef APPLE2IX
|
||||
LPDIRECTSOUND g_lpDS = NULL;
|
||||
@ -624,7 +624,7 @@ bool DSInit()
|
||||
{
|
||||
SoundSystemDestroy((SoundSystemStruct**)&g_lpDS);
|
||||
}
|
||||
hr = SoundSystemCreate(sound_devices[x], (SoundSystemStruct**)&g_lpDS);
|
||||
hr = (int)SoundSystemCreate(sound_devices[x], (SoundSystemStruct**)&g_lpDS);
|
||||
#else
|
||||
hr = DirectSoundCreate(&sound_device_guid[x], &g_lpDS, NULL);
|
||||
#endif
|
||||
|
@ -94,8 +94,8 @@ double g_fClksPerSpkrSample; // Setup in SetClksPerSpkrSample()
|
||||
static DWORD lastcyclenum = 0;
|
||||
static DWORD toggles = 0;
|
||||
#endif
|
||||
static unsigned __int64 g_nSpkrQuietCycleCount = 0;
|
||||
static unsigned __int64 g_nSpkrLastCycle = 0;
|
||||
static uint64_t g_nSpkrQuietCycleCount = 0;
|
||||
static uint64_t g_nSpkrLastCycle = 0;
|
||||
static bool g_bSpkrToggleFlag = false;
|
||||
static VOICE SpeakerVoice = {0};
|
||||
static bool g_bSpkrAvailable = false;
|
||||
@ -856,7 +856,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa
|
||||
// Calc bytes remaining to be played
|
||||
int nBytesRemaining = dwByteOffset - dwCurrentPlayCursor;
|
||||
#else
|
||||
int nBytesRemaining = dwCurrentPlayCursor;
|
||||
int nBytesRemaining = (int)dwCurrentPlayCursor;
|
||||
#endif
|
||||
if(nBytesRemaining < 0)
|
||||
nBytesRemaining += g_dwDSSpkrBufferSize;
|
||||
@ -929,7 +929,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa
|
||||
#ifdef RIFF_SPKR
|
||||
RiffPutSamples(pDSLockedBuffer0, dwBufferSize0/sizeof(short));
|
||||
#endif
|
||||
nNumSamples = dwBufferSize0/sizeof(short);
|
||||
nNumSamples = (ULONG)(dwBufferSize0/sizeof(short));
|
||||
|
||||
if(pDSLockedBuffer1 && dwBufferSize1)
|
||||
{
|
||||
@ -1084,7 +1084,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples)
|
||||
// Calc bytes remaining to be played
|
||||
int nBytesRemaining = dwByteOffset - dwCurrentPlayCursor;
|
||||
#else
|
||||
int nBytesRemaining = dwCurrentPlayCursor;
|
||||
int nBytesRemaining = (int)dwCurrentPlayCursor;
|
||||
#endif
|
||||
if(nBytesRemaining < 0)
|
||||
nBytesRemaining += g_dwDSSpkrBufferSize;
|
||||
@ -1325,6 +1325,7 @@ void Spkr_DSUninit()
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#if !defined(APPLE2IX)
|
||||
DWORD SpkrGetSnapshot(SS_IO_Speaker* pSS)
|
||||
{
|
||||
pSS->g_nSpkrLastCycle = g_nSpkrLastCycle;
|
||||
@ -1336,4 +1337,5 @@ DWORD SpkrSetSnapshot(SS_IO_Speaker* pSS)
|
||||
g_nSpkrLastCycle = pSS->g_nSpkrLastCycle;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -579,13 +579,13 @@ static void gldriver_shutdown(void) {
|
||||
//
|
||||
// update, render, reshape
|
||||
//
|
||||
#if USE_GLUT
|
||||
static void gldriver_update(void) {
|
||||
// HACK MAYBE FIXME : pumps the joystick sampling code that is currently integrated into the keys routine
|
||||
c_keys_handle_input(-1, 0, 0);
|
||||
#if USE_GLUT
|
||||
glutPostRedisplay();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gldriver_render(void) {
|
||||
if (is_headless) {
|
||||
@ -622,7 +622,7 @@ static void gldriver_render(void) {
|
||||
// Update texture from Apple //e internal framebuffer
|
||||
const uint8_t * const fb = video_current_framebuffer();
|
||||
uint8_t index;
|
||||
#warning FIXME TODO use memcpy?
|
||||
#warning FIXME TODO use memcpy ... or don't use indexed color so that we don't need to do this copy?
|
||||
unsigned int count = SCANWIDTH * SCANHEIGHT;
|
||||
char pixels[SCANWIDTH * SCANHEIGHT * 4];
|
||||
if (fb != NULL) {
|
||||
|
@ -39,14 +39,14 @@ demoImage *imgLoadImage(const char *filepathname, int flipVertical) {
|
||||
}
|
||||
|
||||
demoImage *image = malloc(sizeof(demoImage));
|
||||
image->width = CGImageGetWidth(cgImage);
|
||||
image->height = CGImageGetHeight(cgImage);
|
||||
image->width = (GLuint)CGImageGetWidth(cgImage);
|
||||
image->height = (GLuint)CGImageGetHeight(cgImage);
|
||||
image->rowByteSize = image->width * 4;
|
||||
image->data = malloc(image->height * image->rowByteSize);
|
||||
image->format = GL_RGBA;
|
||||
image->type = GL_UNSIGNED_BYTE;
|
||||
|
||||
CGContextRef context = CGBitmapContextCreate(image->data, image->width, image->height, 8, image->rowByteSize, CGImageGetColorSpace(cgImage), kCGImageAlphaNoneSkipLast);
|
||||
CGContextRef context = CGBitmapContextCreate(image->data, image->width, image->height, 8, image->rowByteSize, CGImageGetColorSpace(cgImage), 0x0);
|
||||
CGContextSetBlendMode(context, kCGBlendModeCopy);
|
||||
if (flipVertical) {
|
||||
CGContextTranslateCTM(context, 0.0, image->height);
|
||||
|
@ -36,7 +36,7 @@ demoSource *srcLoadSource(const char *filepathname) {
|
||||
|
||||
// Get the size of the source
|
||||
fseek(curFile, 0, SEEK_END);
|
||||
GLsizei fileSize = ftell (curFile);
|
||||
GLsizei fileSize = (GLsizei)ftell(curFile);
|
||||
|
||||
// Add 1 to the file size to include the null terminator for the string
|
||||
source->byteSize = fileSize + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user