fix compiler warnings for C89 builds (#433)

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2023-05-22 08:49:17 -05:00
committed by GitHub
parent dab95eec3f
commit 682d913686
3 changed files with 10 additions and 10 deletions
+1
View File
@@ -1,6 +1,7 @@
#!/bin/bash
# This script converts any C++ comments to C comments
# using the ccmtcnvt tool from the liwc package
# sudo apt install liwc
CONVERTER=/usr/bin/ccmtcnvt
# silent fail if the tool is not installed
+9 -8
View File
@@ -61,7 +61,7 @@ static int parse_complex_event_type_values(int len, unsigned apdu_len, uint8_t *
}
*/
// TODO this is mostly copied from "cov_notify_decode_service_request" - extract to a common function?
/* TODO this is mostly copied from "cov_notify_decode_service_request" - extract to a common function? */
uint8_t tag_number = 0;
uint32_t len_value = 0;
@@ -71,12 +71,12 @@ static int parse_complex_event_type_values(int len, unsigned apdu_len, uint8_t *
int app_len = 0;
#if (BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS == 1)
BACNET_PROPERTY_VALUE *values;
BACNET_PROPERTY_VALUE *value;
/* we want to extract the values */
BACNET_PROPERTY_VALUE *values = data->notificationParams.complexEventType.values;
values = data->notificationParams.complexEventType.values;
bacapp_property_value_list_init(values, BACNET_COMPLEX_EVENT_TYPE_MAX_PARAMETERS);
BACNET_PROPERTY_VALUE *value = values;
value = values;
for(;;) {
/* tag 0 - propertyIdentifier */
if (len >= (int)apdu_len) {
@@ -151,11 +151,12 @@ static int parse_complex_event_type_values(int len, unsigned apdu_len, uint8_t *
}
}
#else
// we just want to discard the complex values
/* we just want to discard the complex values */
BACNET_PROPERTY_VALUE dummyValue;
bacapp_property_value_list_init(&dummyValue, 1);
BACNET_PROPERTY_VALUE *value = &dummyValue;
BACNET_PROPERTY_VALUE *value;
bacapp_property_value_list_init(&dummyValue, 1);
value = &dummyValue;
for(;;) {
/* tag 0 - propertyIdentifier */
if (len >= (int)apdu_len) {
-2
View File
@@ -49,8 +49,6 @@ typedef enum {
*/
// TODO make these configurable from env?
/** Enable decoding of complex-event-type property-values. If set to 0, the values are decoded and discarded. */
#ifndef BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS
#define BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS 1