--- hatari/src/gui-sdl/dlgSound.c 2019/04/01 07:11:38 1.1 +++ hatari/src/gui-sdl/dlgSound.c 2019/04/01 07:13:16 1.1.1.3 @@ -4,12 +4,11 @@ This file is distributed under the GNU Public License, version 2 or at your option any later version. Read the file gpl.txt for details. */ -char DlgSound_rcsid[] = "Hatari $Id: dlgSound.c,v 1.1 2019/04/01 07:11:38 root Exp $"; +const char DlgSound_rcsid[] = "Hatari $Id: dlgSound.c,v 1.1.1.3 2019/04/01 07:13:16 root Exp $"; #include "main.h" #include "configuration.h" #include "dialog.h" -#include "memAlloc.h" #include "sdlgui.h" #include "file.h" #include "sound.h" @@ -60,7 +59,12 @@ void Dialog_SoundDlg(void) char *tmpname; /* Allocate memory for tmpname: */ - tmpname = Memory_Alloc(FILENAME_MAX); + tmpname = malloc(FILENAME_MAX); + if (!tmpname) + { + perror("Dialog_SoundDlg"); + return; + } SDLGui_CenterDlg(sounddlg); @@ -91,7 +95,7 @@ void Dialog_SoundDlg(void) /* The sound dialog main loop */ do { - but = SDLGui_DoDialog(sounddlg); + but = SDLGui_DoDialog(sounddlg, NULL); switch(but) { case DLGSOUND_RECBROWSE: /* Choose a new record file */ @@ -124,7 +128,7 @@ void Dialog_SoundDlg(void) break; } } - while( but!=DLGSOUND_EXIT && !bQuitProgram ); + while (but != DLGSOUND_EXIT && but != SDLGUI_QUIT && !bQuitProgram ); /* Read values from dialog */ DialogParams.Sound.bEnableSound = (sounddlg[DLGSOUND_ENABLE].state & SG_SELECTED); @@ -135,5 +139,5 @@ void Dialog_SoundDlg(void) else DialogParams.Sound.nPlaybackQuality = PLAYBACK_HIGH; - Memory_Free(tmpname); + free(tmpname); }