X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=d620dd93d0614b38ac5dfff9244d3abb518d5f7b;hb=56814df201c2d86273cf54e0e94c0448ce9bdd0f;hp=c10575b8660625bd4182b62fccaee55a309c3481;hpb=6d06ba238902736bb99714dc8122bb32a286577a;p=rocksndiamonds.git diff --git a/src/libgame/sound.c b/src/libgame/sound.c index c10575b8..d620dd93 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -474,8 +474,8 @@ static void WriteReloadInfoToPipe(char *set_identifier, int type) unsigned long str_size4 = strlen(ti->basepath) + 1; unsigned long str_size5 = strlen(ti->fullpath) + 1; boolean override_level_artwork = (type == SND_CTRL_RELOAD_SOUNDS ? - setup.override_level_sounds : - setup.override_level_music); + gfx.override_level_sounds : + gfx.override_level_music); if (IS_CHILD_PROCESS()) return; @@ -483,7 +483,7 @@ static void WriteReloadInfoToPipe(char *set_identifier, int type) if (leveldir_current == NULL) /* should never happen */ Error(ERR_EXIT, "leveldir_current == NULL"); - memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */ snd_ctrl.active = FALSE; snd_ctrl.state = type; @@ -534,8 +534,8 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl) unsigned long str_size1, str_size2, str_size3, str_size4, str_size5; static char *set_identifier = NULL; boolean *override_level_artwork = (snd_ctrl->state & SND_CTRL_RELOAD_SOUNDS ? - &setup.override_level_sounds : - &setup.override_level_music); + &gfx.override_level_sounds : + &gfx.override_level_music); checked_free(set_identifier); @@ -1147,8 +1147,8 @@ static void Mixer_Main_DSP() max_sample_size = fragment_size / (num_output_channels * sample_bytes); /* first clear the last premixing buffer */ - memset(premix_last_buffer, 0, - max_sample_size * num_output_channels * sizeof(long)); + clear_mem(premix_last_buffer, + max_sample_size * num_output_channels * sizeof(long)); for (i = 0; i < audio.num_channels; i++) { @@ -1559,6 +1559,8 @@ static void *Load_WAV(char *filename) #else /* AUDIO_UNIX_NATIVE */ + clear_mem(&header, sizeof(struct SoundHeader_WAV)); /* to make gcc happy */ + if ((file = fopen(filename, MODE_READ)) == NULL) { Error(ERR_WARN, "cannot open sound file '%s'", filename); @@ -2171,7 +2173,7 @@ void StopSoundExt(int nr, int state) if (!audio.sound_available) return; - memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */ snd_ctrl.active = FALSE; snd_ctrl.nr = nr;