Fixed some warnings flagged by IAR C-STAT static analysis tool.

This commit is contained in:
skarg
2016-01-07 21:31:38 +00:00
parent dd0fb9c841
commit 0697065030
16 changed files with 51 additions and 52 deletions
+2 -2
View File
@@ -193,13 +193,13 @@ void handler_device_communication_control(
len =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (len <= 0) {
#if PRINT_ENABLED
fprintf(stderr,
"DeviceCommunicationControl: " "Failed to send PDU (%s)!\n",
strerror(errno));
}
#endif
}
return;
}
+2 -2
View File
@@ -162,12 +162,12 @@ void handler_reinitialize_device(
len =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (len <= 0) {
#if PRINT_ENABLED
fprintf(stderr, "ReinitializeDevice: Failed to send PDU (%s)!\n",
strerror(errno));
}
#endif
}
return;
}
+2 -4
View File
@@ -193,13 +193,11 @@ void handler_read_property(
bytes_sent =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (bytes_sent <= 0) {
#if PRINT_ENABLED
fprintf(stderr, "Failed to send PDU (%s)!\n", strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
}
return;
}
+2 -4
View File
@@ -453,11 +453,9 @@ void handler_read_property_multiple(
bytes_sent =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (bytes_sent <= 0) {
#if PRINT_ENABLED
fprintf(stderr, "RPM: Failed to send PDU (%s)!\n", strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
}
}
+2 -4
View File
@@ -136,13 +136,11 @@ void handler_write_property(
bytes_sent =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (bytes_sent <= 0) {
#if PRINT_ENABLED
fprintf(stderr, "WP: Failed to send PDU (%s)!\n", strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
}
return;
}
+6 -6
View File
@@ -79,13 +79,13 @@ void handler_unrecognized_service(
bytes_sent =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (bytes_sent > 0) {
#if PRINT_ENABLED
fprintf(stderr, "Sent Reject!\n");
} else {
fprintf(stderr, "Failed to Send Reject (%s)!\n", strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
} else {
#if PRINT_ENABLED
fprintf(stderr, "Failed to Send Reject (%s)!\n", strerror(errno));
#endif
}
}
+3 -5
View File
@@ -103,13 +103,11 @@ void Send_I_Am(
/* send data */
bytes_sent = datalink_send_pdu(&dest, &npdu_data, &buffer[0], pdu_len);
#if PRINT_ENABLED
if (bytes_sent <= 0) {
#if PRINT_ENABLED
fprintf(stderr, "Failed to Send I-Am Reply (%s)!\n", strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
}
}
/** Encode an I Am message to be unicast directly back to the src.
@@ -189,6 +187,6 @@ void Send_I_Am_Unicast(
if (bytes_sent <= 0)
fprintf(stderr, "Failed to Send I-Am Reply (%s)!\n", strerror(errno));
#else
bytes_sent = bytes_sent;
(void)bytes_sent;
#endif
}
+2 -4
View File
@@ -91,12 +91,10 @@ void Send_I_Have(
bytes_sent =
datalink_send_pdu(&dest, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (bytes_sent <= 0) {
#if PRINT_ENABLED
fprintf(stderr, "Failed to Send I-Have Reply (%s)!\n",
strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
}
}