Changes to reduce the number of warnings with Visual C++2008 warning level 4 to a minimum.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <process.h>
|
||||
#include "bacdef.h"
|
||||
#include "bacaddr.h"
|
||||
#include "mstp.h"
|
||||
@@ -125,7 +126,7 @@ int dlmstp_send_pdu(
|
||||
Transmit_Packet.frame_type =
|
||||
FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY;
|
||||
}
|
||||
Transmit_Packet.pdu_len = pdu_len;
|
||||
Transmit_Packet.pdu_len = (uint16_t)pdu_len;
|
||||
for (i = 0; i < pdu_len; i++) {
|
||||
Transmit_Packet.pdu[i] = pdu[i];
|
||||
}
|
||||
@@ -179,7 +180,7 @@ static void dlmstp_receive_fsm_task(
|
||||
(void) pArg;
|
||||
(void) SetThreadPriority(GetCurrentThread(),
|
||||
THREAD_PRIORITY_TIME_CRITICAL);
|
||||
while (TRUE) {
|
||||
for(;;) {
|
||||
/* only do receive state machine while we don't have a frame */
|
||||
if ((MSTP_Port.ReceivedValidFrame == false) &&
|
||||
(MSTP_Port.ReceivedInvalidFrame == false)) {
|
||||
@@ -205,7 +206,7 @@ static void dlmstp_master_fsm_task(
|
||||
(void) pArg;
|
||||
(void) SetThreadPriority(GetCurrentThread(),
|
||||
THREAD_PRIORITY_TIME_CRITICAL);
|
||||
while (TRUE) {
|
||||
for(;;) {
|
||||
switch (MSTP_Port.master_state) {
|
||||
case MSTP_MASTER_STATE_IDLE:
|
||||
dwMilliseconds = Tno_token;
|
||||
@@ -348,7 +349,7 @@ bool dlmstp_compare_data_expecting_reply(
|
||||
request.address.mac[0] = src_address;
|
||||
request.address.mac_len = 1;
|
||||
offset =
|
||||
npdu_decode(&request_pdu[0], NULL, &request.address,
|
||||
(uint16_t)npdu_decode(&request_pdu[0], NULL, &request.address,
|
||||
&request.npdu_data);
|
||||
if (request.npdu_data.network_layer_message) {
|
||||
return false;
|
||||
@@ -366,7 +367,7 @@ bool dlmstp_compare_data_expecting_reply(
|
||||
/* decode the reply data */
|
||||
bacnet_address_copy(&reply.address, dest_address);
|
||||
offset =
|
||||
npdu_decode(&reply_pdu[0], &reply.address, NULL, &reply.npdu_data);
|
||||
(uint16_t)npdu_decode(&reply_pdu[0], &reply.address, NULL, &reply.npdu_data);
|
||||
if (reply.npdu_data.network_layer_message) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -94,9 +94,10 @@ void strupper(
|
||||
{
|
||||
char *p;
|
||||
for (p = str; *p != '\0'; ++p) {
|
||||
*p = toupper(*p);
|
||||
*p = (char)toupper(*p);
|
||||
}
|
||||
}
|
||||
#pragma
|
||||
|
||||
/****************************************************************************
|
||||
* DESCRIPTION: Initializes the RS485 hardware and variables, and starts in
|
||||
|
||||
Reference in New Issue
Block a user