From 11c40ce9ae842585926cc1abd029f9f5a6702827 Mon Sep 17 00:00:00 2001 From: evans1629 Date: Sun, 2 Nov 2003 21:06:39 +0000 Subject: [PATCH] Fixed localtime/gmtime null anntation. --- lib/standard.h | 5 +++-- src/cpplib.c | 7 +++++++ src/fileTable.c | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/standard.h b/lib/standard.h index ee6185f..7e2288b 100644 --- a/lib/standard.h +++ b/lib/standard.h @@ -1142,9 +1142,10 @@ time_t time (/*@null@*/ /*@out@*/ time_t *tp) /*@observer@*/ char *ctime (time_t *tp) /*@*/ /*@ensures maxSet(result) == 25 /\ maxRead(result) == 25; @*/; -/*@null@*/ /*@observer@*/ struct tm *gmtime (time_t *tp) /*@*/ ; +/* 2003-11-01: remove null annotation: gmtima and localtime cannot return null */ +/*@observer@*/ struct tm *gmtime (time_t *tp) /*@*/ ; -/*@null@*/ /*@observer@*/ struct tm *localtime (time_t *tp) +/*@observer@*/ struct tm *localtime (time_t *tp) /*@modifies errno@*/ ; size_t strftime (/*@out@*/ char *s, size_t smax, diff --git a/src/cpplib.c b/src/cpplib.c index fd8356f..5aff1e9 100644 --- a/src/cpplib.c +++ b/src/cpplib.c @@ -70,7 +70,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # include # if defined (WIN32) || defined (OS2) && defined (__IBMC__) # include +/* SMF */ +# ifndef BCC32 # include /* for __DATE__ and __TIME__ */ +# endif + # include # else # ifndef VMS @@ -356,6 +360,8 @@ static void cppReader_scanBuffer (cppReader *p_pfile); # if defined (WIN32) || defined (OS2) && defined (__IBMC__) +/* SMF */ +# ifndef BCC32 /* ** WIN32 (at least the VC++ include files) does not define mode_t. */ @@ -363,6 +369,7 @@ static void cppReader_scanBuffer (cppReader *p_pfile); /*@-incondefs@*/ /*@-czechtypes@*/ typedef unsigned int mode_t; /*@=incondefs@*/ /*@=czechtypes@*/ +# endif # endif diff --git a/src/fileTable.c b/src/fileTable.c index 01291f0..0b23d1b 100644 --- a/src/fileTable.c +++ b/src/fileTable.c @@ -1014,7 +1014,7 @@ fileTable_addOpen (fileTable ft, /*@observer@*/ FILE *f, /*@only@*/ cstring fnam FILE *fileTable_createFile (fileTable ft, cstring fname) { -# ifdef WIN32 +# if defined (WIN32) && !defined (BCC32) int fdesc = _open (cstring_toCharsSafe (fname), O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, _S_IWRITE | S_IREAD); @@ -1054,7 +1054,7 @@ FILE *fileTable_createFile (fileTable ft, cstring fname) FILE *fileTable_createMacrosFile (fileTable ft, cstring fname) { -# ifdef WIN32 +# if defined (WIN32) && !defined (BCC32) int fdesc = _open (cstring_toCharsSafe (fname), O_RDWR | O_CREAT | O_TRUNC | O_EXCL, _S_IREAD | _S_IWRITE); -- 2.45.0