From 2bad31bbf4a4e86c42bfa0c59ae769271f1cb50d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 20 Apr 2004 13:42:48 +0000 Subject: [PATCH] Fixed bugs detected by Intel compiler --- src/async.c | 2 +- src/control/control.c | 2 +- src/instr/iwffff.c | 10 +++++----- src/pcm/pcm.c | 28 ++++++++++++++-------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/async.c b/src/async.c index 16fd24f3..36768939 100644 --- a/src/async.c +++ b/src/async.c @@ -53,7 +53,7 @@ static void snd_async_handler(int signo ATTRIBUTE_UNUSED, siginfo_t *siginfo, vo { int fd; struct list_head *i; - assert(siginfo->si_code = SI_SIGIO); + assert(siginfo->si_code == SI_SIGIO); fd = siginfo->si_fd; list_for_each(i, &snd_async_handlers) { snd_async_handler_t *h = list_entry(i, snd_async_handler_t, glist); diff --git a/src/control/control.c b/src/control/control.c index 3b4df928..0a6e9a70 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -536,7 +536,7 @@ int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl, */ snd_ctl_t *snd_async_handler_get_ctl(snd_async_handler_t *handler) { - assert(handler->type = SND_ASYNC_HANDLER_CTL); + assert(handler->type == SND_ASYNC_HANDLER_CTL); return handler->u.ctl; } diff --git a/src/instr/iwffff.c b/src/instr/iwffff.c index cf054c10..3af65d42 100644 --- a/src/instr/iwffff.c +++ b/src/instr/iwffff.c @@ -638,10 +638,10 @@ static int load_iw_patch(snd_iwffff_handle_t *iwf, iwffff_instrument_t *instr, gwave->format |= IWFFFF_WAVE_ROM; gwave->address.memory = snd_LE_to_host_32(*(((unsigned int *)wave) + 8/4)); } else { - gwave->share_id[1] = iwf->share_id1; - gwave->share_id[2] = iwf->share_id2; - gwave->share_id[3] = iwf->share_id3; - gwave->share_id[4] = snd_LE_to_host_32(*(((unsigned int *)wave) + 8/4)); + gwave->share_id[0] = iwf->share_id1; + gwave->share_id[1] = iwf->share_id2; + gwave->share_id[2] = iwf->share_id3; + gwave->share_id[3] = snd_LE_to_host_32(*(((unsigned int *)wave) + 8/4)); result = load_iw_wave(iwf, gwave->share_id[2], gwave->size, &gwave->address.ptr); if (result < 0) { free_wave(gwave); @@ -874,10 +874,10 @@ int snd_instr_iwffff_convert_to_stream(snd_instr_iwffff_t *iwffff, xwave = (iwffff_xwave_t *)ptr; ptr += sizeof(*xwave); xwave->stype = IWFFFF_STRU_WAVE; + xwave->share_id[0] = __cpu_to_le32(wave->share_id[0]); xwave->share_id[1] = __cpu_to_le32(wave->share_id[1]); xwave->share_id[2] = __cpu_to_le32(wave->share_id[2]); xwave->share_id[3] = __cpu_to_le32(wave->share_id[3]); - xwave->share_id[4] = __cpu_to_le32(wave->share_id[4]); xwave->format = __cpu_to_le32(wave->format); xwave->size = __cpu_to_le32(wave->size); xwave->start = __cpu_to_le32(wave->start); diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index 94246977..5b12fb10 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -743,20 +743,20 @@ int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) if (!pcm->setup) return -EBADFD; memset(params, 0, snd_pcm_hw_params_sizeof()); - snd_mask_copy(¶ms->masks[SND_PCM_HW_PARAM_ACCESS], (snd_mask_t *)&pcm->access); - snd_mask_copy(¶ms->masks[SND_PCM_HW_PARAM_FORMAT], (snd_mask_t *)&pcm->format); - snd_mask_copy(¶ms->masks[SND_PCM_HW_PARAM_SUBFORMAT], (snd_mask_t *)&pcm->subformat); + snd_mask_copy(¶ms->masks[SND_PCM_HW_PARAM_ACCESS - SNDRV_PCM_HW_PARAM_FIRST_MASK], (snd_mask_t *)&pcm->access); + snd_mask_copy(¶ms->masks[SND_PCM_HW_PARAM_FORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK], (snd_mask_t *)&pcm->format); + snd_mask_copy(¶ms->masks[SND_PCM_HW_PARAM_SUBFORMAT - SNDRV_PCM_HW_PARAM_FIRST_MASK], (snd_mask_t *)&pcm->subformat); frame_bits = snd_pcm_format_physical_width(pcm->format) * pcm->channels; - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_FRAME_BITS], frame_bits); - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_CHANNELS], pcm->channels); - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_RATE], pcm->rate); - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_PERIOD_TIME], pcm->period_time); - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_PERIOD_SIZE], pcm->period_size); - snd_interval_copy(¶ms->intervals[SND_PCM_HW_PARAM_PERIODS], &pcm->periods); - snd_interval_copy(¶ms->intervals[SND_PCM_HW_PARAM_BUFFER_TIME], &pcm->buffer_time); - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_BUFFER_SIZE], pcm->buffer_size); - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_BUFFER_BYTES], (pcm->buffer_size * frame_bits) / 8); - snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_TICK_TIME], pcm->tick_time); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_FRAME_BITS - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], frame_bits); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_CHANNELS - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], pcm->channels); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_RATE - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], pcm->rate); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_PERIOD_TIME - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], pcm->period_time); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_PERIOD_SIZE - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], pcm->period_size); + snd_interval_copy(¶ms->intervals[SND_PCM_HW_PARAM_PERIODS - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], &pcm->periods); + snd_interval_copy(¶ms->intervals[SND_PCM_HW_PARAM_BUFFER_TIME - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], &pcm->buffer_time); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_BUFFER_SIZE - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], pcm->buffer_size); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_BUFFER_BYTES - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], (pcm->buffer_size * frame_bits) / 8); + snd_interval_set_value(¶ms->intervals[SND_PCM_HW_PARAM_TICK_TIME - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL], pcm->tick_time); params->info = pcm->info; params->msbits = pcm->msbits; params->rate_num = pcm->rate_num; @@ -1814,7 +1814,7 @@ int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, */ snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler) { - assert(handler->type = SND_ASYNC_HANDLER_PCM); + assert(handler->type == SND_ASYNC_HANDLER_PCM); return handler->u.pcm; } -- 2.47.1