From 9ebbc37f2ee40985b3fa3cca69ab72bc395b0f1c Mon Sep 17 00:00:00 2001 From: KrahJohlito Date: Tue, 17 Aug 2021 10:51:25 +0930 Subject: [PATCH] variable 'varname' is assigned a value that is never used --- labs/genvmclab/genvmclab.c | 30 ++++++++++++++-------------- labs/lwnbdsvr/lwnbdsvrlab.c | 24 +++++++++++----------- labs/smblab/smblab.c | 24 +++++++++++----------- modules/debug/ps2link/net_fio.c | 5 ----- modules/iopcore/cdvdman/hdpro_atad.c | 2 +- modules/isofs/isofs.c | 2 -- modules/network/SMSTCPIP/tcp.c | 1 - src/gui.c | 2 +- 8 files changed, 41 insertions(+), 49 deletions(-) diff --git a/labs/genvmclab/genvmclab.c b/labs/genvmclab/genvmclab.c index 72458f540..62f501164 100644 --- a/labs/genvmclab/genvmclab.c +++ b/labs/genvmclab/genvmclab.c @@ -88,7 +88,7 @@ void set_ipconfig(void) //-------------------------------------------------------------- int main(int argc, char *argv[2]) { - int ret, id; + int ret; init_scr(); scr_clear(); @@ -130,59 +130,59 @@ int main(int argc, char *argv[2]) // HomeBrew mcman required by genvmc for VMCcopy function to work (on my V3, mcman // from ROM is buggy and we can't read MC pages directly) DPRINTF("loading mcman... "); - id = SifExecModuleBuffer(&mcman_irx, size_mcman_irx, 0, NULL, &ret); + SifExecModuleBuffer(&mcman_irx, size_mcman_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading iomanX... "); - id = SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret); + SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading fileXio... "); - id = SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret); + SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading poweroff... "); // modules for debugging - id = SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret); + SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading ps2dev9... "); - id = SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading smsutils... "); - id = SifExecModuleBuffer(&smsutils_irx, size_smsutils_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smsutils_irx, size_smsutils_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading smstcpip... "); - id = SifExecModuleBuffer(&smstcpip_irx, size_smstcpip_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smstcpip_irx, size_smstcpip_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading smsmap... "); - id = SifExecModuleBuffer(&smsmap_irx, size_smsmap_irx, g_ipconfig_len, g_ipconfig, &ret); + SifExecModuleBuffer(&smsmap_irx, size_smsmap_irx, g_ipconfig_len, g_ipconfig, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading udptty... "); - id = SifExecModuleBuffer(&udptty_irx, size_udptty_irx, 0, NULL, &ret); + SifExecModuleBuffer(&udptty_irx, size_udptty_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading ioptrap... "); - id = SifExecModuleBuffer(&ioptrap_irx, size_ioptrap_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ioptrap_irx, size_ioptrap_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading ps2link... "); - id = SifExecModuleBuffer(&ps2link_irx, size_ps2link_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ps2link_irx, size_ps2link_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading genvmc... "); // the module in testing - id = SifExecModuleBuffer(&genvmc_irx, size_genvmc_irx, 0, NULL, &ret); + SifExecModuleBuffer(&genvmc_irx, size_genvmc_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading usbd... "); // usb drivers needed to create file on it - id = SifExecModuleBuffer(&usbd_irx, size_usbd_irx, 0, NULL, &ret); + SifExecModuleBuffer(&usbd_irx, size_usbd_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading usbhdfsd... "); - id = SifExecModuleBuffer(&usbhdfsd_irx, size_usbhdfsd_irx, 0, NULL, &ret); + SifExecModuleBuffer(&usbhdfsd_irx, size_usbhdfsd_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); delay(3); // some delay is required by usb mass storage driver diff --git a/labs/lwnbdsvr/lwnbdsvrlab.c b/labs/lwnbdsvr/lwnbdsvrlab.c index 0d66b6e10..243991ac3 100644 --- a/labs/lwnbdsvr/lwnbdsvrlab.c +++ b/labs/lwnbdsvr/lwnbdsvrlab.c @@ -72,7 +72,7 @@ void set_ipconfig(void) //-------------------------------------------------------------- int main(int argc, char *argv[2]) { - int ret, id; + int ret; init_scr(); scr_clear(); @@ -112,17 +112,17 @@ int main(int argc, char *argv[2]) scr_printf("\t loading modules... "); - id = SifExecModuleBuffer(&discid_irx, size_discid_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&smsutils_irx, size_smsutils_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&smstcpip_irx, size_smstcpip_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&smsmap_irx, size_smsmap_irx, g_ipconfig_len, g_ipconfig, &ret); - id = SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, &ret); - id = SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, &ret); - id = SifExecModuleBuffer(&lwnbdsvr_irx, size_lwnbdsvr_irx, 0, NULL, &ret); + SifExecModuleBuffer(&discid_irx, size_discid_irx, 0, NULL, &ret); + SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret); + SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret); + SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smsutils_irx, size_smsutils_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smstcpip_irx, size_smstcpip_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smsmap_irx, size_smsmap_irx, g_ipconfig_len, g_ipconfig, &ret); + SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, &ret); + SifExecModuleBuffer(&lwnbdsvr_irx, size_lwnbdsvr_irx, 0, NULL, &ret); scr_printf("OK\n"); diff --git a/labs/smblab/smblab.c b/labs/smblab/smblab.c index 37b35fb91..48168f105 100644 --- a/labs/smblab/smblab.c +++ b/labs/smblab/smblab.c @@ -127,7 +127,7 @@ void set_ipconfig(void) //-------------------------------------------------------------- int main(int argc, char *argv[2]) { - int i, ret, id; + int i, ret; init_scr(); scr_clear(); @@ -167,47 +167,47 @@ int main(int argc, char *argv[2]) set_ipconfig(); DPRINTF("loading iomanX... "); - id = SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret); + SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading fileXio... "); - id = SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret); + SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading poweroff... "); - id = SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret); + SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading ps2dev9... "); - id = SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading smsutils... "); - id = SifExecModuleBuffer(&smsutils_irx, size_smsutils_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smsutils_irx, size_smsutils_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading smstcpip... "); - id = SifExecModuleBuffer(&smstcpip_irx, size_smstcpip_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smstcpip_irx, size_smstcpip_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading smsmap... "); - id = SifExecModuleBuffer(&smsmap_irx, size_smsmap_irx, g_ipconfig_len, g_ipconfig, &ret); + SifExecModuleBuffer(&smsmap_irx, size_smsmap_irx, g_ipconfig_len, g_ipconfig, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading udptty... "); - id = SifExecModuleBuffer(&udptty_irx, size_udptty_irx, 0, NULL, &ret); + SifExecModuleBuffer(&udptty_irx, size_udptty_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading ioptrap... "); - id = SifExecModuleBuffer(&ioptrap_irx, size_ioptrap_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ioptrap_irx, size_ioptrap_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading ps2link... "); - id = SifExecModuleBuffer(&ps2link_irx, size_ps2link_irx, 0, NULL, &ret); + SifExecModuleBuffer(&ps2link_irx, size_ps2link_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("loading smbman... "); - id = SifExecModuleBuffer(&smbman_irx, size_smbman_irx, 0, NULL, &ret); + SifExecModuleBuffer(&smbman_irx, size_smbman_irx, 0, NULL, &ret); DPRINTF("ret=%d\n", ret); DPRINTF("modules load OK\n"); diff --git a/modules/debug/ps2link/net_fio.c b/modules/debug/ps2link/net_fio.c index 29b8a9782..ec63a305f 100644 --- a/modules/debug/ps2link/net_fio.c +++ b/modules/debug/ps2link/net_fio.c @@ -362,7 +362,6 @@ int pko_write_file(int fd, char *buf, int length) // int pko_read_file(int fd, char *buf, int length) { - int readbytes; int nbytes; int i; pko_pkt_read_req *readcmd; @@ -375,14 +374,11 @@ int pko_read_file(int fd, char *buf, int length) readcmd = (pko_pkt_read_req *)&send_packet[0]; readrly = (pko_pkt_read_rly *)&recv_packet[0]; - readbytes = 0; readcmd->cmd = htonl(PKO_READ_CMD); readcmd->len = htons((unsigned short)sizeof(pko_pkt_read_req)); readcmd->fd = htonl(fd); - readbytes = 0; - if (length < 0) { dbgprintf("pko_read_file: illegal req!! (whish to read < 0 bytes!)\n"); return -1; @@ -415,7 +411,6 @@ int pko_read_file(int fd, char *buf, int length) return -1; } return nbytes; - return readbytes; } //---------------------------------------------------------------------- diff --git a/modules/iopcore/cdvdman/hdpro_atad.c b/modules/iopcore/cdvdman/hdpro_atad.c index 9edb6ceb6..00fe6a74d 100644 --- a/modules/iopcore/cdvdman/hdpro_atad.c +++ b/modules/iopcore/cdvdman/hdpro_atad.c @@ -386,7 +386,7 @@ static int ata_device_select(int device) /* Select the device. */ hdpro_io_write(ATAreg_SELECT_WR, (device & 1) << 4); - res = hdpro_io_read(ATAreg_CONTROL_RD); + hdpro_io_read(ATAreg_CONTROL_RD); return ata_wait_bus_busy(); } diff --git a/modules/isofs/isofs.c b/modules/isofs/isofs.c index 4b5d6b5e6..02368bc6d 100644 --- a/modules/isofs/isofs.c +++ b/modules/isofs/isofs.c @@ -165,8 +165,6 @@ static void cdvdman_trimspaces(char *str) if (len == 0) return; - i = len - 1; - for (i = len - 1; i != -1; i--) { p = &str[i]; if ((*p != 0x20) && (*p != 0x2e)) diff --git a/modules/network/SMSTCPIP/tcp.c b/modules/network/SMSTCPIP/tcp.c index 42c06b6fd..39a797d11 100644 --- a/modules/network/SMSTCPIP/tcp.c +++ b/modules/network/SMSTCPIP/tcp.c @@ -816,7 +816,6 @@ tcp_seg_copy(struct tcp_seg *seg) static err_t tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) { - arg = arg; if (p != NULL) { pbuf_free(p); } else if (err == ERR_OK) { diff --git a/src/gui.c b/src/gui.c index 0ba9aa780..5b5fd7d8a 100644 --- a/src/gui.c +++ b/src/gui.c @@ -1290,7 +1290,7 @@ void guiDrawSubMenuHints(void) x = guiDrawIconAndText(gSelectButton == KEY_CIRCLE ? subMenuIcons[0] : subMenuIcons[1], subMenuHints[0], gTheme->fonts[0], x, y, gTheme->textColor); x += 12; - x = guiDrawIconAndText(gSelectButton == KEY_CIRCLE ? subMenuIcons[1] : subMenuIcons[0], subMenuHints[1], gTheme->fonts[0], x, y, gTheme->textColor); + guiDrawIconAndText(gSelectButton == KEY_CIRCLE ? subMenuIcons[1] : subMenuIcons[0], subMenuHints[1], gTheme->fonts[0], x, y, gTheme->textColor); } static int endIntro = 0; // Break intro loop and start 'Last Played Auto Start' countdown