Bugfix/code clean using gcc warnings (#371)
* Enable extra GCC warnings to discover subtle bugs * convert c++ comments to c comments * cleanup pedantic compiler warnings * Compile apps with GNU89 GNU99 GNU11 and GNU17 Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
@@ -79,6 +79,7 @@ int bacnet_time_value_encode(uint8_t *apdu, BACNET_TIME_VALUE *value)
|
||||
int len;
|
||||
int apdu_len = 0;
|
||||
uint8_t *apdu_offset = NULL;
|
||||
BACNET_APPLICATION_DATA_VALUE adv;
|
||||
|
||||
if (!value || !is_data_value_schedule_compatible(value->Value.tag)) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
@@ -93,10 +94,7 @@ int bacnet_time_value_encode(uint8_t *apdu, BACNET_TIME_VALUE *value)
|
||||
if (apdu) {
|
||||
apdu_offset = &apdu[apdu_len];
|
||||
}
|
||||
|
||||
BACNET_APPLICATION_DATA_VALUE adv;
|
||||
bacnet_primitive_to_application_data_value(&adv, &value->Value);
|
||||
|
||||
len = bacapp_encode_application_data(apdu_offset, &adv);
|
||||
apdu_len += len;
|
||||
|
||||
@@ -147,7 +145,7 @@ int bacnet_application_to_primitive_data_value(
|
||||
struct BACnet_Primitive_Data_Value *dest,
|
||||
const struct BACnet_Application_Data_Value *src)
|
||||
{
|
||||
// make sure the value passed is valid
|
||||
/* make sure the value passed is valid */
|
||||
if (!src || !dest || !is_data_value_schedule_compatible(src->tag)) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
@@ -162,7 +160,7 @@ int bacnet_primitive_to_application_data_value(
|
||||
struct BACnet_Application_Data_Value *dest,
|
||||
const struct BACnet_Primitive_Data_Value *src)
|
||||
{
|
||||
// make sure the value passed is valid
|
||||
/* make sure the value passed is valid */
|
||||
if (!dest || !src) {
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user