aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-07-15 01:04:14 +0200
committerMattias Andrée <maandree@kth.se>2017-07-15 01:04:14 +0200
commitf3cde9060c57320c9ed7a9b4bcb494bd411fb1f4 (patch)
tree41a1a50970c7875038e25b6a0a632e23b1ce6001 /src/util.c
parentFix blind-{cross,dot,quaternion}-product and blind-vector-projection (diff)
downloadblind-f3cde9060c57320c9ed7a9b4bcb494bd411fb1f4.tar.gz
blind-f3cde9060c57320c9ed7a9b4bcb494bd411fb1f4.tar.bz2
blind-f3cde9060c57320c9ed7a9b4bcb494bd411fb1f4.tar.xz
Fix warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util.c b/src/util.c
index 7746adb..3e03b67 100644
--- a/src/util.c
+++ b/src/util.c
@@ -94,9 +94,9 @@ erange:
int
-writeall(int fd, void *buf, size_t n)
+writeall(int fd, const void *buf, size_t n)
{
- char *buffer = buf;
+ const char *buffer = buf;
ssize_t r;
while (n) {
r = write(fd, buffer, n);
@@ -122,13 +122,13 @@ readall(int fd, void *buf, size_t n)
break;
ptr += (size_t)r;
}
- return ptr;
+ return (ssize_t)ptr;
}
int
-pwriteall(int fd, void *buf, size_t n, off_t ptr)
+pwriteall(int fd, const void *buf, size_t n, off_t ptr)
{
- char *buffer = buf;
+ const char *buffer = buf;
ssize_t r;
while (n) {
r = pwrite(fd, buffer, n, (off_t)ptr);
@@ -142,7 +142,7 @@ pwriteall(int fd, void *buf, size_t n, off_t ptr)
}
int
-writezeroes(int fd, void *buf, size_t bufsize, size_t n)
+writezeroes(int fd, const void *buf, size_t bufsize, size_t n)
{
size_t p, m;
for (p = 0; p < n; p += m) {