diff options
author | jbj <devnull@localhost> | 2000-10-31 16:18:34 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2000-10-31 16:18:34 +0000 |
commit | ce1e8d26ec5c76550c59fa30b6e6787e21f866e0 (patch) | |
tree | 3a3eba857ddc88c3367cbebb80e7800945ab9bbc /rpmio/rpmmalloc.c | |
parent | d69a6f7c1c4901dd48ca730937ce67886fbf2c61 (diff) | |
download | rpm-ce1e8d26ec5c76550c59fa30b6e6787e21f866e0.tar.gz rpm-ce1e8d26ec5c76550c59fa30b6e6787e21f866e0.tar.bz2 rpm-ce1e8d26ec5c76550c59fa30b6e6787e21f866e0.zip |
- add support for SHA1 as well as MD5 message digests.
lclint annotations.
CVS patchset: 4234
CVS date: 2000/10/31 16:18:34
Diffstat (limited to 'rpmio/rpmmalloc.c')
-rw-r--r-- | rpmio/rpmmalloc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/rpmio/rpmmalloc.c b/rpmio/rpmmalloc.c index 5c878be2e..c99c6e713 100644 --- a/rpmio/rpmmalloc.c +++ b/rpmio/rpmmalloc.c @@ -8,9 +8,9 @@ #define EXIT_FAILURE 1 #endif -void *vmefail(size_t size) +/*@only@*/ void *vmefail(size_t size) { - fprintf(stderr, _("memory alloc (%u bytes) returned NULL.\n"), size); + fprintf(stderr, _("memory alloc (%u bytes) returned NULL.\n"), (unsigned)size); exit(EXIT_FAILURE); /*@notreached@*/ return NULL; @@ -18,17 +18,19 @@ void *vmefail(size_t size) #if !(HAVE_MCHECK_H && defined(__GNUC__)) -void * xmalloc (size_t size) +/*@only@*/ void * xmalloc (size_t size) { register void *value; if (size == 0) size++; value = malloc (size); if (value == 0) value = vmefail(size); + /*@-compdef@*/ return value; + /*@=compdef@*/ } -void * xcalloc (size_t nmemb, size_t size) +/*@only@*/ void * xcalloc (size_t nmemb, size_t size) { register void *value; if (size == 0) size++; @@ -39,7 +41,7 @@ void * xcalloc (size_t nmemb, size_t size) return value; } -void * xrealloc (void *ptr, size_t size) +/*@only@*/ void * xrealloc (/*@only@*/ void *ptr, size_t size) { register void *value; if (size == 0) size++; @@ -49,7 +51,7 @@ void * xrealloc (void *ptr, size_t size) return value; } -char * xstrdup (const char *str) +/*@only@*/ char * xstrdup (const char *str) { size_t size = strlen(str) + 1; char *newstr = (char *) malloc (size); |