summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAntti-Juhani Kaijanaho <ajk@debian.org>2012-06-09 00:36:51 +0300
committerAntti-Juhani Kaijanaho <ajk@debian.org>2012-06-09 00:36:51 +0300
commit6a1d34df52e73cfa3aea92af16f5c51ea41131f0 (patch)
tree5172a3e69ab8e40c735a8df17641a04a052de7d4 /lib
parent541b6b9ec2dfbad0248b1e40fbc9b706b86decff (diff)
downloaddctrl-tools-6a1d34df52e73cfa3aea92af16f5c51ea41131f0.tar.gz
No need to name rv in fsaf_read.
Signed-off-by: Antti-Juhani Kaijanaho <ajk@debian.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/fsaf.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/fsaf.h b/lib/fsaf.h
index 516d86a..96f2282 100644
--- a/lib/fsaf.h
+++ b/lib/fsaf.h
@@ -58,17 +58,13 @@ struct fsaf_read_rv {
static inline
struct fsaf_read_rv fsaf_read(FSAF * fp, size_t offset, size_t len)
{
- struct fsaf_read_rv rv;
-
void fsaf_slurp(FSAF * fp, size_t len);
/* Reading nothing - since offset can be bogus in this
* situation, this could foul up our assumptions later, so
* return already here. */
if (len == 0) {
- rv.b = "";
- rv.len = 0;
- return rv;
+ return (struct fsaf_read_rv){ .b = "", .len = 0 };
}
/* Make sure we don't read past the EOF mark. */
@@ -85,9 +81,10 @@ struct fsaf_read_rv fsaf_read(FSAF * fp, size_t offset, size_t len)
assert(offset - fp->buf_offset + len <= fp->buf_size);
assert(offset + len <= fp->eof_mark);
- rv.b = fp->buf + (offset - fp->buf_offset);
- rv.len = len;
- return rv;
+ return (struct fsaf_read_rv){
+ .b = fp->buf + (offset - fp->buf_offset),
+ .len = len
+ };
}
/* Behaves like fsaf_read except that the result is put in a malloc'd