aboutsummaryrefslogtreecommitdiff
path: root/libpipe
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-17 00:32:29 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-17 00:43:09 +0100
commitf5fb7c713ea443469406a691e60a6f4567a4cb75 (patch)
treeb16d979915b5ad7e32ffe77ca5f5006dc639a16e /libpipe
parentdd3048b2e483f66571cfa1b2ccebb2091b9ad990 (diff)
downloadhurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.gz
hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.bz2
hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.zip
Fix const warnings
Now that the RPCs have const, this forces us cleaning our const-meant functions.
Diffstat (limited to 'libpipe')
-rw-r--r--libpipe/dgram.c4
-rw-r--r--libpipe/pipe.c6
-rw-r--r--libpipe/pipe.h8
-rw-r--r--libpipe/pq.c4
-rw-r--r--libpipe/pq.h4
-rw-r--r--libpipe/seqpack.c4
-rw-r--r--libpipe/stream.c4
7 files changed, 17 insertions, 17 deletions
diff --git a/libpipe/dgram.c b/libpipe/dgram.c
index 30695f1e..96731ff2 100644
--- a/libpipe/dgram.c
+++ b/libpipe/dgram.c
@@ -25,9 +25,9 @@
/* See the definition of struct pipe_class in "pipe.h" for documentation. */
-static error_t
+static error_t
dgram_write (struct pq *pq, void *source,
- char *data, size_t data_len, size_t *amount)
+ const char *data, size_t data_len, size_t *amount)
{
struct packet *packet = pq_queue (pq, PACKET_TYPE_DATA, source);
if (!packet)
diff --git a/libpipe/pipe.c b/libpipe/pipe.c
index 8713a069..53b761d2 100644
--- a/libpipe/pipe.c
+++ b/libpipe/pipe.c
@@ -328,9 +328,9 @@ pipe_pair_select (struct pipe *rpipe, struct pipe *wpipe,
returned, nothing is done. */
error_t
pipe_send (struct pipe *pipe, int noblock, void *source,
- char *data, size_t data_len,
- char *control, size_t control_len,
- mach_port_t *ports, size_t num_ports,
+ const char *data, size_t data_len,
+ const char *control, size_t control_len,
+ const mach_port_t *ports, size_t num_ports,
size_t *amount)
{
error_t err;
diff --git a/libpipe/pipe.h b/libpipe/pipe.h
index eda38d24..1b1ef82f 100644
--- a/libpipe/pipe.h
+++ b/libpipe/pipe.h
@@ -51,7 +51,7 @@ struct pipe_class
char **data, size_t *data_len, size_t amount);
/* Write DATA &c into the packet queue PQ. */
error_t (*write)(struct pq *pq, void *source,
- char *data, size_t data_len, size_t *amount);
+ const char *data, size_t data_len, size_t *amount);
};
/* pipe_class flags */
@@ -377,9 +377,9 @@ pipe_drain (struct pipe *pipe)
of the data, to be provided to any readers of it; if no reader ever reads
it, it's deallocated by calling pipe_dealloc_addr. */
error_t pipe_send (struct pipe *pipe, int noblock, void *source,
- char *data, size_t data_len,
- char *control, size_t control_len,
- mach_port_t *ports, size_t num_ports,
+ const char *data, size_t data_len,
+ const char *control, size_t control_len,
+ const mach_port_t *ports, size_t num_ports,
size_t *amount);
/* Writes up to LEN bytes of DATA, to PIPE, which should be locked, and
diff --git a/libpipe/pq.c b/libpipe/pq.c
index fe7dd8ae..af380274 100644
--- a/libpipe/pq.c
+++ b/libpipe/pq.c
@@ -292,7 +292,7 @@ packet_dealloc_ports (struct packet *packet)
if a memory allocation error occurred, otherwise, 0. */
error_t
packet_set_ports (struct packet *packet,
- mach_port_t *ports, size_t num_ports)
+ const mach_port_t *ports, size_t num_ports)
{
if (packet->num_ports > 0)
packet_dealloc_ports (packet);
@@ -333,7 +333,7 @@ packet_read_ports (struct packet *packet,
and return the amount appended in AMOUNT if that's not the null pointer. */
error_t
packet_write (struct packet *packet,
- char *data, size_t data_len, size_t *amount)
+ const char *data, size_t data_len, size_t *amount)
{
error_t err = packet_ensure (packet, data_len);
diff --git a/libpipe/pq.h b/libpipe/pq.h
index 7238ace0..c2f64613 100644
--- a/libpipe/pq.h
+++ b/libpipe/pq.h
@@ -68,7 +68,7 @@ struct packet
/* Sets PACKET's ports to be PORTS, of length NUM_PORTS. ENOMEM is returned
if a memory allocation error occurred, otherwise, 0. */
error_t packet_set_ports (struct packet *packet,
- mach_port_t *ports, size_t num_ports);
+ const mach_port_t *ports, size_t num_ports);
/* If PACKET has any ports, deallocates them. */
void packet_dealloc_ports (struct packet *packet);
@@ -89,7 +89,7 @@ packet_readable (struct packet *packet)
/* Append the bytes in DATA, of length DATA_LEN, to what's already in PACKET,
and return the amount appended in AMOUNT if that's not the null pointer. */
error_t packet_write (struct packet *packet,
- char *data, size_t data_len, size_t *amount);
+ const char *data, size_t data_len, size_t *amount);
/* Removes up to AMOUNT bytes from the beginning of the data in PACKET, and
puts it into *DATA, and the amount read into DATA_LEN. If more than the
diff --git a/libpipe/seqpack.c b/libpipe/seqpack.c
index 041abb74..e34a5379 100644
--- a/libpipe/seqpack.c
+++ b/libpipe/seqpack.c
@@ -28,9 +28,9 @@
/* This type of pipe is the same as a SOCK_STREAM, but maintains record
boundaries. */
-static error_t
+static error_t
seqpack_write (struct pq *pq, void *source,
- char *data, size_t data_len, size_t *amount)
+ const char *data, size_t data_len, size_t *amount)
{
struct packet *packet = pq_queue (pq, PACKET_TYPE_DATA, source);
if (!packet)
diff --git a/libpipe/stream.c b/libpipe/stream.c
index 671907e7..758ebb64 100644
--- a/libpipe/stream.c
+++ b/libpipe/stream.c
@@ -31,9 +31,9 @@ static inline int page_aligned (vm_offset_t num)
return trunc_page (num) == num;
}
-static error_t
+static error_t
stream_write (struct pq *pq, void *source,
- char *data, size_t data_len, size_t *amount)
+ const char *data, size_t data_len, size_t *amount)
{
struct packet *packet = pq_tail (pq, PACKET_TYPE_DATA, source);