From 90c2aa263906492bd511d929feeb14ddf162d02d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 27 Jan 2025 09:42:39 +0100 Subject: [PATCH] ld10k1: fix various gcc warnings Signed-off-by: Jaroslav Kysela --- ld10k1/src/dl10k1.c | 2 +- ld10k1/src/ld10k1.c | 8 ++++---- ld10k1/src/ld10k1_driver.c | 4 ++-- ld10k1/src/ld10k1_fnc.c | 2 +- ld10k1/src/ld10k1_fnc1.c | 3 --- ld10k1/src/lo10k1.c | 14 +++++++------- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/ld10k1/src/dl10k1.c b/ld10k1/src/dl10k1.c index 42d54a1..b2f3a54 100644 --- a/ld10k1/src/dl10k1.c +++ b/ld10k1/src/dl10k1.c @@ -354,7 +354,7 @@ int dump_load(int audigy, char *file_name) fctrl = (ld10k1_ctl_dump_t *)ptr; memset(ctrl, 0, sizeof(emu10k1_fx8010_control_gpr_t) * header->ctl_count); 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.index = fctrl[i].index; ctrl[i].vcount = fctrl[i].vcount; diff --git a/ld10k1/src/ld10k1.c b/ld10k1/src/ld10k1.c index b0b5a9b..97be2c0 100644 --- a/ld10k1/src/ld10k1.c +++ b/ld10k1/src/ld10k1.c @@ -77,7 +77,7 @@ void error(const char *fmt, ...) va_end(va); } -static void log(const char *fmt, ...) +static void alog(const char *fmt, ...) { va_list va; @@ -116,7 +116,7 @@ static void cleanup() { if (pidpath[0]) unlink(pidpath); - log("Exiting daemon"); + alog("Exiting daemon"); } static void term_handler(int i) @@ -247,7 +247,7 @@ int main(int argc, char *argv[]) pidfile = fopen(pidpath, "wt"); if (!pidfile) { - log("%s: pidfile (%s)\n", strerror(errno), pidpath); + alog("%s: pidfile (%s)\n", strerror(errno), pidpath); return 1; } @@ -263,7 +263,7 @@ int main(int argc, char *argv[]) dup2(fileno(logfile), fileno(stdout)); } - log("Starting daemon"); + alog("Starting daemon"); } params.type = uses_pipe ? COMM_TYPE_LOCAL : COMM_TYPE_IP; diff --git a/ld10k1/src/ld10k1_driver.c b/ld10k1/src/ld10k1_driver.c index 38ee873..05b1415 100644 --- a/ld10k1/src/ld10k1_driver.c +++ b/ld10k1/src/ld10k1_driver.c @@ -199,7 +199,7 @@ int ld10k1_update_driver(ld10k1_dsp_mgr_t *dsp_mgr) if (!add_ctrl) return LD10K1_ERR_NO_MEM; 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.index = item->ctl.index; add_ctrl[i].vcount = item->ctl.vcount; @@ -225,7 +225,7 @@ int ld10k1_update_driver(ld10k1_dsp_mgr_t *dsp_mgr) if (!del_ids) return LD10K1_ERR_NO_MEM; 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].index = item->ctl.index; } diff --git a/ld10k1/src/ld10k1_fnc.c b/ld10k1/src/ld10k1_fnc.c index c88f4c0..7e99d55 100644 --- a/ld10k1/src/ld10k1_fnc.c +++ b/ld10k1/src/ld10k1_fnc.c @@ -2152,7 +2152,7 @@ int ld10k1_conn_point_add(ld10k1_dsp_mgr_t *dsp_mgr, ld10k1_conn_point_t *point, int allocgprcount = 0; int allocinstrcount = 0; unsigned int reserved[2]; - unsigned int res[2]; + int res[2]; int reservedcount = 0; int usedreserved = 0; diff --git a/ld10k1/src/ld10k1_fnc1.c b/ld10k1/src/ld10k1_fnc1.c index ddc43c6..c3ea754 100644 --- a/ld10k1/src/ld10k1_fnc1.c +++ b/ld10k1/src/ld10k1_fnc1.c @@ -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) { ld10k1_fnc_name_t name_info; - int ret; int err; ld10k1_patch_t *patch; - ret = -1; - if ((err = receive_msg_data(data_conn, &name_info, sizeof(ld10k1_fnc_name_t))) < 0) return err; diff --git a/ld10k1/src/lo10k1.c b/ld10k1/src/lo10k1.c index 93a9369..c1223cb 100644 --- a/ld10k1/src/lo10k1.c +++ b/ld10k1/src/lo10k1.c @@ -473,8 +473,9 @@ static int transfer_patch(int udin, char *ctrl_opt, liblo10k1_emu_patch_t *ep, l if (*ctrl_opt != ',') { error("wrong ctrl option format - wrong separator beetwen subfunctions"); return 1; - } else - *ctrl_opt++; + } else { + ctrl_opt++; + } } } @@ -691,8 +692,9 @@ static int transfer_native_patch(liblo10k1_dsp_patch_t *p, char *ctrl_opt) if (*ctrl_opt != ',') { error("wrong ctrl option format - wrong separator beetwen subfunctions"); return 1; - } else - *ctrl_opt++; + } else { + ctrl_opt++; + } } } @@ -1466,7 +1468,6 @@ int main(int argc, char *argv[]) int opt_list; int opt_setup; - int opt_info; int opt_add; int opt_del; int opt_con_add; @@ -1526,7 +1527,6 @@ int main(int argc, char *argv[]) opt_add = 0; opt_del = 0; opt_list_patch = NULL; - opt_info = 0; opt_con_add = 0; opt_con_del = 0; opt_debug = 0; @@ -1618,7 +1618,7 @@ int main(int argc, char *argv[]) opt_list_patch = optarg; break; case 'i': - opt_info = 1; + /* nothing */ break; case 'q': opt_con_add = 1; -- 2.47.1