aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth
diff options
context:
space:
mode:
authorathrxx2011-05-15 23:08:27 +0200
committerWillem Jan Palenstijn2011-05-17 20:36:32 +0200
commitd3e92f0b8105638b8fae45822006aa33bb8ed35a (patch)
treef2274185853ac2f4d9d0134843e18b804fa33353 /audio/softsynth
parentb3476fc8016e3a62812eb9c7b5602e1f05f529cb (diff)
downloadscummvm-rg350-d3e92f0b8105638b8fae45822006aa33bb8ed35a.tar.gz
scummvm-rg350-d3e92f0b8105638b8fae45822006aa33bb8ed35a.tar.bz2
scummvm-rg350-d3e92f0b8105638b8fae45822006aa33bb8ed35a.zip
FM-TOWNS AUDIO: Fix several CppCheck warnings
Diffstat (limited to 'audio/softsynth')
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_audio.cpp12
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_euphony.cpp3
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_midi.cpp5
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp11
4 files changed, 20 insertions, 11 deletions
diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
index f2d249b32a..dd9bf61e48 100644
--- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -255,7 +255,8 @@ TownsAudioInterfaceIntern::TownsAudioInterfaceIntern(Audio::Mixer *mixer, TownsA
_baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver),
_pcmSfxChanMask(0), _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume),
_outputVolumeFlags(0), _pcmChanOut(0), _pcmChanReserved(0), _pcmChanKeyPressed(0),
- _pcmChanEffectPlaying(0), _pcmChanKeyPlaying(0), _ready(false) {
+ _pcmChanEffectPlaying(0), _pcmChanKeyPlaying(0), _fmChanPlaying(0),
+ _numReservedChannels(0), _numWaveTables(0), _ready(false) {
#define INTCB(x) &TownsAudioInterfaceIntern::intf_##x
static const TownsAudioIntfCallback intfCb[] = {
@@ -368,6 +369,11 @@ TownsAudioInterfaceIntern::TownsAudioInterfaceIntern(Audio::Mixer *mixer, TownsA
_intfOpcodes = intfCb;
memset(_fmSaveReg, 0, sizeof(_fmSaveReg));
+ memset(_fmChanNote, 0, sizeof(_fmChanNote));
+ memset(_fmChanPitch, 0, sizeof(_fmChanPitch));
+ memset(_pcmChanNote, 0, sizeof(_pcmChanNote));
+ memset(_pcmChanVelo, 0, sizeof(_pcmChanVelo));
+ memset(_pcmChanLevel, 0, sizeof(_pcmChanLevel));
memset(_outputLevel, 0, sizeof(_outputLevel));
memset(_outputMute, 0, sizeof(_outputMute));
@@ -980,9 +986,9 @@ int TownsAudioInterfaceIntern::intf_setOutputMute(va_list &args) {
memset(_outputMute, 1, 8);
if (mute & 2)
- memset(_outputMute + 12, 1, 4);
+ memset(&_outputMute[12], 1, 4);
if (mute & 1)
- memset(_outputMute + 8, 1, 4);
+ memset(&_outputMute[8], 1, 4);
_outputMute[(f < 0x80) ? 11 : 15] = 0;
f += f;
diff --git a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
index f7aa33f44d..bc2c88b236 100644
--- a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
@@ -28,7 +28,8 @@
TownsEuphonyDriver::TownsEuphonyDriver(Audio::Mixer *mixer) : _activeChannels(0), _sustainChannels(0),
_assignedChannels(0), _paraCount(0), _command(0), _tEnable(0), _tMode(0), _tOrdr(0), _tLevel(0),
_tTranspose(0), _musicPos(0), _musicStart(0), _playing(false), _eventBuffer(0), _bufferedEventsCount(0),
- _tempoControlMode(0) {
+ _tempoControlMode(0), _timerSetting(0), _tempoDiff(0), _timeStampBase(0), _elapsedEvents(0), _loop(false),
+ _endOfTrack(false), _suspendParsing(false), _musicTrackSize(0) {
_para[0] = _para[1] = 0;
_intf = new TownsAudioInterface(mixer, this);
resetTempo();
diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.cpp b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
index 6b31ea1aba..0743409af9 100644
--- a/audio/softsynth/fmtowns_pc98/towns_midi.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
@@ -670,7 +670,7 @@ TownsMidiInputChannel::TownsMidiInputChannel(MidiDriver_TOWNS *driver, int chanI
}
TownsMidiInputChannel::~TownsMidiInputChannel() {
- delete _instrument;
+ delete[] _instrument;
}
bool TownsMidiInputChannel::allocate() {
@@ -836,7 +836,8 @@ const uint8 TownsMidiInputChannel::_programAdjustLevel[] = {
0x3D, 0x3D, 0x3E, 0x3E, 0x3E, 0x3F, 0x3F, 0x3F
};
-MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerProcPara(0), _open(false) {
+MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerProcPara(0), _channels(0), _out(0),
+ _chanState(0), _operatorLevelTable(0), _tickCounter1(0), _tickCounter2(0), _rand(1), _allocCurPos(0), _open(false) {
_intf = new TownsAudioInterface(mixer, this);
}
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
index 09d3ca3b8d..46ac7e5c14 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
@@ -99,7 +99,7 @@ TownsPC98_FmSynthOperator::TownsPC98_FmSynthOperator(const uint32 timerbase, con
_rtt(rtt), _rateTbl(rateTable), _rshiftTbl(shiftTable), _adTbl(attackDecayTable), _fTbl(frqTable),
_sinTbl(sineTable), _tLvlTbl(tlevelOut), _detnTbl(detuneTable), _tickLength(timerbase * 2),
_specifiedAttackRate(0), _specifiedDecayRate(0), _specifiedReleaseRate(0), _specifiedSustainRate(0),
- _phase(0), _state(kEnvReady), _holdKey(false), _timer(0), _keyScale1(0),
+ _sustainLevel(0), _phase(0), _state(kEnvReady), _holdKey(false), _timer(0), _keyScale1(0),
_keyScale2(0), _currentLevel(1023), _ampMod(false), _tickCount(0) {
fs_a.rate = fs_a.shift = fs_d.rate = fs_d.shift = fs_s.rate = fs_s.shift = fs_r.rate = fs_r.shift = 0;
@@ -653,7 +653,8 @@ void TownsPC98_FmSynthSquareSineSource::updateRegs() {
#ifndef DISABLE_PC98_RHYTHM_CHANNEL
TownsPC98_FmSynthPercussionSource::TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt) :
- _rtt(rtt), _tickLength(timerbase * 2), _timer(0), _ready(false), _volMaskA(0), _volMaskB(0), _volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume) {
+ _rtt(rtt), _tickLength(timerbase * 2), _timer(0), _totalLevel(0), _volMaskA(0), _volMaskB(0),
+ _volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume), _ready(false) {
memset(_rhChan, 0, sizeof(RhtChannel) * 6);
_reg = new uint8 *[40];
@@ -1256,7 +1257,7 @@ void TownsPC98_FmSynth::generateTables() {
WRITE_BE_UINT32(_oprRates + 32, _numChan == 6 ? 0x90900000 : 0x00081018);
WRITE_BE_UINT32(_oprRates + 36, _numChan == 6 ? 0x00001010 : 0x00081018);
memset(_oprRates, 0x90, 32);
- memset(_oprRates + 96, 0x80, 32);
+ memset(&_oprRates[96], 0x80, 32);
uint8 *dst = (uint8 *)_oprRates + 40;
for (int i = 0; i < 40; i += 4)
WRITE_BE_UINT32(dst + i, 0x00081018);
@@ -1313,8 +1314,8 @@ void TownsPC98_FmSynth::generateTables() {
uint8 *dtt = new uint8[128];
memset(dtt, 0, 36);
- memset(dtt + 36, 1, 8);
- memcpy(dtt + 44, _detSrc, 84);
+ memset(&dtt[36], 1, 8);
+ memcpy(&dtt[44], _detSrc, 84);
delete[] _oprDetune;
_oprDetune = new int32[256];