Cleaned up some warnings found when compiling with Visual Studio Express 2010.

This commit is contained in:
skarg
2014-01-14 20:03:00 +00:00
parent bfa26b769f
commit c3326b324c
8 changed files with 23 additions and 20 deletions
+2 -2
View File
@@ -542,7 +542,7 @@ bool bacfile_write_record_data(
if (pFile) {
if ((data->type.record.fileStartRecord != -1) &&
(data->type.record.fileStartRecord > 0)) {
for (i = 0; i < data->type.record.fileStartRecord; i++) {
for (i = 0; i < (uint32_t)data->type.record.fileStartRecord; i++) {
pData = fgets(&dummy_data[0], sizeof(dummy_data), pFile);
if ((pData == NULL) || feof(pFile)) {
break;
@@ -608,7 +608,7 @@ bool bacfile_read_ack_record_data(
pFile = fopen(pFilename, "rb");
if (pFile) {
if (data->type.record.fileStartRecord > 0) {
for (i = 0; i < data->type.record.fileStartRecord; i++) {
for (i = 0; i < (uint32_t)data->type.record.fileStartRecord; i++) {
pData = fgets(&dummy_data[0], sizeof(dummy_data), pFile);
if ((pData == NULL) || feof(pFile)) {
break;
+10 -10
View File
@@ -866,7 +866,7 @@ int Channel_Coerce_Data_Encode(
}
} else if (tag == BACNET_APPLICATION_TAG_REAL) {
if (value->type.Unsigned_Int <= 9999999) {
float_value = value->type.Unsigned_Int;
float_value = (float)value->type.Unsigned_Int;
apdu_len = encode_application_real(&apdu[0],
float_value);
} else {
@@ -908,7 +908,7 @@ int Channel_Coerce_Data_Encode(
signed_value);
} else if (tag == BACNET_APPLICATION_TAG_REAL) {
if (value->type.Signed_Int <= 9999999) {
float_value = value->type.Signed_Int;
float_value = (float)value->type.Signed_Int;
apdu_len = encode_application_real(&apdu[0],
float_value);
} else {
@@ -938,7 +938,7 @@ int Channel_Coerce_Data_Encode(
} else if (tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
if ((value->type.Real >= 0.0) &&
(value->type.Real <= 2147483000.0)) {
unsigned_value = value->type.Real;
unsigned_value = (uint32_t)value->type.Real;
apdu_len = encode_application_unsigned(&apdu[0],
unsigned_value);
} else {
@@ -947,7 +947,7 @@ int Channel_Coerce_Data_Encode(
} else if (tag == BACNET_APPLICATION_TAG_SIGNED_INT) {
if ((value->type.Real >= -2147483000.0) &&
(value->type.Real <= 214783000.0)) {
signed_value = value->type.Real;
signed_value = (int32_t)value->type.Real;
apdu_len = encode_application_signed(&apdu[0],
signed_value);
} else {
@@ -964,7 +964,7 @@ int Channel_Coerce_Data_Encode(
} else if (tag == BACNET_APPLICATION_TAG_ENUMERATED) {
if ((value->type.Real >= 0.0) &&
(value->type.Real <= 2147483000.0)) {
unsigned_value = value->type.Real;
unsigned_value = (uint32_t)value->type.Real;
apdu_len = encode_application_enumerated(&apdu[0],
unsigned_value);
} else {
@@ -986,7 +986,7 @@ int Channel_Coerce_Data_Encode(
} else if (tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
if ((value->type.Double >= 0.0) &&
(value->type.Double <= 2147483000.0)) {
unsigned_value = value->type.Double;
unsigned_value = (uint32_t)value->type.Double;
apdu_len = encode_application_unsigned(&apdu[0],
unsigned_value);
} else {
@@ -995,7 +995,7 @@ int Channel_Coerce_Data_Encode(
} else if (tag == BACNET_APPLICATION_TAG_SIGNED_INT) {
if ((value->type.Double >= -2147483000.0) &&
(value->type.Double <= 214783000.0)) {
signed_value = value->type.Double;
signed_value = (int32_t)value->type.Double;
apdu_len = encode_application_signed(&apdu[0],
signed_value);
} else {
@@ -1004,7 +1004,7 @@ int Channel_Coerce_Data_Encode(
} else if (tag == BACNET_APPLICATION_TAG_REAL) {
if ((value->type.Double >= 3.4E-38) &&
(value->type.Double <= 3.4E+38)) {
float_value = value->type.Double;
float_value = (float)value->type.Double;
apdu_len = encode_application_real(&apdu[0],
float_value);
} else {
@@ -1017,7 +1017,7 @@ int Channel_Coerce_Data_Encode(
} else if (tag == BACNET_APPLICATION_TAG_ENUMERATED) {
if ((value->type.Double >= 0.0) &&
(value->type.Double <= 2147483000.0)) {
unsigned_value = value->type.Double;
unsigned_value = (uint32_t)value->type.Double;
apdu_len = encode_application_enumerated(&apdu[0],
unsigned_value);
} else {
@@ -1050,7 +1050,7 @@ int Channel_Coerce_Data_Encode(
}
} else if (tag == BACNET_APPLICATION_TAG_REAL) {
if (value->type.Enumerated <= 9999999) {
float_value = value->type.Enumerated;
float_value = (float)value->type.Enumerated;
apdu_len = encode_application_real(&apdu[0],
float_value);
} else {
+2 -2
View File
@@ -802,7 +802,7 @@ bool Lighting_Output_Default_Step_Increment_Set(
unsigned Lighting_Output_Default_Priority(
uint32_t object_instance)
{
unsigned value = 0.0;
unsigned value = 0;
unsigned int index = 0;
index = Lighting_Output_Instance_To_Index(object_instance);
@@ -1222,7 +1222,7 @@ bool Lighting_Output_Write_Property(
if (status) {
Lighting_Output_Out_Of_Service_Set(
wp_data->object_instance,
&value.type.Boolean);
value.type.Boolean);
}
break;
case PROP_OBJECT_IDENTIFIER:
+1 -1
View File
@@ -1389,7 +1389,7 @@ bool bacapp_print_value(
/* Try to extract the value into allocated memory. If unable, try again */
/* another time with a string that is twice as large. */
status = bacapp_snprintf_value(str, str_len, object_value);
if ((status < 0) || (status >= str_len)) {
if ((status < 0) || ((size_t)status >= str_len)) {
free(str);
str_len *= 2;
} else if (status == 0) {
+1 -1
View File
@@ -502,7 +502,7 @@ void datetime_add_minutes(
if (minutes < 0) {
/* convert to positive for easier math */
minutes *= -1;
if (minutes > bdatetime_minutes) {
if ((uint32_t)minutes > bdatetime_minutes) {
/* previous day */
bdatetime_days -= 1;
bdatetime_minutes += ((24 * 60) - minutes);
+3
View File
@@ -57,6 +57,9 @@ int stricmp(
return (int) c1 - c2;
}
#endif
#if defined(_MSC_VER)
#define stricmp _stricmp
#endif
bool indtext_by_string(
INDTEXT_DATA * data_list,
+1 -1
View File
@@ -166,7 +166,7 @@ int timesync_encode_timesync_recipients(
} else {
len = 1 + 3 + 2 + pRecipient->type.address.mac_len + 1;
}
if (max_apdu >= len) {
if (max_apdu >= (unsigned)len) {
/* CHOICE - address [1] BACnetAddress - opening */
len = encode_opening_tag(&apdu[apdu_len], 1);
apdu_len += len;
+3 -3
View File
@@ -84,20 +84,20 @@ int whois_decode_service_request(
if (tag_number != 0) {
return BACNET_STATUS_ERROR;
}
if (apdu_len > len) {
if (apdu_len > (unsigned)len) {
len += decode_unsigned(&apdu[len], len_value, &decoded_value);
if (decoded_value <= BACNET_MAX_INSTANCE) {
if (pLow_limit) {
*pLow_limit = decoded_value;
}
}
if (apdu_len > len) {
if (apdu_len > (unsigned)len) {
len +=
decode_tag_number_and_value(&apdu[len], &tag_number, &len_value);
if (tag_number != 1) {
return BACNET_STATUS_ERROR;
}
if (apdu_len > len) {
if (apdu_len > (unsigned)len) {
len += decode_unsigned(&apdu[len], len_value, &decoded_value);
if (decoded_value <= BACNET_MAX_INSTANCE) {
if (pHigh_limit) {