diff --git a/bacnet-stack/ai.c b/bacnet-stack/ai.c index ee65fce9..4a965aaa 100644 --- a/bacnet-stack/ai.c +++ b/bacnet-stack/ai.c @@ -72,7 +72,7 @@ int Analog_Input_Encode_Property_APDU( int apdu_len = 0; // return value BACNET_BIT_STRING bit_string; char text_string[32] = {""}; - float value = 3.141592; + float value = 3.14; (void)array_index; switch (property) diff --git a/bacnet-stack/ao.c b/bacnet-stack/ao.c index bc99de2a..35dbceee 100644 --- a/bacnet-stack/ao.c +++ b/bacnet-stack/ao.c @@ -153,7 +153,7 @@ int Analog_Output_Encode_Property_APDU( int apdu_len = 0; // return value BACNET_BIT_STRING bit_string; char text_string[32] = {""}; - float real_value = 1.41421356; + float real_value = 1.414; unsigned object_index = 0; unsigned i = 0; diff --git a/bacnet-stack/bacdcode.c b/bacnet-stack/bacdcode.c index 701f39ea..a055fd19 100644 --- a/bacnet-stack/bacdcode.c +++ b/bacnet-stack/bacdcode.c @@ -351,10 +351,10 @@ int encode_tag(uint8_t * apdu, uint8_t tag_number, bool context_specific, else { apdu[0] |= 5; if (len_value_type <= 253) { - apdu[len++] = len_value_type; + apdu[len++] = (uint8_t)len_value_type; } else if (len_value_type <= 65535) { apdu[len++] = 254; - len += encode_unsigned16(&apdu[len], len_value_type); + len += encode_unsigned16(&apdu[len], (uint16_t)len_value_type); } else { apdu[len++] = 255; len += encode_unsigned32(&apdu[len], len_value_type); @@ -648,7 +648,7 @@ int decode_bitstring(uint8_t * apdu, uint32_t len_value, bit_string->value[i] = byte_reverse_bits(apdu[len++]); } unused_bits = apdu[0] & 0x07; - bit_string->bits_used = bytes_used * 8; + bit_string->bits_used = (uint8_t)(bytes_used * 8); bit_string->bits_used -= unused_bits; } } @@ -831,7 +831,7 @@ int encode_context_object_id( // assumes that the tag only consumes 1 octet len = encode_bacnet_object_id(&apdu[1], object_type, instance); - len += encode_tag(&apdu[0], tag_number, true, len); + len += encode_tag(&apdu[0], (uint8_t)tag_number, true, len); return len; } @@ -1035,7 +1035,7 @@ int encode_context_unsigned(uint8_t * apdu, int tag_number, int value) int len = 0; len = encode_bacnet_unsigned(&apdu[1], value); - len += encode_tag(&apdu[0], tag_number, true, len); + len += encode_tag(&apdu[0], (uint8_t)tag_number, true, len); return len; } @@ -1137,7 +1137,7 @@ int encode_context_enumerated(uint8_t * apdu, int tag_number, int value) // assumes that the tag only consumes 1 octet len = encode_bacnet_enumerated(&apdu[1], value); - len += encode_tag(&apdu[0], tag_number, true, len); + len += encode_tag(&apdu[0], (uint8_t)tag_number, true, len); return len; } @@ -1209,7 +1209,7 @@ int encode_context_signed(uint8_t * apdu, int tag_number, int value) // assumes that the tag only consumes 1 octet len = encode_bacnet_signed(&apdu[1], value); - len += encode_tag(&apdu[0], tag_number, true, len); + len += encode_tag(&apdu[0], (uint8_t)tag_number, true, len); return len; } diff --git a/bacnet-stack/bip.c b/bacnet-stack/bip.c index dbae44b4..42837c3e 100644 --- a/bacnet-stack/bip.c +++ b/bacnet-stack/bip.c @@ -156,7 +156,7 @@ static int bip_send( else mtu[1] = 0x0A; /* Original-Unicast-NPDU */ mtu_len = 2; - mtu_len += encode_unsigned16(&mtu[mtu_len], pdu_len + 4 /*inclusive*/); + mtu_len += encode_unsigned16(&mtu[mtu_len], (uint16_t)(pdu_len + 4/*inclusive*/) ); memcpy(&mtu[mtu_len], pdu, pdu_len); mtu_len += pdu_len; @@ -238,7 +238,7 @@ uint16_t bip_receive( select_timeout.tv_usec = 1000 * timeout; } FD_ZERO(&read_fds); - FD_SET(BIP_Socket, &read_fds); + FD_SET((unsigned int)BIP_Socket, &read_fds); max = BIP_Socket; /* see if there is a packet for us */ if (select(max + 1, &read_fds, NULL, NULL, &select_timeout) > 0) diff --git a/bacnet-stack/device.c b/bacnet-stack/device.c index 19e66efe..cf140254 100644 --- a/bacnet-stack/device.c +++ b/bacnet-stack/device.c @@ -374,7 +374,7 @@ int Device_Encode_Property_APDU( { // bitstring_set_bit(&bit_string, i, apdu_service_supported(i)); // initialize all the services to not-supported - bitstring_set_bit(&bit_string, i, false); + bitstring_set_bit(&bit_string, (uint8_t)i, false); } // initialize those we support bitstring_set_bit(&bit_string, SERVICE_SUPPORTED_WHO_IS, true); @@ -387,7 +387,7 @@ int Device_Encode_Property_APDU( for (i = 0; i < MAX_BACNET_OBJECT_TYPES; i++) { // initialize all the object types to not-supported - bitstring_set_bit(&bit_string, i, false); + bitstring_set_bit(&bit_string, (uint8_t)i, false); } bitstring_set_bit(&bit_string, OBJECT_DEVICE, true); bitstring_set_bit(&bit_string, OBJECT_ANALOG_INPUT, true); diff --git a/bacnet-stack/ports/win32/bacnet.ide b/bacnet-stack/ports/win32/bacnet.ide index 5fd17e5f..08db2149 100644 Binary files a/bacnet-stack/ports/win32/bacnet.ide and b/bacnet-stack/ports/win32/bacnet.ide differ diff --git a/bacnet-stack/ports/win32/bacnet/bacnet.plg b/bacnet-stack/ports/win32/bacnet/bacnet.plg index 150f18a6..cd9bba56 100644 --- a/bacnet-stack/ports/win32/bacnet/bacnet.plg +++ b/bacnet-stack/ports/win32/bacnet/bacnet.plg @@ -6,14 +6,13 @@ --------------------Configuration: bacnet - Win32 Debug--------------------