Bugfix/c89 compile fixes (#327)

* Fix code to be able to compile with older C89 ANSI compilers

* Convert C++ comments to C89 comments.

* default to std=gnu89

* Fix to enable CMake 3.1 to build on Centos7

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2022-08-23 13:37:32 -05:00
committed by GitHub
parent 065d0334ee
commit 95b487ea6f
16 changed files with 85 additions and 56 deletions
+5 -5
View File
@@ -1521,11 +1521,11 @@ bool Channel_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
}
break;
case PROP_LIST_OF_OBJECT_PROPERTY_REFERENCES:
// FIXME: add property handling
// status =
// Channel_List_Of_Object_Property_References_Set(
// wp_data,
// &value);
/* FIXME: add property handling */
/* status = */
/* Channel_List_Of_Object_Property_References_Set( */
/* wp_data, */
/* &value); */
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code =
ERROR_CODE_OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED;
+2 -2
View File
@@ -394,10 +394,10 @@ bool Lighting_Output_Lighting_Command_Set(
index = Lighting_Output_Instance_To_Index(object_instance);
if (index < MAX_LIGHTING_OUTPUTS) {
// FIXME: check lighting command member values
/* FIXME: check lighting command member values */
status = lighting_command_copy(
&Lighting_Output[index].Lighting_Command, value);
// FIXME: set all the other values, and get the light levels moving
/* FIXME: set all the other values, and get the light levels moving */
}
return status;
+2 -1
View File
@@ -86,6 +86,7 @@ void Notification_Class_Property_Lists(
void Notification_Class_Init(void)
{
uint8_t NotifyIdx = 0;
unsigned i;
for (NotifyIdx = 0; NotifyIdx < MAX_NOTIFICATION_CLASSES; NotifyIdx++) {
/* init with zeros */
@@ -99,7 +100,7 @@ void Notification_Class_Init(void)
NC_Info[NotifyIdx].Priority[TRANSITION_TO_NORMAL] =
255; /* PRINTF lowest priority for Normal message. */
/* configure for every day, all day long */
for (unsigned i = 0; i < MAX_BACNET_DAYS_OF_WEEK; i++) {
for (i = 0; i < MAX_BACNET_DAYS_OF_WEEK; i++) {
NC_Info[NotifyIdx].Recipient_List->ValidDays |= (1<<i);
}
NC_Info[NotifyIdx].Recipient_List->FromTime.hour = 0;
+3 -3
View File
@@ -674,15 +674,15 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
len = bacapp_decode_device_obj_property_ref(
wp_data->application_data, &TempSource);
if ((len < 0) ||
(len > wp_data->application_data_len)) // Hmm, that didn't go
// as planned...
(len > wp_data->application_data_len)) /* Hmm, that didn't go */
/* as planned... */
{
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_OTHER;
break;
}
// We only support references to objects in ourself for now
/* We only support references to objects in ourself for now */
if ((TempSource.deviceIdentifier.type == OBJECT_DEVICE) &&
(TempSource.deviceIdentifier.instance !=
Device_Object_Instance_Number())) {