auich: Fix warnings, enable -Werror

Change-Id: I03a686d124444d60b92b34c1b7a10d73c872c21d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7606
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Muhamed Emad 2024-04-07 11:49:35 +02:00 committed by waddlesplash
parent c237c4ce59
commit 6f52406a73
3 changed files with 19 additions and 18 deletions

View File

@ -674,7 +674,7 @@ rule ArchitectureSetupWarnings architecture
EnableWerror src add-ons kernel console ;
EnableWerror src add-ons kernel cpu ;
EnableWerror src add-ons kernel debugger ;
# EnableWerror src add-ons kernel drivers audio ac97 ;
EnableWerror src add-ons kernel drivers audio ac97 auich ;
# EnableWerror src add-ons kernel drivers audio cmedia ;
# EnableWerror src add-ons kernel drivers audio echo ;
# EnableWerror src add-ons kernel drivers audio emuxki ;

View File

@ -182,9 +182,10 @@ auich_ac97_set_mix(void *card, const void *cookie, int32 type, float *values) {
static int32
auich_create_group_control(multi_dev *multi, int32 *index, int32 parent,
int32 string, const char* name) {
int32 i = *index;
auich_create_group_control(multi_dev *multi, uint32 *index, int32 parent, int32 string,
const char* name)
{
uint32 i = *index;
(*index)++;
multi->controls[i].mix_control.id = EMU_MULTI_CONTROL_FIRSTID + i;
multi->controls[i].mix_control.parent = parent;
@ -201,7 +202,7 @@ auich_create_group_control(multi_dev *multi, int32 *index, int32 parent,
static status_t
auich_create_controls_list(multi_dev *multi)
{
uint32 i = 0, index = 0, count, id, parent, parent2, parent3;
uint32 i = 0, index = 0, count, id, parent, parent2, parent3;
const ac97_source_info *info;
/* AC97 Mixer */
@ -397,7 +398,7 @@ auich_get_mix(auich_dev *card, multi_mix_value_info * mmvi)
multi_mixer_control *control = NULL;
for (i = 0; i < mmvi->item_count; i++) {
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
if (id < 0 || (uint32)id >= card->multi.control_count) {
PRINT(("auich_get_mix : "
"invalid control id requested : %" B_PRIi32 "\n", id));
continue;
@ -438,7 +439,7 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
multi_mixer_control *control = NULL;
for (i = 0; i < mmvi->item_count; i++) {
id = mmvi->values[i].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
if (id < 0 || (uint32)id >= card->multi.control_count) {
PRINT(("auich_set_mix : "
"invalid control id requested : %" B_PRIi32 "\n", id));
continue;
@ -449,7 +450,7 @@ auich_set_mix(auich_dev *card, multi_mix_value_info * mmvi)
multi_mixer_control *control2 = NULL;
if (i+1<mmvi->item_count) {
id = mmvi->values[i + 1].id - EMU_MULTI_CONTROL_FIRSTID;
if (id < 0 || id >= card->multi.control_count) {
if (id < 0 || (uint32)id >= card->multi.control_count) {
PRINT(("auich_set_mix : "
"invalid control id requested : %" B_PRIi32 "\n", id));
} else {
@ -501,7 +502,7 @@ static status_t
auich_list_mix_controls(auich_dev *card, multi_mix_control_info * mmci)
{
multi_mix_control *mmc;
int32 i;
uint32 i;
mmc = mmci->controls;
if (mmci->control_count < 24)
@ -509,9 +510,9 @@ auich_list_mix_controls(auich_dev *card, multi_mix_control_info * mmci)
if (auich_create_controls_list(&card->multi) < B_OK)
return B_ERROR;
for (i = 0; i < card->multi.control_count; i++) {
for (i = 0; i < card->multi.control_count; i++)
mmc[i] = card->multi.controls[i].mix_control;
}
mmci->control_count = card->multi.control_count;
return B_OK;
@ -582,7 +583,7 @@ auich_create_channels_list(multi_dev *multi)
chans = multi->chans;
index = 0;
for (mode=AUICH_USE_PLAY; mode!=-1;
for (mode = AUICH_USE_PLAY; (int32)mode != -1;
mode = (mode == AUICH_USE_PLAY) ? AUICH_USE_RECORD : -1) {
LIST_FOREACH(stream, &((auich_dev*)multi->card)->streams, next) {
if ((stream->use & mode) == 0)
@ -595,18 +596,18 @@ auich_create_channels_list(multi_dev *multi)
for (i = 0; i < stream->channels; i++) {
chans[index].channel_id = index;
chans[index].kind = (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
chans[index].kind
= (mode == AUICH_USE_PLAY) ? B_MULTI_OUTPUT_CHANNEL : B_MULTI_INPUT_CHANNEL;
chans[index].designations = designations | chan_designations[i];
chans[index].connectors = 0;
index++;
}
}
if (mode==AUICH_USE_PLAY) {
if (mode == AUICH_USE_PLAY)
multi->output_channel_count = index;
} else {
else
multi->input_channel_count = index - multi->output_channel_count;
}
}
chans[index].channel_id = index;
@ -690,7 +691,7 @@ auich_get_description(auich_dev *card, multi_description *data)
// channels and input bus channels and finally auxillary channels,
LOG(("request_channel_count = %d\n",data->request_channel_count));
if (data->request_channel_count >= size) {
if (data->request_channel_count >= (int32)size) {
LOG(("copying data\n"));
memcpy(data->channels, card->multi.chans, size * sizeof(card->multi.chans[0]));
}

View File

@ -121,7 +121,7 @@ map_mem(void **log, phys_addr_t phy, size_t size, const char *name)
size = round_to_pagesize(size + offset);
area = map_physical_memory(name, phyadr, size, B_ANY_KERNEL_ADDRESS,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &mapadr);
*log = mapadr + offset;
*log = (void *)((uintptr_t)mapadr + (uintptr_t)offset);
LOG(("physical = %p, logical = %p, offset = %#x, phyadr = %p, mapadr = %p, size = %#x, area = %#x\n",
phy, *log, offset, phyadr, mapadr, size, area));