ld10k1: fix various gcc warnings

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-01-27 09:42:39 +01:00
parent 2420b2a6df
commit 90c2aa2639
6 changed files with 15 additions and 18 deletions

View file

@ -354,7 +354,7 @@ int dump_load(int audigy, char *file_name)
fctrl = (ld10k1_ctl_dump_t *)ptr; fctrl = (ld10k1_ctl_dump_t *)ptr;
memset(ctrl, 0, sizeof(emu10k1_fx8010_control_gpr_t) * header->ctl_count); memset(ctrl, 0, sizeof(emu10k1_fx8010_control_gpr_t) * header->ctl_count);
for (i = 0; i < header->ctl_count; i++) { for (i = 0; i < header->ctl_count; i++) {
strcpy(ctrl[i].id.name, fctrl[i].name); strcpy((char *)ctrl[i].id.name, fctrl[i].name);
ctrl[i].id.iface = EMU10K1_CTL_ELEM_IFACE_MIXER; ctrl[i].id.iface = EMU10K1_CTL_ELEM_IFACE_MIXER;
ctrl[i].id.index = fctrl[i].index; ctrl[i].id.index = fctrl[i].index;
ctrl[i].vcount = fctrl[i].vcount; ctrl[i].vcount = fctrl[i].vcount;

View file

@ -77,7 +77,7 @@ void error(const char *fmt, ...)
va_end(va); va_end(va);
} }
static void log(const char *fmt, ...) static void alog(const char *fmt, ...)
{ {
va_list va; va_list va;
@ -116,7 +116,7 @@ static void cleanup()
{ {
if (pidpath[0]) if (pidpath[0])
unlink(pidpath); unlink(pidpath);
log("Exiting daemon"); alog("Exiting daemon");
} }
static void term_handler(int i) static void term_handler(int i)
@ -247,7 +247,7 @@ int main(int argc, char *argv[])
pidfile = fopen(pidpath, "wt"); pidfile = fopen(pidpath, "wt");
if (!pidfile) { if (!pidfile) {
log("%s: pidfile (%s)\n", strerror(errno), pidpath); alog("%s: pidfile (%s)\n", strerror(errno), pidpath);
return 1; return 1;
} }
@ -263,7 +263,7 @@ int main(int argc, char *argv[])
dup2(fileno(logfile), fileno(stdout)); dup2(fileno(logfile), fileno(stdout));
} }
log("Starting daemon"); alog("Starting daemon");
} }
params.type = uses_pipe ? COMM_TYPE_LOCAL : COMM_TYPE_IP; params.type = uses_pipe ? COMM_TYPE_LOCAL : COMM_TYPE_IP;

View file

@ -199,7 +199,7 @@ int ld10k1_update_driver(ld10k1_dsp_mgr_t *dsp_mgr)
if (!add_ctrl) if (!add_ctrl)
return LD10K1_ERR_NO_MEM; return LD10K1_ERR_NO_MEM;
for (i = 0, item = dsp_mgr->add_ctl_list; item != NULL; item = item->next, i++) { for (i = 0, item = dsp_mgr->add_ctl_list; item != NULL; item = item->next, i++) {
strcpy(add_ctrl[i].id.name, item->ctl.name); strcpy((char *)add_ctrl[i].id.name, item->ctl.name);
add_ctrl[i].id.iface = EMU10K1_CTL_ELEM_IFACE_MIXER; add_ctrl[i].id.iface = EMU10K1_CTL_ELEM_IFACE_MIXER;
add_ctrl[i].id.index = item->ctl.index; add_ctrl[i].id.index = item->ctl.index;
add_ctrl[i].vcount = item->ctl.vcount; add_ctrl[i].vcount = item->ctl.vcount;
@ -225,7 +225,7 @@ int ld10k1_update_driver(ld10k1_dsp_mgr_t *dsp_mgr)
if (!del_ids) if (!del_ids)
return LD10K1_ERR_NO_MEM; return LD10K1_ERR_NO_MEM;
for (i = 0, item = dsp_mgr->del_ctl_list; item != NULL; item = item->next, i++) { for (i = 0, item = dsp_mgr->del_ctl_list; item != NULL; item = item->next, i++) {
strcpy(del_ids[i].name, item->ctl.name); strcpy((char *)del_ids[i].name, item->ctl.name);
del_ids[i].iface = EMU10K1_CTL_ELEM_IFACE_MIXER; del_ids[i].iface = EMU10K1_CTL_ELEM_IFACE_MIXER;
del_ids[i].index = item->ctl.index; del_ids[i].index = item->ctl.index;
} }

View file

@ -2152,7 +2152,7 @@ int ld10k1_conn_point_add(ld10k1_dsp_mgr_t *dsp_mgr, ld10k1_conn_point_t *point,
int allocgprcount = 0; int allocgprcount = 0;
int allocinstrcount = 0; int allocinstrcount = 0;
unsigned int reserved[2]; unsigned int reserved[2];
unsigned int res[2]; int res[2];
int reservedcount = 0; int reservedcount = 0;
int usedreserved = 0; int usedreserved = 0;

View file

@ -792,12 +792,9 @@ int ld10k1_fnc_name_find(int data_conn, int op, int size)
int ld10k1_fnc_name_rename(int data_conn, int op, int size) int ld10k1_fnc_name_rename(int data_conn, int op, int size)
{ {
ld10k1_fnc_name_t name_info; ld10k1_fnc_name_t name_info;
int ret;
int err; int err;
ld10k1_patch_t *patch; ld10k1_patch_t *patch;
ret = -1;
if ((err = receive_msg_data(data_conn, &name_info, sizeof(ld10k1_fnc_name_t))) < 0) if ((err = receive_msg_data(data_conn, &name_info, sizeof(ld10k1_fnc_name_t))) < 0)
return err; return err;

View file

@ -473,8 +473,9 @@ static int transfer_patch(int udin, char *ctrl_opt, liblo10k1_emu_patch_t *ep, l
if (*ctrl_opt != ',') { if (*ctrl_opt != ',') {
error("wrong ctrl option format - wrong separator beetwen subfunctions"); error("wrong ctrl option format - wrong separator beetwen subfunctions");
return 1; return 1;
} else } else {
*ctrl_opt++; ctrl_opt++;
}
} }
} }
@ -691,8 +692,9 @@ static int transfer_native_patch(liblo10k1_dsp_patch_t *p, char *ctrl_opt)
if (*ctrl_opt != ',') { if (*ctrl_opt != ',') {
error("wrong ctrl option format - wrong separator beetwen subfunctions"); error("wrong ctrl option format - wrong separator beetwen subfunctions");
return 1; return 1;
} else } else {
*ctrl_opt++; ctrl_opt++;
}
} }
} }
@ -1466,7 +1468,6 @@ int main(int argc, char *argv[])
int opt_list; int opt_list;
int opt_setup; int opt_setup;
int opt_info;
int opt_add; int opt_add;
int opt_del; int opt_del;
int opt_con_add; int opt_con_add;
@ -1526,7 +1527,6 @@ int main(int argc, char *argv[])
opt_add = 0; opt_add = 0;
opt_del = 0; opt_del = 0;
opt_list_patch = NULL; opt_list_patch = NULL;
opt_info = 0;
opt_con_add = 0; opt_con_add = 0;
opt_con_del = 0; opt_con_del = 0;
opt_debug = 0; opt_debug = 0;
@ -1618,7 +1618,7 @@ int main(int argc, char *argv[])
opt_list_patch = optarg; opt_list_patch = optarg;
break; break;
case 'i': case 'i':
opt_info = 1; /* nothing */
break; break;
case 'q': case 'q':
opt_con_add = 1; opt_con_add = 1;