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
+31 -32
View File
@@ -101,33 +101,43 @@ static void Init_Service_Handlers(void)
static void print_usage(char *filename)
{
printf("Usage: %s [--dnet][--dadr][--mac]\n", filename);
printf(" [--date][--time]\n");
printf(" [--version][--help]\n");
}
static void print_help(char *filename)
{
printf("Send BACnet TimeSynchronization request.\n"
"\n"
"--mac A\n"
"BACnet mac address."
"Valid ranges are from 0 to 255\n"
"or an IP string with optional port number like 10.1.2.3:47808\n"
"or an Ethernet MAC in hex like 00:21:70:7e:32:bb\n"
"\n"
"--dnet N\n"
"BACnet network number N for directed requests.\n"
"Valid range is from 0 to 65535 where 0 is the local connection\n"
"and 65535 is network broadcast.\n"
"\n"
"--dadr A\n"
"BACnet mac address on the destination BACnet network number.\n"
"Valid ranges are from 0 to 255\n"
"or an IP string with optional port number like 10.1.2.3:47808\n"
"or an Ethernet MAC in hex like 00:21:70:7e:32:bb\n"
"\n");
printf("Send BACnet TimeSynchronization request.\n");
printf("\n");
printf("--date year/month/day[:weekday]\n"
"Date formatted 2021/12/31 or 2021/12/31:1\n"
"where day is 1..31,\n"
"where month is 1=January..12=December,\n"
"where weekday is 1=Monday..7=Sunday\n");
printf("\n");
printf("--time hours:minutes:seconds.hundredths\n"
"Time formatted 23:59:59.99 or 23:59:59 or 23:59\n");
printf("\n");
printf("--mac A\n"
"BACnet mac address."
"Valid ranges are from 0 to 255\n"
"or an IP string with optional port number like 10.1.2.3:47808\n"
"or an Ethernet MAC in hex like 00:21:70:7e:32:bb\n");
printf("\n");
printf("--dnet N\n"
"BACnet network number N for directed requests.\n"
"Valid range is from 0 to 65535 where 0 is the local connection\n"
"and 65535 is network broadcast.\n");
printf("\n");
printf("--dadr A\n"
"BACnet mac address on the destination BACnet network number.\n"
"Valid ranges are from 0 to 255\n"
"or an IP string with optional port number like 10.1.2.3:47808\n"
"or an Ethernet MAC in hex like 00:21:70:7e:32:bb\n");
printf("\n");
printf("Examples:\n"
"Send a TimeSynchronization request to DNET 123:\n"
"%s --dnet 123\n",
"Send a TimeSynchronization request to DNET 123:\n"
"%s --dnet 123\n",
filename);
printf(
"Send a TimeSynchronization request to MAC 10.0.0.1 DNET 123 DADR 5:\n"
@@ -136,17 +146,6 @@ static void print_help(char *filename)
printf("Send a TimeSynchronization request to MAC 10.1.2.3:47808:\n"
"%s --mac 10.1.2.3:47808\n",
filename);
#if 0
/* FIXME: it would be nice to be able to send arbitrary time values */
"date format: year/month/day:dayofweek (e.g. 2006/4/1:6)\n"
"year: AD, such as 2006\n" "month: 1=January, 12=December\n"
"day: 1-31\n" "dayofweek: 1=Monday, 7=Sunday\n" "\n"
"time format: hour:minute:second.hundredths (e.g. 23:59:59.12)\n"
"hour: 0-23\n" "minute: 0-59\n" "second: 0-59\n"
"hundredths: 0-99\n" "\n"
"Optional device-instance sends a unicast time sync.\n",
filename);
#endif
}
int main(int argc, char *argv[])