mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-23 12:53:09 +00:00
Fix -Waddress warning
the address of ‘hwparams’ will always evaluate as ‘true’ This was only in idAudioHardwareALSA::Initialize(), add the missing return statement too while I'm at it.
This commit is contained in:
parent
9d0e0d6fbc
commit
fc447ec426
2 changed files with 4 additions and 5 deletions
|
@ -89,8 +89,6 @@ private:
|
|||
#define ALSA_PCM_NEW_SW_PARAMS_API
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#define id_snd_pcm_hw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_hw_params_t *) alloca(id_snd_pcm_hw_params_sizeof()); memset(*ptr, 0, id_snd_pcm_hw_params_sizeof()); } while (0)
|
||||
|
||||
typedef const char * ( *pfn_snd_asoundlib_version )( void );
|
||||
typedef snd_pcm_sframes_t ( *pfn_snd_pcm_avail_update )( snd_pcm_t *pcm );
|
||||
typedef int ( *pfn_snd_pcm_close )( snd_pcm_t *pcm );
|
||||
|
|
|
@ -137,9 +137,9 @@ bool idAudioHardwareALSA::Initialize( void ) {
|
|||
// set hardware parameters ----------------------------------------------------------------------
|
||||
|
||||
// init hwparams with the full configuration space
|
||||
snd_pcm_hw_params_t *hwparams;
|
||||
// this one is a define
|
||||
id_snd_pcm_hw_params_alloca( &hwparams );
|
||||
snd_pcm_hw_params_t *hwparams = (snd_pcm_hw_params_t *) alloca(id_snd_pcm_hw_params_sizeof());
|
||||
memset(hwparams, 0, id_snd_pcm_hw_params_sizeof());
|
||||
|
||||
if ( ( err = id_snd_pcm_hw_params_any( m_pcm_handle, hwparams ) ) < 0 ) {
|
||||
common->Printf( "cannot configure the PCM device: %s\n", id_snd_strerror( err ) );
|
||||
InitFailed();
|
||||
|
@ -282,6 +282,7 @@ bool idAudioHardwareALSA::Flush( void ) {
|
|||
Sys_Printf( "preparing audio device for output\n" );
|
||||
}
|
||||
Write( true );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue