summaryrefslogtreecommitdiffstats
path: root/common/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2005-06-16 10:12:03 +0200
committerWerner Koch <wk@gnupg.org>2005-06-16 10:12:03 +0200
commitdeeba405a9a5868ea478db5003be6335ab9aac6f (patch)
treed61d720258fd571ec81a3d3e5d776320b7b1d796 /common/iobuf.c
parentNew debugging optionhs, updates to the manual. (diff)
downloadgnupg2-deeba405a9a5868ea478db5003be6335ab9aac6f.tar.xz
gnupg2-deeba405a9a5868ea478db5003be6335ab9aac6f.zip
gcc-4 defaults forced me to edit many many files to get rid of the
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
Diffstat (limited to 'common/iobuf.c')
-rw-r--r--common/iobuf.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index 52a388514..32b9e18c6 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -675,10 +675,11 @@ sock_filter (void *opaque, int control, iobuf_t chain, byte * buf,
* without a filter
*/
static int
-block_filter (void *opaque, int control, iobuf_t chain, byte * buf,
+block_filter (void *opaque, int control, iobuf_t chain, byte * buffer,
size_t * ret_len)
{
block_filter_ctx_t *a = opaque;
+ char *buf = (char *)buffer;
size_t size = *ret_len;
int c, needed, rc = 0;
char *p;
@@ -1762,7 +1763,7 @@ iobuf_flush (iobuf_t a)
if (a->use == 3)
{ /* increase the temp buffer */
- char *newbuf;
+ unsigned char *newbuf;
size_t newsize = a->d.size + 8192;
if (DBG_IOBUF)
@@ -1829,8 +1830,9 @@ iobuf_readbyte (iobuf_t a)
int
-iobuf_read (iobuf_t a, byte * buf, unsigned buflen)
+iobuf_read (iobuf_t a, void *buffer, unsigned int buflen)
{
+ unsigned char *buf = (unsigned char *)buffer;
int c, n;
if (a->unget.buf || a->nlimit)
@@ -1915,7 +1917,7 @@ iobuf_peek (iobuf_t a, byte * buf, unsigned buflen)
int
-iobuf_writebyte (iobuf_t a, unsigned c)
+iobuf_writebyte (iobuf_t a, unsigned int c)
{
int rc;
@@ -1933,8 +1935,9 @@ iobuf_writebyte (iobuf_t a, unsigned c)
int
-iobuf_write (iobuf_t a, byte * buf, unsigned buflen)
+iobuf_write (iobuf_t a, const void *buffer, unsigned int buflen)
{
+ const unsigned char *buf = (const unsigned char *)buffer;
int rc;
if (a->directfp)
@@ -2311,7 +2314,7 @@ iobuf_read_line (iobuf_t a, byte ** addr_of_buffer,
unsigned *length_of_buffer, unsigned *max_length)
{
int c;
- char *buffer = *addr_of_buffer;
+ char *buffer = (char *)*addr_of_buffer;
unsigned length = *length_of_buffer;
unsigned nbytes = 0;
unsigned maxlen = *max_length;
@@ -2321,7 +2324,7 @@ iobuf_read_line (iobuf_t a, byte ** addr_of_buffer,
{ /* must allocate a new buffer */
length = 256;
buffer = xmalloc (length);
- *addr_of_buffer = buffer;
+ *addr_of_buffer = (unsigned char *)buffer;
*length_of_buffer = length;
}
@@ -2344,7 +2347,7 @@ iobuf_read_line (iobuf_t a, byte ** addr_of_buffer,
length += 3; /* correct for the reserved byte */
length += length < 1024 ? 256 : 1024;
buffer = xrealloc (buffer, length);
- *addr_of_buffer = buffer;
+ *addr_of_buffer = (unsigned char *)buffer;
*length_of_buffer = length;
length -= 3; /* and reserve again */
p = buffer + nbytes;