Why do we need the static?
Had I pasted more source code, you would have known why.
LONG ALSA_WaveInit(void)
{
snd_pcm_t* h = NULL;
snd_pcm_info_t * info;
snd_pcm_hw_params_t * hw_params;
WINE_WAVEOUT* wwo;
char device[] = "hw";wwo = &WOutDev[0];
/* FIXME: use better values */
wwo->device = device;
We have to keep the memory used by device[] or wwo->device even when we exit the function, because we'll access it later. Local variables’ memory are supposed to be freed after the function exits.
