Cleaned up warnings from Visual C++ 6.0 compile by adding casts.

This commit is contained in:
skarg
2006-12-12 15:45:01 +00:00
parent 6c41adb560
commit f7d549dec6
12 changed files with 18 additions and 17 deletions
+2 -1
View File
@@ -67,10 +67,11 @@ static void PrintReadPropertyData(BACNET_READ_PROPERTY_DATA * data)
#endif
application_data = data->application_data;
application_data_len = data->application_data_len;
/* FIXME: what if application_data_len is bigger than 255? */
/* value? need to loop until all of the len is gone... */
for (;;) {
len = bacapp_decode_application_data(application_data,
application_data_len, &value);
(uint8_t)application_data_len, &value);
if (first_value && (len < application_data_len)) {
first_value = false;
fprintf(stdout, "{");
+1 -1
View File
@@ -89,7 +89,7 @@ uint8_t Send_Read_Property_Request(uint32_t device_id, /* destination device */
max_apdu in the address binding table. */
if ((unsigned) pdu_len < max_apdu) {
tsm_set_confirmed_unsegmented_transaction(invoke_id, &dest,
&npdu_data, &Handler_Transmit_Buffer[0], pdu_len);
&npdu_data, &Handler_Transmit_Buffer[0], (uint16_t)pdu_len);
bytes_sent =
datalink_send_pdu(&dest, &npdu_data,
&Handler_Transmit_Buffer[0], pdu_len);
+1 -1
View File
@@ -92,7 +92,7 @@ uint8_t Send_Write_Property_Request(uint32_t device_id, /* destination device */
max_apdu in the address binding table. */
if ((unsigned) pdu_len < max_apdu) {
tsm_set_confirmed_unsegmented_transaction(invoke_id, &dest,
&npdu_data, &Handler_Transmit_Buffer[0], pdu_len);
&npdu_data, &Handler_Transmit_Buffer[0], (uint16_t)pdu_len);
bytes_sent =
datalink_send_pdu(&dest, &npdu_data,
&Handler_Transmit_Buffer[0], pdu_len);
+2 -2
View File
@@ -84,7 +84,7 @@ int Analog_Input_Encode_Property_APDU(uint8_t * apdu,
int apdu_len = 0; /* return value */
BACNET_BIT_STRING bit_string;
BACNET_CHARACTER_STRING char_string;
float value = 3.14;
float value = (float)3.14;
(void) array_index;
switch (property) {
@@ -122,7 +122,7 @@ int Analog_Input_Encode_Property_APDU(uint8_t * apdu,
apdu_len = encode_tagged_enumerated(&apdu[0], UNITS_PERCENT);
break;
case 9997:
apdu_len = encode_tagged_real(&apdu[0], 90.510);
apdu_len = encode_tagged_real(&apdu[0], (float)90.510);
break;
case 9998:
apdu_len = encode_tagged_unsigned(&apdu[0], 90);
+1 -1
View File
@@ -160,7 +160,7 @@ int Analog_Output_Encode_Property_APDU(uint8_t * apdu,
int apdu_len = 0; /* return value */
BACNET_BIT_STRING bit_string;
BACNET_CHARACTER_STRING char_string;
float real_value = 1.414;
float real_value = (float)1.414;
unsigned object_index = 0;
unsigned i = 0;
bool state = false;
+1 -1
View File
@@ -159,7 +159,7 @@ int Analog_Value_Encode_Property_APDU(uint8_t * apdu,
int apdu_len = 0; /* return value */
BACNET_BIT_STRING bit_string;
BACNET_CHARACTER_STRING char_string;
float real_value = 1.414;
float real_value = (float)1.414;
unsigned object_index = 0;
unsigned i = 0;
bool state = false;
+1 -2
View File
@@ -308,7 +308,6 @@ uint32_t bacfile_instance_from_tsm(uint8_t invokeID)
BACNET_ATOMIC_READ_FILE_DATA data = { 0 };
uint32_t object_instance = BACNET_MAX_INSTANCE + 1; /* return value */
bool found = false;
int apdu_offset = 0;
found = tsm_get_transaction_pdu(invokeID, &dest, &npdu_data, &apdu[0],
&apdu_len);
@@ -318,7 +317,7 @@ uint32_t bacfile_instance_from_tsm(uint8_t invokeID)
&& (apdu[0] == PDU_TYPE_CONFIRMED_SERVICE_REQUEST)) {
len =
apdu_decode_confirmed_service_request(&apdu[0],
apdu_len - apdu_offset, &service_data, &service_choice,
apdu_len, &service_data, &service_choice,
&service_request, &service_request_len);
if (service_choice == SERVICE_CONFIRMED_ATOMIC_READ_FILE) {
len = arf_decode_service_request(service_request,
+2 -2
View File
@@ -305,7 +305,7 @@ bool Multistate_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data,
Multistate_Output_Instance_To_Index(wp_data->
object_instance);
priority--;
Multistate_Output_Level[object_index][priority] = level;
Multistate_Output_Level[object_index][priority] = (uint8_t)level;
/* Note: you could set the physical output here if we
are the highest priority.
However, if Out of Service is TRUE, then don't set the
@@ -330,7 +330,7 @@ bool Multistate_Output_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data,
priority = wp_data->priority;
if (priority && (priority <= BACNET_MAX_PRIORITY)) {
priority--;
Multistate_Output_Level[object_index][priority] = level;
Multistate_Output_Level[object_index][priority] = (uint8_t)level;
/* Note: you could set the physical output here to the next
highest priority, or to the relinquish default if no
priorities are set.