From 4b28e33906d5bc31f3736105ecfab473d3899f5b Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 7 Jun 2015 11:35:45 -0700 Subject: [PATCH] Refactor USHORT -> uint16_t --- src/audio/AY8910.c | 2 +- src/audio/mockingboard.c | 10 +++++----- src/audio/mockingboard.h | 2 +- src/audio/win-shim.h | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/audio/AY8910.c b/src/audio/AY8910.c index 512a0393..e50bd13e 100644 --- a/src/audio/AY8910.c +++ b/src/audio/AY8910.c @@ -519,7 +519,7 @@ static void sound_ay_overlay(CAY8910 *_this) // cpufreq = machine_current->timings.processor_speed / HZ_COMMON_DENOMINATOR; cpufreq = (libspectrum_dword) (m_fCurrentCLK_AY8910 / HZ_COMMON_DENOMINATOR); // [TC] for( f = 0; f < _this->ay_change_count; f++ ) - _this->ay_change[f].ofs = (USHORT) (( _this->ay_change[f].tstates * sfreq ) / cpufreq); // [TC] Added cast + _this->ay_change[f].ofs = (uint16_t) (( _this->ay_change[f].tstates * sfreq ) / cpufreq); // [TC] Added cast libspectrum_signed_word* pBuf1 = g_ppSoundBuffers[0]; libspectrum_signed_word* pBuf2 = g_ppSoundBuffers[1]; diff --git a/src/audio/mockingboard.c b/src/audio/mockingboard.c index 400d27d5..e3cca93b 100644 --- a/src/audio/mockingboard.c +++ b/src/audio/mockingboard.c @@ -166,7 +166,7 @@ static UINT g_nMBTimerDevice = TIMERDEVICE_INVALID; // SY6522 device# which is g static uint64_t g_uLastCumulativeCycles = 0; // SSI263 vars: -static USHORT g_nSSI263Device = 0; // SSI263 device# which is generating phoneme-complete IRQ +static uint16_t g_nSSI263Device = 0; // SSI263 device# which is generating phoneme-complete IRQ static int g_nCurrentActivePhoneme = -1; static bool g_bStopPhoneme = false; static bool g_bVotraxPhoneme = false; @@ -279,7 +279,7 @@ static void StartTimer(SY6522_AY8910* pMB) if((pMB->sy6522.IER & IxR_TIMER1) == 0x00) return; - USHORT nPeriod = pMB->sy6522.TIMER1_LATCH.w; + uint16_t nPeriod = pMB->sy6522.TIMER1_LATCH.w; // if(nPeriod <= 0xff) // Timer1L value has been written (but TIMER1H hasn't) // return; @@ -2030,15 +2030,15 @@ void MB_UpdateCycles(void) printf("OOPS!!! Mockingboard failed assert!\n"); return; } - USHORT nClocks = (USHORT) uCycles; + uint16_t nClocks = (uint16_t) uCycles; for(unsigned int i=0; isy6522.TIMER1_COUNTER.w; + uint16_t OldTimer1 = pMB->sy6522.TIMER1_COUNTER.w; #ifndef APPLE2IX - USHORT OldTimer2 = pMB->sy6522.TIMER2_COUNTER.w; + uint16_t OldTimer2 = pMB->sy6522.TIMER2_COUNTER.w; #endif pMB->sy6522.TIMER1_COUNTER.w -= nClocks; diff --git a/src/audio/mockingboard.h b/src/audio/mockingboard.h index 1f25dabc..91a6b225 100644 --- a/src/audio/mockingboard.h +++ b/src/audio/mockingboard.h @@ -27,7 +27,7 @@ typedef struct BYTE l; BYTE h; }; - USHORT w; + uint16_t w; }; } IWORD; diff --git a/src/audio/win-shim.h b/src/audio/win-shim.h index 4ed90d85..322334f2 100644 --- a/src/audio/win-shim.h +++ b/src/audio/win-shim.h @@ -34,7 +34,6 @@ typedef long LONG; typedef unsigned int UINT; typedef char TCHAR; typedef short SHORT; -typedef unsigned short USHORT; typedef unsigned short WORD; typedef unsigned char BYTE;