Corrected warnings found by splint.

This commit is contained in:
skarg
2009-04-18 17:54:39 +00:00
parent 9051a80e30
commit c17962107c
20 changed files with 204 additions and 200 deletions
+16 -13
View File
@@ -119,7 +119,8 @@ int rpm_encode_apdu(
BACNET_PROPERTY_REFERENCE *rpm_property; /* current property */
len = rpm_encode_apdu_init(&apdu_temp[0], invoke_id);
len = memcopy(&apdu[0], &apdu_temp[0], apdu_len, len, max_apdu);
len = (int)memcopy(&apdu[0], &apdu_temp[0],
(size_t)apdu_len, (size_t)len, (size_t)max_apdu);
if (len == 0) {
return 0;
}
@@ -129,14 +130,16 @@ int rpm_encode_apdu(
len =
encode_context_object_id(&apdu_temp[0], 0, rpm_object->object_type,
rpm_object->object_instance);
len = memcopy(&apdu[0], &apdu_temp[0], apdu_len, len, max_apdu);
len = (int)memcopy(&apdu[0], &apdu_temp[0],
(size_t)apdu_len, (size_t)len, (size_t)max_apdu);
if (len == 0) {
return 0;
}
apdu_len += len;
/* Tag 1: sequence of ReadAccessSpecification */
len = encode_opening_tag(&apdu_temp[0], 1);
len = memcopy(&apdu[0], &apdu_temp[0], apdu_len, len, max_apdu);
len = (int)memcopy(&apdu[0], &apdu_temp[0],
(size_t)apdu_len, (size_t)len, (size_t)max_apdu);
if (len == 0) {
return 0;
}
@@ -147,7 +150,8 @@ int rpm_encode_apdu(
len =
encode_context_enumerated(&apdu_temp[0], 0,
rpm_property->propertyIdentifier);
len = memcopy(&apdu[0], &apdu_temp[0], apdu_len, len, max_apdu);
len = (int)memcopy(&apdu[0], &apdu_temp[0],
(size_t)apdu_len, (size_t)len, (size_t)max_apdu);
if (len == 0) {
return 0;
}
@@ -157,8 +161,8 @@ int rpm_encode_apdu(
len =
encode_context_unsigned(&apdu_temp[0], 1,
rpm_property->propertyArrayIndex);
len =
memcopy(&apdu[0], &apdu_temp[0], apdu_len, len, max_apdu);
len = (int)memcopy(&apdu[0], &apdu_temp[0],
(size_t)apdu_len, (size_t)len, (size_t)max_apdu);
if (len == 0) {
return 0;
}
@@ -167,7 +171,8 @@ int rpm_encode_apdu(
rpm_property = rpm_property->next;
}
len = encode_closing_tag(&apdu_temp[0], 1);
len = memcopy(&apdu[0], &apdu_temp[0], apdu_len, len, max_apdu);
len = (int)memcopy(&apdu[0], &apdu_temp[0],
(size_t)apdu_len, (size_t)len, (size_t)max_apdu);
if (len == 0) {
return 0;
}
@@ -256,9 +261,8 @@ int rpm_decode_object_property(
/* Tag 1: Optional propertyArrayIndex */
if ((len < apdu_len) && decode_is_context_specific(&apdu[len]) &&
(!decode_is_closing_tag(&apdu[len]))) {
option_len =
decode_tag_number_and_value(&apdu[len], &tag_number,
&len_value_type);
option_len = (unsigned)decode_tag_number_and_value(
&apdu[len], &tag_number, &len_value_type);
if (tag_number == 1) {
len += option_len;
len +=
@@ -449,9 +453,8 @@ int rpm_ack_decode_object_property(
/* Tag 3: Optional propertyArrayIndex */
if ((len < apdu_len) && decode_is_context_specific(&apdu[len]) &&
(!decode_is_closing_tag(&apdu[len]))) {
tag_len =
decode_tag_number_and_value(&apdu[len], &tag_number,
&len_value_type);
tag_len = (unsigned)decode_tag_number_and_value(
&apdu[len], &tag_number, &len_value_type);
if (tag_number == 3) {
len += tag_len;
len +=