From 2b519a55702be170373841a7a7c56c5858fddb81 Mon Sep 17 00:00:00 2001 From: skarg Date: Thu, 19 Nov 2009 16:05:22 +0000 Subject: [PATCH] Cleaned up warnings and errors when compiled with Borland C++ and with GCC. --- bacnet-stack/demo/object/device.c | 17 +++++++++++++---- bacnet-stack/ports/win32/timer.c | 1 + bacnet-stack/src/readrange.c | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bacnet-stack/demo/object/device.c b/bacnet-stack/demo/object/device.c index 5eab11a7..29b0b671 100644 --- a/bacnet-stack/demo/object/device.c +++ b/bacnet-stack/demo/object/device.c @@ -26,7 +26,7 @@ #include #include #include /* for memmove */ -#include +#include /* 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 diff --git a/bacnet-stack/ports/win32/timer.c b/bacnet-stack/ports/win32/timer.c index f03ab8ad..409b93b5 100644 --- a/bacnet-stack/ports/win32/timer.c +++ b/bacnet-stack/ports/win32/timer.c @@ -46,6 +46,7 @@ int gettimeofday( { struct _timeb timebuffer; + tzp = tzp; _ftime(&timebuffer); tp->tv_sec = timebuffer.time; tp->tv_usec = timebuffer.millitm * 1000; diff --git a/bacnet-stack/src/readrange.c b/bacnet-stack/src/readrange.c index d7c2ef26..9212fd37 100644 --- a/bacnet-stack/src/readrange.c +++ b/bacnet-stack/src/readrange.c @@ -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 */