]> git.alsa-project.org Git - alsa-tools.git/commitdiff
ld10k1: fix various gcc warnings
authorJaroslav Kysela <perex@perex.cz>
Mon, 27 Jan 2025 08:42:39 +0000 (09:42 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 27 Jan 2025 09:44:25 +0000 (10:44 +0100)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ld10k1/src/dl10k1.c
ld10k1/src/ld10k1.c
ld10k1/src/ld10k1_driver.c
ld10k1/src/ld10k1_fnc.c
ld10k1/src/ld10k1_fnc1.c
ld10k1/src/lo10k1.c

index 42d54a1ccf26a8c4cfe2c704d8f1d85e3ecc7079..b2f3a540bd409b458a47a94dd7a7aa1245c2943e 100644 (file)
@@ -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;
index b0b5a9b8a1109b297a7e8cc2284b2b7e2557682a..97be2c0d2a8a8d3806f7decb3388b5d44ccf78a5 100644 (file)
@@ -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;
index 38ee8736c585af0bcde3997ffe30a255caab68c6..05b141517041340572bf2935e58e55d81f2166af 100644 (file)
@@ -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;
                }
index c88f4c02fe71ec9d76ca0e8674748219337b74a3..7e99d553bae2c31ee571253414766203983fa22a 100644 (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 allocinstrcount = 0;
        unsigned int reserved[2];
-       unsigned int res[2];
+       int res[2];
        int reservedcount = 0;
        int usedreserved = 0;
 
index ddc43c61a045f81da3bca438aff4b041107886be..c3ea754b4d67d7443157d38566d9fe5aea697e09 100644 (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)
 {
        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;
 
index 93a9369c974d30a4ee119bfcb3cfa1974d7cd7b5..c1223cbda3ea42923e6a2911e108343f9a43c624 100644 (file)
@@ -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;