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:
Geert Linders
2020-01-23 15:18:47 +01:00
committed by Steve Karg
parent 76abcaedd1
commit f8ce70470c
92 changed files with 438 additions and 263 deletions
+5 -5
View File
@@ -232,14 +232,14 @@ unsigned Channel_Last_Priority(uint32_t object_instance)
BACNET_WRITE_STATUS Channel_Write_Status(uint32_t object_instance)
{
unsigned index = 0;
unsigned priority = 0;
BACNET_WRITE_STATUS write_status = BACNET_WRITE_STATUS_IDLE;
index = Channel_Instance_To_Index(object_instance);
if (index < BACNET_CHANNELS_MAX) {
priority = Channel[index].Write_Status;
write_status = Channel[index].Write_Status;
}
return priority;
return write_status;
}
/**
@@ -451,12 +451,12 @@ unsigned Channel_Reference_List_Member_Element_Add(uint32_t object_instance,
* zero if not added
*/
unsigned Channel_Reference_List_Member_Local_Add(uint32_t object_instance,
uint16_t type,
BACNET_OBJECT_TYPE type,
uint32_t instance,
BACNET_PROPERTY_ID propertyIdentifier,
uint32_t arrayIndex)
{
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE member = { { 0 } };
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE member = { 0 };
member.objectIdentifier.type = type;
member.objectIdentifier.instance = instance;