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:
Steve Karg
2022-12-25 21:43:51 -06:00
committed by GitHub
parent 0728bc4390
commit b91735af13
66 changed files with 990 additions and 847 deletions
+4 -8
View File
@@ -20,10 +20,6 @@
#include "bacnet/bacreal.h"
#include "bacnet/lighting.h"
#ifndef islessgreater
#define islessgreater(x, y) ((x) < (y) || (x) > (y))
#endif
/** @file lighting.c Manipulate BACnet lighting command values */
/**
@@ -604,8 +600,8 @@ bool xy_color_same(BACNET_XY_COLOR *value1, BACNET_XY_COLOR *value2)
bool status = false;
if (value1 && value2) {
if ((value1->x_coordinate == value2->x_coordinate) &&
(value1->y_coordinate == value2->y_coordinate)) {
if (!islessgreater(value1->x_coordinate, value2->x_coordinate) &&
!islessgreater(value1->y_coordinate, value2->y_coordinate)) {
status = true;
}
}
@@ -1096,9 +1092,9 @@ bool color_command_same(
status = true;
break;
case BACNET_COLOR_OPERATION_FADE_TO_COLOR:
if ((value1->target.color.x_coordinate ==
if (!islessgreater(value1->target.color.x_coordinate,
value2->target.color.x_coordinate) &&
(value1->target.color.y_coordinate ==
!islessgreater(value1->target.color.y_coordinate,
value2->target.color.y_coordinate) &&
(value1->transit.fade_time == value2->transit.fade_time)) {
status = true;