Cleaned up compiler warnings and errors for Win32 build.
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Binary file not shown.
@@ -6,14 +6,13 @@
|
||||
--------------------Configuration: bacnet - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP298.tmp" with contents
|
||||
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSPC4.tmp" with contents
|
||||
[
|
||||
/nologo /MLd /W3 /Gm /GX /ZI /Od /I "c:\code\bacnet-stack\\" /I "c:\code\bacnet-stack\ports\win32\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "BACDL_BIP" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
|
||||
"C:\code\bacnet-stack\arf.c"
|
||||
"C:\code\bacnet-stack\bacfile.c"
|
||||
/nologo /MLd /W3 /Gm /GX /ZI /Od /I "c:\code\bacnet-stack\\" /I "c:\code\bacnet-stack\ports\win32\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "BACDL_BIP" /FR"Debug/" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
|
||||
"C:\code\bacnet-stack\device.c"
|
||||
]
|
||||
Creating command line "cl.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP298.tmp"
|
||||
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP299.tmp" with contents
|
||||
Creating command line "cl.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSPC4.tmp"
|
||||
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSPC5.tmp" with contents
|
||||
[
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/bacnet.pdb" /debug /machine:I386 /out:"Debug/bacnet.exe" /pdbtype:sept
|
||||
".\Debug\abort.obj"
|
||||
@@ -21,10 +20,11 @@ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32
|
||||
".\Debug\ai.obj"
|
||||
".\Debug\ao.obj"
|
||||
".\Debug\apdu.obj"
|
||||
".\Debug\arf.obj"
|
||||
".\Debug\bacdcode.obj"
|
||||
".\Debug\bacerror.obj"
|
||||
".\Debug\bacfile.obj"
|
||||
".\Debug\bigend.obj"
|
||||
".\Debug\bip.obj"
|
||||
".\Debug\crc.obj"
|
||||
".\Debug\datalink.obj"
|
||||
".\Debug\device.obj"
|
||||
@@ -38,22 +38,54 @@ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32
|
||||
".\Debug\tsm.obj"
|
||||
".\Debug\whois.obj"
|
||||
".\Debug\wp.obj"
|
||||
".\Debug\arf.obj"
|
||||
".\Debug\bacfile.obj"
|
||||
".\Debug\bip-init.obj"
|
||||
".\Debug\bip.obj"
|
||||
".\Debug\bactext.obj"
|
||||
".\Debug\indtext.obj"
|
||||
]
|
||||
Creating command line "link.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP299.tmp"
|
||||
Creating command line "link.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSPC5.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
arf.c
|
||||
bacfile.c
|
||||
Generating Code...
|
||||
c:\code\bacnet-stack\bacfile.c(279) : warning C4761: integral size mismatch in argument; conversion supplied
|
||||
device.c
|
||||
Linking...
|
||||
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSPC6.tmp" with contents
|
||||
[
|
||||
/nologo /o"Debug/bacnet.bsc"
|
||||
".\Debug\abort.sbr"
|
||||
".\Debug\address.sbr"
|
||||
".\Debug\ai.sbr"
|
||||
".\Debug\ao.sbr"
|
||||
".\Debug\apdu.sbr"
|
||||
".\Debug\arf.sbr"
|
||||
".\Debug\bacdcode.sbr"
|
||||
".\Debug\bacerror.sbr"
|
||||
".\Debug\bacfile.sbr"
|
||||
".\Debug\bigend.sbr"
|
||||
".\Debug\crc.sbr"
|
||||
".\Debug\datalink.sbr"
|
||||
".\Debug\device.sbr"
|
||||
".\Debug\handlers.sbr"
|
||||
".\Debug\iam.sbr"
|
||||
".\Debug\main.sbr"
|
||||
".\Debug\npdu.sbr"
|
||||
".\Debug\reject.sbr"
|
||||
".\Debug\ringbuf.sbr"
|
||||
".\Debug\rp.sbr"
|
||||
".\Debug\tsm.sbr"
|
||||
".\Debug\whois.sbr"
|
||||
".\Debug\wp.sbr"
|
||||
".\Debug\bip-init.sbr"
|
||||
".\Debug\bip.sbr"
|
||||
".\Debug\bactext.sbr"
|
||||
".\Debug\indtext.sbr"]
|
||||
Creating command line "bscmake.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSPC6.tmp"
|
||||
Creating browse info file...
|
||||
<h3>Output Window</h3>
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
bacnet.exe - 0 error(s), 1 warning(s)
|
||||
bacnet.exe - 0 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -33,4 +33,6 @@
|
||||
|
||||
#define close closesocket
|
||||
|
||||
typedef int socklen_t;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user