From a635daa6b6de2bbc40d723337e842ee86e751086 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Tue, 6 Dec 2005 18:24:57 +0000 Subject: [PATCH] * mkdtemp.c (mkdtemp): Fix warning. * secmem.c, assuan-buffer.c, dotlock.c: Fix a few warnings from printf-ing %p where the arg wasn't void *. --- util/ChangeLog | 7 +++++++ util/assuan-buffer.c | 18 +++++++++--------- util/dotlock.c | 4 ++-- util/mkdtemp.c | 2 +- util/secmem.c | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/util/ChangeLog b/util/ChangeLog index ff451b26d..d69853c44 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,10 @@ +2005-12-06 David Shaw + + * mkdtemp.c (mkdtemp): Fix warning. + + * secmem.c, assuan-buffer.c, dotlock.c: Fix a few warnings from + printf-ing %p where the arg wasn't void *. + 2005-11-02 David Shaw * util.c [!HAVE_DECL_GETPAGESIZE]: Prototype getpagesize() if diff --git a/util/assuan-buffer.c b/util/assuan-buffer.c index 7d40b2c53..3c0108601 100644 --- a/util/assuan-buffer.c +++ b/util/assuan-buffer.c @@ -139,7 +139,7 @@ _assuan_read_line (assuan_context_t ctx) if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%u.%p] DBG: <- [Error: %s]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx, strerror (errno)); + (unsigned int)getpid (), (void *)ctx, strerror (errno)); return ASSUAN_Read_Error; } if (!nread) @@ -148,7 +148,7 @@ _assuan_read_line (assuan_context_t ctx) if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%u.%p] DBG: <- [EOF]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); return -1; } @@ -181,7 +181,7 @@ _assuan_read_line (assuan_context_t ctx) { fprintf (ctx->log_fp, "%s[%u.%p] DBG: <- ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else @@ -197,7 +197,7 @@ _assuan_read_line (assuan_context_t ctx) if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%u.%p] DBG: <- [Invalid line]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); *line = 0; ctx->inbound.linelen = 0; return ctx->inbound.eof ? ASSUAN_Line_Not_Terminated @@ -253,7 +253,7 @@ _assuan_write_line (assuan_context_t ctx, const char *prefix, fprintf (ctx->log_fp, "%s[%u.%p] DBG: -> " "[supplied line too long -truncated]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); if (prefixlen > 5) prefixlen = 5; if (len > ASSUAN_LINELENGTH - prefixlen - 2) @@ -265,7 +265,7 @@ _assuan_write_line (assuan_context_t ctx, const char *prefix, { fprintf (ctx->log_fp, "%s[%u.%p] DBG: -> ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else @@ -313,7 +313,7 @@ assuan_write_line (assuan_context_t ctx, const char *line) fprintf (ctx->log_fp, "%s[%u.%p] DBG: -> " "[supplied line contained a LF -truncated]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); return _assuan_write_line (ctx, NULL, line, len); } @@ -370,7 +370,7 @@ _assuan_cookie_write_data (void *cookie, const char *buffer, size_t orig_size) { fprintf (ctx->log_fp, "%s[%u.%p] DBG: -> ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); @@ -418,7 +418,7 @@ _assuan_cookie_write_flush (void *cookie) { fprintf (ctx->log_fp, "%s[%u.%p] DBG: -> ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx); + (unsigned int)getpid (), (void *)ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else diff --git a/util/dotlock.c b/util/dotlock.c index b64458e92..9edac57ed 100644 --- a/util/dotlock.c +++ b/util/dotlock.c @@ -145,10 +145,10 @@ create_dotlock( const char *file_to_lock ) h->tname = xmalloc( dirpartlen + 6+30+ strlen(nodename) + 11 ); #ifndef __riscos__ sprintf( h->tname, "%.*s/.#lk%p.%s.%d", - dirpartlen, dirpart, h, nodename, (int)getpid() ); + dirpartlen, dirpart, (void *)h, nodename, (int)getpid() ); #else /* __riscos__ */ sprintf( h->tname, "%.*s.lk%p/%s/%d", - dirpartlen, dirpart, h, nodename, (int)getpid() ); + dirpartlen, dirpart, (void *)h, nodename, (int)getpid() ); #endif /* __riscos__ */ do { diff --git a/util/mkdtemp.c b/util/mkdtemp.c index 25ace4fc5..c0ee0bbdb 100644 --- a/util/mkdtemp.c +++ b/util/mkdtemp.c @@ -40,7 +40,7 @@ char *mkdtemp(char *template) { unsigned int attempts,idx,count=0; - byte *ch; + char *ch; idx=strlen(template); diff --git a/util/secmem.c b/util/secmem.c index a3ab60155..6da58b2e6 100644 --- a/util/secmem.c +++ b/util/secmem.c @@ -409,7 +409,7 @@ secmexrealloc( void *p, size_t newsize ) mb = (MEMBLOCK*)((char*)p - ((size_t) &((MEMBLOCK*)0)->u.aligned.c)); size = mb->size; if (size < sizeof(MEMBLOCK)) - log_bug ("secure memory corrupted at block %p\n", mb); + log_bug ("secure memory corrupted at block %p\n", (void *)mb); size -= ((size_t) &((MEMBLOCK*)0)->u.aligned.c); if( newsize <= size )