Corrected warnings generated from the Visual C++ 6.0 compiler. Updated the Visual C++ 6.0 ports demo project. Updated the Borland C++ ports demo project.

This commit is contained in:
skarg
2007-02-13 20:41:22 +00:00
parent 714a3b094f
commit b03a5416e6
8 changed files with 45 additions and 27 deletions
+9 -9
View File
@@ -102,12 +102,12 @@ static uint32_t days_since_epoch(uint16_t year, uint8_t month, uint8_t day)
static void days_since_epoch_into_ymd(uint32_t days, static void days_since_epoch_into_ymd(uint32_t days,
uint16_t * pYear, uint8_t * pMonth, uint8_t * pDay) uint16_t * pYear, uint8_t * pMonth, uint8_t * pDay)
{ {
int year = 1900; uint16_t year = 1900;
int month = 1; uint8_t month = 1;
int day = 1; uint8_t day = 1;
while (days >= 365) { while (days >= 365) {
if ((is_leap_year(year)) && days == 365) if ((is_leap_year(year)) && (days == 365))
break; break;
days -= 365; days -= 365;
if (is_leap_year(year)) if (is_leap_year(year))
@@ -120,7 +120,7 @@ static void days_since_epoch_into_ymd(uint32_t days,
month++; month++;
} }
day += days; day += ((uint8_t)days);
if (pYear) if (pYear)
*pYear = year; *pYear = year;
@@ -137,7 +137,7 @@ static void days_since_epoch_into_ymd(uint32_t days,
/* wday 1=Monday...7=Sunday */ /* wday 1=Monday...7=Sunday */
static uint8_t day_of_week(uint16_t year, uint8_t month, uint8_t day) static uint8_t day_of_week(uint16_t year, uint8_t month, uint8_t day)
{ {
return ((days_since_epoch(year, month, day) % 7) + 1); return ((uint8_t)(days_since_epoch(year, month, day) % 7) + 1);
} }
/* if the date1 is the same as date2, return is 0 /* if the date1 is the same as date2, return is 0
@@ -292,9 +292,9 @@ static void seconds_since_midnight_into_hms(uint32_t seconds,
uint8_t hour = 0; uint8_t hour = 0;
uint8_t minute = 0; uint8_t minute = 0;
hour = seconds / (60 * 60); hour = (uint8_t)(seconds / (60 * 60));
seconds -= (hour * 60 * 60); seconds -= (hour * 60 * 60);
minute = seconds / 60; minute = (uint8_t)(seconds / 60);
seconds -= (minute * 60); seconds -= (minute * 60);
if (pHours) if (pHours)
@@ -302,7 +302,7 @@ static void seconds_since_midnight_into_hms(uint32_t seconds,
if (pMinutes) if (pMinutes)
*pMinutes = minute; *pMinutes = minute;
if (pSeconds) if (pSeconds)
*pSeconds = seconds; *pSeconds = (uint8_t)seconds;
} }
void datetime_add_minutes(BACNET_DATE_TIME * bdatetime, uint32_t minutes) void datetime_add_minutes(BACNET_DATE_TIME * bdatetime, uint32_t minutes)
+1 -1
View File
@@ -170,7 +170,7 @@ bool Analog_Output_Present_Value_Set(
if (priority && (priority <= BACNET_MAX_PRIORITY) && if (priority && (priority <= BACNET_MAX_PRIORITY) &&
(priority != 6 /* reserved */ ) && (priority != 6 /* reserved */ ) &&
(value >= 0.0) && (value <= 100.0)) { (value >= 0.0) && (value <= 100.0)) {
Analog_Output_Level[index][priority] = value; Analog_Output_Level[index][priority] = (uint8_t)value;
/* Note: you could set the physical output here to the next /* Note: you could set the physical output here to the next
highest priority, or to the relinquish default if no highest priority, or to the relinquish default if no
priorities are set. priorities are set.
+6 -4
View File
@@ -254,10 +254,12 @@ struct tm {
timer = time(NULL); timer = time(NULL);
tblock = localtime(&timer); tblock = localtime(&timer);
datetime_set_values(bdatetime, datetime_set_values(bdatetime,
tblock->tm_year, (uint16_t)tblock->tm_year,
tblock->tm_mon, (uint8_t)tblock->tm_mon,
tblock->tm_mday, (uint8_t)tblock->tm_mday,
tblock->tm_hour, tblock->tm_min, tblock->tm_sec, 0); (uint8_t)tblock->tm_hour,
(uint8_t)tblock->tm_min,
(uint8_t)tblock->tm_sec, 0);
} }
/* convert the shed level request into an Analog Output Present_Value */ /* convert the shed level request into an Analog Output Present_Value */
Binary file not shown.
+13 -1
View File
@@ -169,7 +169,7 @@ SOURCE=..\..\..\crc.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\datalink.c SOURCE=..\..\..\datetime.c
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -217,6 +217,14 @@ SOURCE=..\..\..\indtext.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\demo\object\lc.c
# End Source File
# Begin Source File
SOURCE=..\..\..\demo\object\lc.h
# End Source File
# Begin Source File
SOURCE=..\..\..\demo\object\lsp.c SOURCE=..\..\..\demo\object\lsp.c
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -377,6 +385,10 @@ SOURCE=..\..\..\datalink.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\datetime.h
# End Source File
# Begin Source File
SOURCE=..\..\..\demo\object\device.h SOURCE=..\..\..\demo\object\device.h
# End Source File # End Source File
# Begin Source File # Begin Source File
Binary file not shown.
Binary file not shown.
+16 -12
View File
@@ -6,7 +6,7 @@
--------------------Configuration: bacnet - Win32 Debug-------------------- --------------------Configuration: bacnet - Win32 Debug--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP133F.tmp" with contents Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP606.tmp" with contents
[ [
/nologo /MLd /W3 /Gm /GX /ZI /Od /I "..\..\.." /I ".." /I "..\..\..\demo\object\\" /I "..\..\..\demo\handler\\" /D "_DEBUG" /D BACDL_BIP=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TSM_ENABLED=1 /D PRINT_ENABLED=1 /D BIG_ENDIAN=0 /D USE_INADDR=0 /FR"Debug/" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c /nologo /MLd /W3 /Gm /GX /ZI /Od /I "..\..\.." /I ".." /I "..\..\..\demo\object\\" /I "..\..\..\demo\handler\\" /D "_DEBUG" /D BACDL_BIP=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D TSM_ENABLED=1 /D PRINT_ENABLED=1 /D BIG_ENDIAN=0 /D USE_INADDR=0 /FR"Debug/" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\code\bacnet-stack\abort.c" "C:\code\bacnet-stack\abort.c"
@@ -29,7 +29,6 @@ Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP133F.tmp" with conte
"C:\code\bacnet-stack\demo\object\bo.c" "C:\code\bacnet-stack\demo\object\bo.c"
"C:\code\bacnet-stack\demo\object\bv.c" "C:\code\bacnet-stack\demo\object\bv.c"
"C:\code\bacnet-stack\crc.c" "C:\code\bacnet-stack\crc.c"
"C:\code\bacnet-stack\datalink.c"
"C:\code\bacnet-stack\dcc.c" "C:\code\bacnet-stack\dcc.c"
"C:\code\bacnet-stack\demo\object\device.c" "C:\code\bacnet-stack\demo\object\device.c"
"C:\code\bacnet-stack\demo\handler\h_arf.c" "C:\code\bacnet-stack\demo\handler\h_arf.c"
@@ -56,9 +55,11 @@ Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP133F.tmp" with conte
"C:\code\bacnet-stack\demo\handler\txbuf.c" "C:\code\bacnet-stack\demo\handler\txbuf.c"
"C:\code\bacnet-stack\whois.c" "C:\code\bacnet-stack\whois.c"
"C:\code\bacnet-stack\wp.c" "C:\code\bacnet-stack\wp.c"
"C:\code\bacnet-stack\demo\object\lc.c"
"C:\code\bacnet-stack\datetime.c"
] ]
Creating command line "cl.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP133F.tmp" Creating command line "cl.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP606.tmp"
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP1340.tmp" with contents Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP607.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 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" ".\Debug\abort.obj"
@@ -81,7 +82,6 @@ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32
".\Debug\bo.obj" ".\Debug\bo.obj"
".\Debug\bv.obj" ".\Debug\bv.obj"
".\Debug\crc.obj" ".\Debug\crc.obj"
".\Debug\datalink.obj"
".\Debug\dcc.obj" ".\Debug\dcc.obj"
".\Debug\device.obj" ".\Debug\device.obj"
".\Debug\h_arf.obj" ".\Debug\h_arf.obj"
@@ -108,8 +108,10 @@ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32
".\Debug\txbuf.obj" ".\Debug\txbuf.obj"
".\Debug\whois.obj" ".\Debug\whois.obj"
".\Debug\wp.obj" ".\Debug\wp.obj"
".\Debug\lc.obj"
".\Debug\datetime.obj"
] ]
Creating command line "link.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP1340.tmp" Creating command line "link.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP607.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
abort.c abort.c
@@ -134,7 +136,6 @@ bv.c
crc.c crc.c
Generating Code... Generating Code...
Compiling... Compiling...
datalink.c
dcc.c dcc.c
device.c device.c
h_arf.c h_arf.c
@@ -154,18 +155,20 @@ npdu.c
reject.c reject.c
ringbuf.c ringbuf.c
rp.c rp.c
s_rp.c
Generating Code... Generating Code...
Compiling... Compiling...
s_rp.c
s_whois.c s_whois.c
s_wp.c s_wp.c
tsm.c tsm.c
txbuf.c txbuf.c
whois.c whois.c
wp.c wp.c
lc.c
datetime.c
Generating Code... Generating Code...
Linking... Linking...
Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP1342.tmp" with contents Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP609.tmp" with contents
[ [
/nologo /o"Debug/bacnet.bsc" /nologo /o"Debug/bacnet.bsc"
".\Debug\abort.sbr" ".\Debug\abort.sbr"
@@ -188,7 +191,6 @@ Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP1342.tmp" with conte
".\Debug\bo.sbr" ".\Debug\bo.sbr"
".\Debug\bv.sbr" ".\Debug\bv.sbr"
".\Debug\crc.sbr" ".\Debug\crc.sbr"
".\Debug\datalink.sbr"
".\Debug\dcc.sbr" ".\Debug\dcc.sbr"
".\Debug\device.sbr" ".\Debug\device.sbr"
".\Debug\h_arf.sbr" ".\Debug\h_arf.sbr"
@@ -214,8 +216,10 @@ Creating temporary file "C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP1342.tmp" with conte
".\Debug\tsm.sbr" ".\Debug\tsm.sbr"
".\Debug\txbuf.sbr" ".\Debug\txbuf.sbr"
".\Debug\whois.sbr" ".\Debug\whois.sbr"
".\Debug\wp.sbr"] ".\Debug\wp.sbr"
Creating command line "bscmake.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP1342.tmp" ".\Debug\lc.sbr"
".\Debug\datetime.sbr"]
Creating command line "bscmake.exe @C:\DOCUME~1\stk01\LOCALS~1\Temp\RSP609.tmp"
Creating browse info file... Creating browse info file...
<h3>Output Window</h3> <h3>Output Window</h3>