mirror of
https://github.com/stargieg/bacnet-stack
synced 2025-10-26 23:35:52 +08:00
fix compiler warning unused var. add macro unused_var
This commit is contained in:
parent
d6dea9fbd5
commit
cd7123bfcb
|
|
@ -215,7 +215,7 @@ static int cov_encode_subscription(
|
|||
|
||||
|
||||
/* FIXME: unused parameter */
|
||||
max_apdu = max_apdu;
|
||||
unused_var(max_apdu);
|
||||
if (!cov_subscription) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ void handler_conf_private_trans_ack(
|
|||
* we were expecting. But this is just to silence some compiler
|
||||
* warnings from Borland.
|
||||
*/
|
||||
src = src;
|
||||
service_data = service_data;
|
||||
unused_var(src);
|
||||
unused_var(service_data);
|
||||
|
||||
len = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ void handler_ucov_notification(
|
|||
unsigned index = 0;
|
||||
|
||||
/* src not needed for this application */
|
||||
src = src;
|
||||
unused_var(src);
|
||||
/* create linked list to store data if more
|
||||
than one property value is expected */
|
||||
pProperty_value = &property_value[0];
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ unsigned Device_Count(
|
|||
uint32_t Device_Index_To_Instance(
|
||||
unsigned index)
|
||||
{
|
||||
index = index;
|
||||
unused_var(index);
|
||||
return Object_Instance_Number;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@
|
|||
#pragma warning( disable : 4996)
|
||||
#endif
|
||||
|
||||
/* This removes compilation warnings/errors about unreferenced variables. */
|
||||
#define unused_var(x) (x)=(x)
|
||||
|
||||
/* This stack implements this version of BACnet */
|
||||
#define BACNET_PROTOCOL_VERSION 1
|
||||
/* Although this stack can implement a later revision,
|
||||
|
|
|
|||
|
|
@ -748,7 +748,7 @@ int address_list_encode(
|
|||
/* FIXME: I really shouild check the length remaining here but it is
|
||||
fairly pointless until we have the true length remaining in
|
||||
the packet to work with as at the moment it is just MAX_APDU */
|
||||
apdu_len = apdu_len;
|
||||
unused_var(apdu_len);
|
||||
/* look for matching address */
|
||||
pMatch = Address_Cache;
|
||||
while (pMatch <= &Address_Cache[MAX_ADDRESS_CACHE - 1]) {
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ int alarm_ack_decode_service_request(
|
|||
uint32_t enumValue;
|
||||
|
||||
/* unused parameter */
|
||||
apdu_len = apdu_len;
|
||||
unused_var(apdu_len);
|
||||
|
||||
if (-1 == (section_len =
|
||||
decode_context_unsigned(&apdu[len], 0,
|
||||
|
|
|
|||
|
|
@ -60,6 +60,6 @@ void debug_printf(
|
|||
const char *format,
|
||||
...)
|
||||
{
|
||||
format = format;
|
||||
unused_var(format);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ int getevent_ack_encode_apdu_data(
|
|||
unsigned i = 0; /* counter */
|
||||
|
||||
/* unused parameter */
|
||||
max_apdu = max_apdu;
|
||||
unused_var(max_apdu);
|
||||
if (apdu) {
|
||||
event_data = get_event_data;
|
||||
while (event_data) {
|
||||
|
|
@ -174,7 +174,7 @@ int getevent_ack_encode_apdu_end(
|
|||
int apdu_len = 0; /* total length of the apdu, return value */
|
||||
|
||||
/* unused parameter */
|
||||
max_apdu = max_apdu;
|
||||
unused_var(max_apdu);
|
||||
if (apdu) {
|
||||
apdu_len += encode_closing_tag(&apdu[apdu_len], 0);
|
||||
apdu_len += encode_context_boolean(&apdu[apdu_len], 1, moreEvents);
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ int lighting_command_decode(
|
|||
uint32_t unsigned_value = 0;
|
||||
float real_value = 0.0;
|
||||
|
||||
apdu_max_len = apdu_max_len;
|
||||
unused_var(apdu_max_len);
|
||||
/* check for value pointers */
|
||||
if (apdu_max_len && data) {
|
||||
/* Tag 0: operation */
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static int pt_encode_apdu(
|
|||
}
|
||||
*/
|
||||
/* unused parameter */
|
||||
max_apdu = max_apdu;
|
||||
unused_var(max_apdu);
|
||||
if (apdu) {
|
||||
len =
|
||||
encode_context_unsigned(&apdu[apdu_len], 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user