fixed some unreadVariable Cppcheck warnings

This commit is contained in:
firewave
2026-02-25 12:24:26 +01:00
parent 3db1c993bf
commit 214cf50df5
23 changed files with 57 additions and 83 deletions
+3 -5
View File
@@ -1615,7 +1615,7 @@ devredir_file_create(struct state_create *fusep, tui32 device_id,
{
tui32 DesiredAccess;
tui32 CreateOptions;
tui32 FileAttributes = 0;
tui32 FileAttributes;
tui32 CreateDisposition;
int rval = -1;
IRP *irp;
@@ -1813,14 +1813,13 @@ devredir_file_read(struct state_read *fusep, tui32 DeviceId, tui32 FileId,
tui32 Length, tui64 Offset)
{
struct stream *s;
IRP *irp;
IRP *new_irp;
int bytes;
xstream_new(s, 1024);
/* Check we've got an open IRP for this file already */
if ((irp = devredir_irp_find_by_fileid(FileId)) == NULL)
if (devredir_irp_find_by_fileid(FileId) == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "no IRP found with FileId = %d", FileId);
xfuse_devredir_cb_read_file(fusep, STATUS_UNSUCCESSFUL, NULL, 0);
@@ -1870,7 +1869,6 @@ devredir_file_write(struct state_write *fusep, tui32 DeviceId, tui32 FileId,
const char *buf, int Length, tui64 Offset)
{
struct stream *s;
IRP *irp;
IRP *new_irp;
int bytes;
@@ -1879,7 +1877,7 @@ devredir_file_write(struct state_write *fusep, tui32 DeviceId, tui32 FileId,
xstream_new(s, 1024 + Length);
if ((irp = devredir_irp_find_by_fileid(FileId)) == NULL)
if (devredir_irp_find_by_fileid(FileId) == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "no IRP found with FileId = %d", FileId);
xfuse_devredir_cb_write_file(fusep, STATUS_UNSUCCESSFUL, 0, 0);
+14 -28
View File
@@ -975,11 +975,10 @@ scard_send_ReleaseContext(IRP *irp, char *context, int context_bytes)
{
/* see [MS-RDPESC] 3.1.4.2 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1026,11 +1025,10 @@ scard_send_IsContextValid(IRP *irp, char *context, int context_bytes)
{
/* see [MS-RDPESC] 3.1.4.3 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1138,7 +1136,6 @@ scard_send_ListReaders(IRP *irp, char *context, int context_bytes,
*
*/
SMARTCARD *sc;
struct stream *s;
int bytes;
int bytes_groups = 0; // Length of NDR for groups + 2 terminators
@@ -1146,7 +1143,7 @@ scard_send_ListReaders(IRP *irp, char *context, int context_bytes,
int groups_len = 0; // strlen(groups)
tui32 ioctl;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1357,14 +1354,13 @@ scard_send_GetStatusChange(IRP *irp, char *context, int context_bytes,
* ?? String names pointed to in the above array.
*/
SMARTCARD *sc;
READER_STATE *rs;
struct stream *s;
tui32 ioctl;
int bytes;
unsigned int i;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1507,12 +1503,11 @@ scard_send_Connect(IRP *irp, char *context, int context_bytes,
* ?? Conformant Array pointed to by pbContext
*
*/
SMARTCARD *sc;
struct stream *s;
tui32 ioctl;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1586,11 +1581,10 @@ scard_send_Reconnect(IRP *irp, char *context, int context_bytes,
/* see [MS-RDPESC] 2.2.2.15 */
/* see [MS-RDPESC] 3.1.4.36 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1655,11 +1649,10 @@ scard_send_BeginTransaction(IRP *irp, char *context, int context_bytes,
{
/* see [MS-RDPESC] 4.9 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1721,11 +1714,10 @@ scard_send_EndTransaction(IRP *irp, char *context, int context_bytes,
{
/* see [MS-RDPESC] 3.1.4.32 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1787,12 +1779,11 @@ scard_send_Status(IRP *irp, int wide, char *context, int context_bytes,
{
/* see [MS-RDPESC] 2.2.2.18 */
SMARTCARD *sc;
struct stream *s;
int bytes;
tui32 ioctl;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1872,11 +1863,10 @@ scard_send_Disconnect(IRP *irp, char *context, int context_bytes,
{
/* see [MS-RDPESC] 3.1.4.30 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return;
@@ -1939,12 +1929,11 @@ scard_send_Transmit(IRP *irp, char *context, int context_bytes,
{
/* see [MS-RDPESC] 2.2.2.19 */
SMARTCARD *sc;
struct stream *s;
int bytes;
int val;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return 1;
@@ -2127,12 +2116,11 @@ scard_send_Control(IRP *irp, char *context, int context_bytes,
{
/* see [MS-RDPESC] 2.2.2.19 */
SMARTCARD *sc;
struct stream *s;
int bytes;
int val;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return 1;
@@ -2201,11 +2189,10 @@ scard_send_Cancel(IRP *irp, char *context, int context_bytes)
{
/* see [MS-RDPESC] 3.1.4.27 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return 1;
@@ -2253,11 +2240,10 @@ scard_send_GetAttrib(IRP *irp, char *card, int card_bytes, READER_STATE *rs)
{
/* see [MS-RDPESC] 2.2.2.21 */
SMARTCARD *sc;
struct stream *s;
int bytes;
if ((sc = smartcards[irp->scard_index]) == NULL)
if (smartcards[irp->scard_index] == NULL)
{
LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index);
return 1;
-1
View File
@@ -488,7 +488,6 @@ scard_function_establish_context_return(void *user_data,
return 1;
}
con = uds_client->con;
lcontext = 0;
app_context = 0;
g_memset(context, 0, 16);
if (status == 0)
+1 -1
View File
@@ -100,7 +100,7 @@ static int
process_create_session_response(struct scp_list_item *sli)
{
struct session_item *s_item;
int display = -1;
int display;
struct guid guid;
enum scp_screate_status status;
+1 -1
View File
@@ -582,7 +582,7 @@ process_connect_session_request(struct scp_list_item *sli)
const char *client_ip;
const char *client_name;
unsigned int flags;
enum scp_sconnect_status status = E_SCP_SCONNECT_OK;
enum scp_sconnect_status status;
rv = scp_get_connect_session_request(sli->client_trans, &guid,
&client_ip, &client_name, &flags);
+1 -1
View File
@@ -348,7 +348,7 @@ close_ccp_trans(void)
static int
sesexec_main_loop(void)
{
int error = 0;
int error;
int robjs_count;
intptr_t robjs[MAX_ROBJS];