From 7ac98eb7e62335f5bb191d2c399d7dae5c1e62ab Mon Sep 17 00:00:00 2001 From: evans1629 Date: Fri, 21 May 2004 12:57:21 +0000 Subject: [PATCH] Added va_copy to standard.h. --- lib/posix.h | 4 ++++ lib/standard.h | 2 ++ src/Headers/cstringTable.h | 2 +- src/Headers/system_constants.h | 2 +- src/cstringTable.c | 20 ++++++++++---------- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/posix.h b/lib/posix.h index fbe0937..aa35f6d 100644 --- a/lib/posix.h +++ b/lib/posix.h @@ -467,6 +467,10 @@ struct stat { time_t st_mtime; /* evans 2001-08-23 - these were previously st_st_mtime - POSIX spec says st_mtime */ time_t st_ctime; /* evans 2001-08-23 - these were previously st_st_ctime - POSIX spec says st_ctime */ } ; +/* +** evans 2004-05-19: dependent annotations atted for time_t fields. Could not find +** any clear documetation on this, but it seems to be correct. +*/ /* ** POSIX does not require that the S_I* be functions. They're diff --git a/lib/standard.h b/lib/standard.h index 7e2288b..1ae8d37 100644 --- a/lib/standard.h +++ b/lib/standard.h @@ -469,6 +469,8 @@ typedef /*@abstract@*/ /*@mutable@*/ void *va_list; void va_start (/*@out@*/ va_list ap, ...) /*@modifies ap;@*/ ; void va_end (va_list va) /*@modifies va;@*/ ; +void va_copy (/*@out@*/ va_list dest, va_list src) /*modifies dest;@*/ ; + /* ** va_arg is builtin */ diff --git a/src/Headers/cstringTable.h b/src/Headers/cstringTable.h index ea3ddf1..40516b3 100644 --- a/src/Headers/cstringTable.h +++ b/src/Headers/cstringTable.h @@ -54,7 +54,7 @@ extern /*@falsewhennull@*/ bool cstringTable_isDefined(cstringTable) /*@*/ ; extern /*@nullwhentrue@*/ /*@unused@*/ bool cstringTable_isUndefined(cstringTable) /*@*/ ; # define cstringTable_isUndefined(p_h) ((p_h) == cstringTable_undefined) -extern /*@only@*/ cstringTable cstringTable_create(int p_size) /*@*/ ; +extern /*@only@*/ cstringTable cstringTable_create(unsigned long p_size) /*@*/ ; extern void cstringTable_insert (cstringTable p_h, /*@only@*/ cstring p_key, int p_value) /*@modifies p_h@*/ ; diff --git a/src/Headers/system_constants.h b/src/Headers/system_constants.h index df6bda5..513fd2c 100644 --- a/src/Headers/system_constants.h +++ b/src/Headers/system_constants.h @@ -116,7 +116,7 @@ /*@constant int CGLOBBASESIZE; @*/ # define CGLOBBASESIZE 1024 -/*@constant int CGLOBHASHSIZE; @*/ +/*@constant unsigned long CGLOBHASHSIZE; @*/ # define CGLOBHASHSIZE 1795 /*@constant int LLHASHSIZE; @*/ diff --git a/src/cstringTable.c b/src/cstringTable.c index d53ab14..c6cacbe 100644 --- a/src/cstringTable.c +++ b/src/cstringTable.c @@ -217,7 +217,7 @@ static int cstringTable_countCollisions (cstringTable h) { int nc = 0; - unsigned int i; + unsigned long i; llassert (cstringTable_isDefined (h)); @@ -234,7 +234,7 @@ static int cstringTable_countEmpty (cstringTable h) { int nc = 0; - unsigned int i; + unsigned long i; llassert (cstringTable_isDefined (h)); @@ -276,9 +276,9 @@ cstringTable_hash (/*@notnull@*/ cstringTable h, cstring key) /*@only@*/ cstringTable -cstringTable_create (unsigned int size) +cstringTable_create (unsigned long size) { - int i; + unsigned long i; cstringTable h = (cstringTable) dmalloc (sizeof (*h)); h->size = size; @@ -297,7 +297,7 @@ cstringTable_create (unsigned int size) cstring cstringTable_unparse (cstringTable h) { cstring res = cstring_newEmpty (); - unsigned int i; + unsigned long i; if (cstringTable_isDefined (h)) { @@ -307,11 +307,11 @@ cstring cstringTable_unparse (cstringTable h) if (hb != NULL) { - res = message ("%q%d. %q\n", res, i, hbucket_unparse (hb)); + res = message ("%q%ul. %q\n", res, i, hbucket_unparse (hb)); } } - res = message ("%qsize: %u, collisions: %d, empty: %d", + res = message ("%qsize: %ul, collisions: %d, empty: %d", res, h->size, cstringTable_countCollisions (h), @@ -331,7 +331,7 @@ cstring cstringTable_unparse (cstringTable h) cstringTable_stats (cstringTable h) { llassert (cstringTable_isDefined (h)); - return (message ("size: %u, collisions: %d, empty: %d\n", + return (message ("size: %ul, collisions: %d, empty: %d\n", h->size, cstringTable_countCollisions (h), cstringTable_countEmpty (h))); } @@ -343,7 +343,7 @@ cstringTable_rehash (/*@notnull@*/ cstringTable h) ** rehashing based (loosely) on code by Steve Harrison */ - unsigned int i; + unsigned long i; /* Fix provided by Thomas Mertz (int -> unsigned long), 21 Apr 2004 */ unsigned long oldsize = h->size; unsigned long newsize = 1 + ((oldsize * 26244) / 10000); /* 26244 = 162^2 */ @@ -424,7 +424,7 @@ cstringTable_addEntry (/*@notnull@*/ cstringTable h, /*@only@*/ hentry e) void cstringTable_insert (cstringTable h, cstring key, int value) { - unsigned int hindex; + unsigned long hindex; hbucket hb; hentry e; -- 2.45.0