cleaned up compiler warnings

This commit is contained in:
skarg
2012-09-23 12:48:41 +00:00
parent 9db24ea90a
commit d5fd900780
9 changed files with 36 additions and 21 deletions
+1 -2
View File
@@ -176,8 +176,7 @@ void dlenv_maintenance_timer(
BBMD_Timer_Seconds -= elapsed_seconds;
}
if (BBMD_Timer_Seconds == 0) {
int retval;
retval = dlenv_register_as_foreign_device();
(void)dlenv_register_as_foreign_device();
/* If that failed (negative), maybe just a network issue.
* If nothing happened (0), may be un/misconfigured.
* Set up to try again later in all cases. */
@@ -150,6 +150,13 @@ void handler_get_alarm_summary(
bytes_sent =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (bytes_sent <= 0) {
fprintf(stderr, "Failed to send PDU (%s)!\n", strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
return;
}
+4 -2
View File
@@ -99,8 +99,10 @@ void handler_i_am_bind(
len =
iam_decode_service_request(service_request, &device_id, &max_apdu,
&segmentation, &vendor_id);
/* only add address if requested to bind */
address_add_binding(device_id, max_apdu, src);
if (len > 0) {
/* only add address if requested to bind */
address_add_binding(device_id, max_apdu, src);
}
return;
}
+11 -6
View File
@@ -66,11 +66,14 @@ void handler_timesync(
len =
timesync_decode_service_request(service_request, service_len, &bdate,
&btime);
if (len > 0) {
#if PRINT_ENABLED
fprintf(stderr, "Received TimeSyncronization Request\r\n");
show_bacnet_date_time(&bdate, &btime);
fprintf(stderr, "Received TimeSyncronization Request\r\n");
show_bacnet_date_time(&bdate, &btime);
#else
/* FIXME: set the time? */
#endif
/* FIXME: set the time? */
}
return;
}
@@ -89,11 +92,13 @@ void handler_timesync_utc(
len =
timesync_decode_service_request(service_request, service_len, &bdate,
&btime);
if (len > 0) {
#if PRINT_ENABLED
fprintf(stderr, "Received TimeSyncronization Request\r\n");
show_bacnet_date_time(&bdate, &btime);
fprintf(stderr, "Received TimeSyncronization Request\r\n");
show_bacnet_date_time(&bdate, &btime);
#endif
/* FIXME: set the time? */
/* FIXME: set the time? */
}
return;
}
+7
View File
@@ -203,4 +203,11 @@ void handler_write_property_multiple(
bytes_sent =
datalink_send_pdu(src, &npdu_data, &Handler_Transmit_Buffer[0],
pdu_len);
#if PRINT_ENABLED
if (bytes_sent <= 0) {
fprintf(stderr, "Failed to send PDU (%s)!\n", strerror(errno));
}
#else
bytes_sent = bytes_sent;
#endif
}
-1
View File
@@ -69,7 +69,6 @@ uint8_t Send_Read_Property_Request_Address(
{
BACNET_ADDRESS my_address;
uint8_t invoke_id = 0;
bool status = false;
int len = 0;
int pdu_len = 0;
int bytes_sent = 0;
-2
View File
@@ -405,7 +405,6 @@ bool Analog_Output_Write_Property(
{
bool status = false; /* return value */
unsigned int object_index = 0;
uint8_t level = AO_LEVEL_NULL;
int len = 0;
BACNET_APPLICATION_DATA_VALUE value;
@@ -451,7 +450,6 @@ bool Analog_Output_Write_Property(
WPValidateArgType(&value, BACNET_APPLICATION_TAG_NULL,
&wp_data->error_class, &wp_data->error_code);
if (status) {
level = AO_LEVEL_NULL;
object_index =
Analog_Output_Instance_To_Index(wp_data->
object_instance);
+6 -1
View File
@@ -312,8 +312,13 @@ bool bacfile_write_property(
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
if (len < 0) {
/* error while decoding - a value larger than we can handle */
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
return false;
}
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
switch (wp_data->object_property) {
case PROP_ARCHIVE:
/* 12.13.8 Archive
-7
View File
@@ -358,7 +358,6 @@ int Multistate_Input_Read_Property(
BACNET_CHARACTER_STRING char_string;
uint32_t present_value = 0;
unsigned i = 0;
unsigned int object_index = 0;
bool state = false;
uint8_t *apdu = NULL;
@@ -435,9 +434,6 @@ int Multistate_Input_Read_Property(
} else if (rpdata->array_index == BACNET_ARRAY_ALL) {
/* if no index was specified, then try to encode the entire list */
/* into one packet. */
object_index =
Multistate_Input_Instance_To_Index(rpdata->
object_instance);
for (i = 1; i <= MULTISTATE_NUMBER_OF_STATES; i++) {
characterstring_init_ansi(&char_string,
Multistate_Input_State_Text(rpdata->object_instance,
@@ -457,9 +453,6 @@ int Multistate_Input_Read_Property(
}
}
} else {
object_index =
Multistate_Input_Instance_To_Index(rpdata->
object_instance);
if (rpdata->array_index <= MULTISTATE_NUMBER_OF_STATES) {
characterstring_init_ansi(&char_string,
Multistate_Input_State_Text(rpdata->object_instance,