aboutsummaryrefslogtreecommitdiffstats
path: root/common/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-10-20 13:53:23 +0000
committerWerner Koch <[email protected]>2008-10-20 13:53:23 +0000
commit0a5f7424660e404e5fd0361b9331d154acf01d6c (patch)
treeb84fb5a994045e12eb326441d8c924094bd915cd /common/iobuf.c
parentFix a bug in estream_snprintf. Found by a failed t-gettime under Windows. (diff)
downloadgnupg-0a5f7424660e404e5fd0361b9331d154acf01d6c.tar.gz
gnupg-0a5f7424660e404e5fd0361b9331d154acf01d6c.zip
Marked all unused args on non-W32 platforms.
Diffstat (limited to '')
-rw-r--r--common/iobuf.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index abe2b5be5..6c493b512 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -412,14 +412,20 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
size_t nbytes = 0;
int rc = 0;
+ (void)chain; /* Not used. */
+
#ifdef FILE_FILTER_USES_STDIO
if (control == IOBUFCTRL_UNDERFLOW)
{
- assert (size); /* need a buffer */
+ assert (size); /* We need a buffer. */
if (feof (f))
- { /* On terminals you could easiely read as many EOFs as you call */
- rc = -1; /* fread() or fgetc() repeatly. Every call will block until you press */
- *ret_len = 0; /* CTRL-D. So we catch this case before we call fread() again. */
+ {
+ /* On terminals you could easily read as many EOFs as you
+ call fread() or fgetc() repeatly. Every call will block
+ until you press CTRL-D. So we catch this case before we
+ call fread() again. */
+ rc = -1;
+ *ret_len = 0;
}
else
{
@@ -427,7 +433,7 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
nbytes = fread (buf, 1, size, f);
if (feof (f) && !nbytes)
{
- rc = -1; /* okay: we can return EOF now. */
+ rc = -1; /* Okay: we can return EOF now. */
}
else if (ferror (f) && errno != EPIPE)
{
@@ -469,13 +475,13 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
fclose (f);
}
f = NULL;
- xfree (a); /* we can free our context now */
+ xfree (a); /* We can free our context now. */
}
#else /* !stdio implementation */
if (control == IOBUFCTRL_UNDERFLOW)
{
- assert (size); /* need a buffer */
+ assert (size); /* We need a buffer. */
if (a->eof_seen)
{
rc = -1;
@@ -620,9 +626,9 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
}
f = INVALID_FP;
#endif
- xfree (a); /* we can free our context now */
+ xfree (a); /* We can free our context now. */
}
-#endif /* !stdio implementation */
+#endif /* !stdio implementation. */
return rc;
}
@@ -639,6 +645,8 @@ sock_filter (void *opaque, int control, iobuf_t chain, byte * buf,
size_t nbytes = 0;
int rc = 0;
+ (void)chain;
+
if (control == IOBUFCTRL_UNDERFLOW)
{
assert (size); /* need a buffer */
@@ -2408,6 +2416,8 @@ translate_file_handle (int fd, int for_write)
# else
{
int x;
+
+ (void)for_write;
if (fd == 0)
x = (int) GetStdHandle (STD_INPUT_HANDLE);
@@ -2425,6 +2435,8 @@ translate_file_handle (int fd, int for_write)
fd = x;
}
# endif
+#else
+ (void)for_write;
#endif
return fd;
}