Bugfix/atmel studio arm compile warnings (#60)
* Cleanup warnings generated by Atmel Studio compiling for SAMD21 ARM Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
+2
-2
@@ -296,10 +296,10 @@ int bacapp_decode_application_data(
|
||||
if (tag_len > 0) {
|
||||
len += tag_len;
|
||||
value->tag = tag_number;
|
||||
if (len <= apdu_len_max) {
|
||||
if ((unsigned)len <= apdu_len_max) {
|
||||
decode_len =
|
||||
bacapp_decode_data_len(NULL, tag_number, len_value_type);
|
||||
if (decode_len <= (apdu_len_max - len)) {
|
||||
if ((unsigned)decode_len <= (apdu_len_max - len)) {
|
||||
decode_len = bacapp_decode_data(
|
||||
&apdu[len], tag_number, len_value_type, value);
|
||||
if (value->tag != MAX_BACNET_APPLICATION_TAG) {
|
||||
|
||||
@@ -777,7 +777,7 @@ int bacnet_object_id_application_decode(uint8_t *apdu,
|
||||
if ((len > 0) && (tag_number == BACNET_APPLICATION_TAG_OBJECT_ID)) {
|
||||
apdu_len = len;
|
||||
if (apdu_len < apdu_len_max) {
|
||||
if ((apdu_len_max - apdu_len) >= len_value_type) {
|
||||
if ((apdu_len_max - (unsigned)apdu_len) >= len_value_type) {
|
||||
len = bacnet_object_id_decode(
|
||||
&apdu[len], len_value_type, object_type, object_instance);
|
||||
if (len > 0) {
|
||||
|
||||
@@ -48,11 +48,6 @@
|
||||
|
||||
/** @file apdu.c Handles APDU services */
|
||||
|
||||
extern int Routed_Device_Service_Approval(BACNET_CONFIRMED_SERVICE service,
|
||||
int service_argument,
|
||||
uint8_t *apdu_buff,
|
||||
uint8_t invoke_id);
|
||||
|
||||
/* APDU Timeout in Milliseconds */
|
||||
static uint16_t Timeout_Milliseconds = 3000;
|
||||
/* Number of APDU Retries */
|
||||
@@ -140,7 +135,7 @@ bool apdu_service_supported(BACNET_SERVICES_SUPPORTED service_supported)
|
||||
if (confirmed_service_supported[i] == service_supported) {
|
||||
found = true;
|
||||
if (Confirmed_Function[i] != NULL) {
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
/* Check to see if the current Device supports this service.
|
||||
*/
|
||||
int len = Routed_Device_Service_Approval(
|
||||
|
||||
@@ -158,7 +158,7 @@ void handler_device_communication_control(uint8_t *service_request,
|
||||
"Sending Reject - undefined enumeration\n");
|
||||
#endif
|
||||
} else {
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
/* Check to see if the current Device supports this service. */
|
||||
len = Routed_Device_Service_Approval(
|
||||
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL, (int)state,
|
||||
|
||||
@@ -123,7 +123,7 @@ void handler_reinitialize_device(uint8_t *service_request,
|
||||
"ReinitializeDevice: Sending Reject - undefined enumeration\n");
|
||||
#endif
|
||||
} else {
|
||||
#if BAC_ROUTING
|
||||
#ifdef BAC_ROUTING
|
||||
/* Check to see if the current Device supports this service. */
|
||||
len = Routed_Device_Service_Approval(
|
||||
SERVICE_CONFIRMED_REINITIALIZE_DEVICE, (int)rd_data.state,
|
||||
|
||||
@@ -135,6 +135,12 @@ extern "C" {
|
||||
bool dlmstp_send_pdu_queue_empty(void);
|
||||
BACNET_STACK_EXPORT
|
||||
bool dlmstp_send_pdu_queue_full(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t dlmstp_max_info_frames_limit(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t dlmstp_max_master_limit(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+3
-3
@@ -194,7 +194,7 @@ int dcc_decode_service_request(uint8_t *apdu,
|
||||
results in no timeout */
|
||||
*timeDuration = 0;
|
||||
}
|
||||
if (apdu_len < apdu_len_max) {
|
||||
if ((unsigned)apdu_len < apdu_len_max) {
|
||||
/* Tag 1: enable_disable */
|
||||
len = bacnet_enumerated_context_decode(
|
||||
&apdu[apdu_len], apdu_len_max - apdu_len, 1, &decoded_enum);
|
||||
@@ -208,7 +208,7 @@ int dcc_decode_service_request(uint8_t *apdu,
|
||||
return BACNET_STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
if (apdu_len < apdu_len_max) {
|
||||
if ((unsigned)apdu_len < apdu_len_max) {
|
||||
/* Tag 2: password --optional-- */
|
||||
if (!decode_is_context_tag(&apdu[apdu_len], 2)) {
|
||||
/* since this is the last value of the packet,
|
||||
@@ -220,7 +220,7 @@ int dcc_decode_service_request(uint8_t *apdu,
|
||||
apdu_len_max - apdu_len, &tag_number, &len_value_type);
|
||||
if (len > 0) {
|
||||
apdu_len += len;
|
||||
if (apdu_len < apdu_len_max) {
|
||||
if ((unsigned)apdu_len < apdu_len_max) {
|
||||
len = bacnet_character_string_decode(&apdu[apdu_len],
|
||||
apdu_len_max - apdu_len, len_value_type, password);
|
||||
if (len > 0) {
|
||||
|
||||
@@ -58,12 +58,6 @@ extern "C" {
|
||||
uint8_t * apdu,
|
||||
uint8_t invoke_id);
|
||||
|
||||
/* set GetAlarmSummary function */
|
||||
BACNET_STACK_EXPORT
|
||||
void handler_get_alarm_summary_set(
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
get_alarm_summary_function pFunction);
|
||||
|
||||
/* encode service */
|
||||
BACNET_STACK_EXPORT
|
||||
int get_alarm_summary_ack_encode_apdu_init(
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include "bacnet/lighting.h"
|
||||
#include "bacnet/bacdcode.h"
|
||||
|
||||
@@ -265,14 +266,15 @@ bool lighting_command_same(
|
||||
(dst->use_priority == src->use_priority)) {
|
||||
status = true;
|
||||
if ((dst->use_target_level) &&
|
||||
(dst->target_level != src->target_level)) {
|
||||
islessgreater(dst->target_level, src->target_level)) {
|
||||
status = false;
|
||||
}
|
||||
if ((dst->use_ramp_rate) && (dst->ramp_rate != src->ramp_rate)) {
|
||||
if ((dst->use_ramp_rate) &&
|
||||
islessgreater(dst->ramp_rate, src->ramp_rate)) {
|
||||
status = false;
|
||||
}
|
||||
if ((dst->use_step_increment) &&
|
||||
(dst->step_increment != src->step_increment)) {
|
||||
islessgreater(dst->step_increment, src->step_increment)) {
|
||||
status = false;
|
||||
}
|
||||
if ((dst->use_fade_time) && (dst->fade_time != src->fade_time)) {
|
||||
|
||||
@@ -156,11 +156,6 @@ extern "C" {
|
||||
int apdu_len, /* total length of the apdu */
|
||||
BACNET_READ_RANGE_DATA * rrdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_ReadRange_Request(
|
||||
uint32_t device_id, /* destination device */
|
||||
BACNET_READ_RANGE_DATA * read_access_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Reference in New Issue
Block a user