Cleaned up warnings and errors when compiled with Borland C++ and with GCC.

This commit is contained in:
skarg
2009-11-19 16:05:22 +00:00
parent 46c78db995
commit 2b519a5570
3 changed files with 16 additions and 6 deletions
+13 -4
View File
@@ -26,7 +26,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h> /* for memmove */
#include <time.h>
#include <time.h> /* for timezone, localtime */
#include "bacdef.h"
#include "bacdcode.h"
#include "bacenum.h"
@@ -43,6 +43,12 @@
#include "bacfile.h" /* object list dependency */
#endif
#if defined(__BORLANDC__)
/* seems to not be defined in time.h as specified by The Open Group */
/* difference from UTC and local standard time */
long int timezone;
#endif
static object_count_function Object_Count[MAX_BACNET_OBJECT_TYPE];
static object_index_to_instance_function
Object_Index_To_Instance[MAX_BACNET_OBJECT_TYPE];
@@ -907,6 +913,9 @@ bool DeviceGetRRInfo(
BACNET_ERROR_CLASS *error_class,
BACNET_ERROR_CODE *error_code)
{
bool status = false; /* return value */
object = object;
switch(property) {
case PROP_VT_CLASSES_SUPPORTED:
case PROP_ACTIVE_VT_SESSIONS:
@@ -923,8 +932,8 @@ bool DeviceGetRRInfo(
case PROP_DEVICE_ADDRESS_BINDING:
pInfo->RequestTypes = RR_BY_POSITION;
pInfo->Handler = &rr_address_list_encode;
return(true);
pInfo->Handler = rr_address_list_encode;
status = true;
break;
case PROP_ACTIVE_COV_SUBSCRIPTIONS:
@@ -938,7 +947,7 @@ bool DeviceGetRRInfo(
break;
}
return(false);
return status;
}
#ifdef TEST
+1
View File
@@ -46,6 +46,7 @@ int gettimeofday(
{
struct _timeb timebuffer;
tzp = tzp;
_ftime(&timebuffer);
tp->tv_sec = timebuffer.time;
tp->tv_usec = timebuffer.millitm * 1000;
+2 -2
View File
@@ -70,7 +70,7 @@ int rr_encode_apdu(
uint8_t invoke_id,
BACNET_READ_RANGE_DATA * rrdata)
{
int apdu_len; /* total length of the apdu, return value */
int apdu_len = 0; /* total length of the apdu, return value */
if (apdu) {
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
@@ -299,7 +299,7 @@ int rr_ack_encode_apdu(
BACNET_READ_RANGE_DATA * rrdata)
{
int len = 0; /* length of each encoding */
int apdu_len; /* total length of the apdu, return value */
int apdu_len = 0; /* total length of the apdu, return value */
if (apdu) {
apdu[0] = PDU_TYPE_COMPLEX_ACK; /* complex ACK service */