Fix (most) compilation warnings in Intel C++ Compiler (#38)
* Use BACNET_OBJECT_TYPE for all object type variables.
* Fix ICC "mixing enumerated type" warnings for assignments and parameters.
* Network Port: Use enums for state structs and remove erroneous bounds checks copy-pasted from IP_Subnet_Prefix setter.
* Fix ICC "unreachable statement" warnings.
* Fix ICC "unused variable" warnings when printing is disabled.
* Fix ICC "mixing enumerated type" warnings for struct initializers { 0 } by ensuring the first member is an integer type.
* Send_GetEvent_Global: Return 0 (invalid TSM invoke ID) instead of -1 = 255 (technically valid invoke ID) on failure.
* Fix ICC "pointless comparison" warnings.
* Fix wrong import in objects.c (memset being used).
* Fix signedness warnings and inconsistencies. Include -1 = 255 check in cov_address_get().
* Add some guards for BACAPP_LIGHTING_COMMAND to avoid errors/warnings.
* RPM test fixes
* Address requested changes. (#38)
This commit is contained in:
committed by
Steve Karg
parent
76abcaedd1
commit
f8ce70470c
@@ -96,9 +96,12 @@ int bacapp_decode_access_rule(uint8_t *apdu, BACNET_ACCESS_RULE *rule)
|
||||
&apdu[apdu_len], 0, &time_range_specifier);
|
||||
if (len < 0) {
|
||||
return -1;
|
||||
} else {
|
||||
} else if (time_range_specifier < TIME_RANGE_SPECIFIER_MAX) {
|
||||
apdu_len += len;
|
||||
rule->time_range_specifier = time_range_specifier;
|
||||
rule->time_range_specifier =
|
||||
(BACNET_ACCESS_RULE_TIME_RANGE_SPECIFIER)time_range_specifier;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
@@ -123,9 +126,12 @@ int bacapp_decode_access_rule(uint8_t *apdu, BACNET_ACCESS_RULE *rule)
|
||||
&apdu[apdu_len], 2, &location_specifier);
|
||||
if (len < 0) {
|
||||
return -1;
|
||||
} else {
|
||||
} else if (location_specifier < LOCATION_SPECIFIER_MAX) {
|
||||
apdu_len += len;
|
||||
rule->location_specifier = location_specifier;
|
||||
rule->location_specifier =
|
||||
(BACNET_ACCESS_RULE_LOCATION_SPECIFIER)location_specifier;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user