diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-17 00:32:29 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-01-17 00:43:09 +0100 |
commit | f5fb7c713ea443469406a691e60a6f4567a4cb75 (patch) | |
tree | b16d979915b5ad7e32ffe77ca5f5006dc639a16e /console | |
parent | dd3048b2e483f66571cfa1b2ccebb2091b9ad990 (diff) | |
download | hurd-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 'console')
-rw-r--r-- | console/console.c | 20 | ||||
-rw-r--r-- | console/display.c | 4 | ||||
-rw-r--r-- | console/display.h | 2 | ||||
-rw-r--r-- | console/input.c | 4 | ||||
-rw-r--r-- | console/input.h | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/console/console.c b/console/console.c index ad31fba2..443f3f77 100644 --- a/console/console.c +++ b/console/console.c @@ -471,7 +471,7 @@ netfs_node_norefs (struct node *np) before returning. */ error_t netfs_attempt_create_file (struct iouser *user, struct node *dir, - char *name, mode_t mode, struct node **np) + const char *name, mode_t mode, struct node **np) { /* We create virtual consoles dynamically on the fly, so there is no need for an explicit create operation. */ @@ -563,7 +563,7 @@ netfs_attempt_sync (struct iouser *cred, struct node *np, int wait) should unlock DIR no matter what.) */ error_t netfs_attempt_lookup (struct iouser *user, struct node *dir, - char *name, struct node **node) + const char *name, struct node **node) { error_t err; @@ -1031,7 +1031,7 @@ netfs_attempt_chmod (struct iouser *cred, struct node *node, mode_t mode) /* The user must define this function. Attempt to turn locked node NP (user CRED) into a symlink with target NAME. */ error_t -netfs_attempt_mksymlink (struct iouser *cred, struct node *np, char *name) +netfs_attempt_mksymlink (struct iouser *cred, struct node *np, const char *name) { return EOPNOTSUPP; } @@ -1070,35 +1070,35 @@ netfs_attempt_statfs (struct iouser *cred, struct node *np, struct statfs *st) error_t netfs_attempt_mkdir (struct iouser *user, struct node *dir, - char *name, mode_t mode) + const char *name, mode_t mode) { return EOPNOTSUPP; } error_t -netfs_attempt_unlink (struct iouser *user, struct node *dir, char *name) +netfs_attempt_unlink (struct iouser *user, struct node *dir, const char *name) { return EOPNOTSUPP; } error_t netfs_attempt_rename (struct iouser *user, struct node *fromdir, - char *fromname, struct node *todir, - char *toname, int excl) + const char *fromname, struct node *todir, + const char *toname, int excl) { return EOPNOTSUPP; } error_t netfs_attempt_rmdir (struct iouser *user, - struct node *dir, char *name) + struct node *dir, const char *name) { return EOPNOTSUPP; } error_t netfs_attempt_link (struct iouser *user, struct node *dir, - struct node *file, char *name, int excl) + struct node *file, const char *name, int excl) { return EOPNOTSUPP; } @@ -1162,7 +1162,7 @@ netfs_attempt_read (struct iouser *cred, struct node *np, error_t netfs_attempt_write (struct iouser *cred, struct node *np, - off_t offset, size_t *len, void *data) + off_t offset, size_t *len, const void *data) { error_t err = 0; vcons_t vcons = np->nn->vcons; diff --git a/console/display.c b/console/display.c index ec1462d9..c59e74f0 100644 --- a/console/display.c +++ b/console/display.c @@ -2015,7 +2015,7 @@ display_get_owner (display_t display, pid_t *pid) NONBLOCK is not zero, return with -1 and set errno to EWOULDBLOCK if operation would block for a long time. */ ssize_t -display_output (display_t display, int nonblock, char *data, size_t datalen) +display_output (display_t display, int nonblock, const char *data, size_t datalen) { output_t output = &display->output; error_t err; @@ -2075,7 +2075,7 @@ display_output (display_t display, int nonblock, char *data, size_t datalen) } else { - buffer = data; + buffer = (char*) data; buffer_size = datalen; } amount = buffer_size; diff --git a/console/display.h b/console/display.h index d64cf69e..3445fb98 100644 --- a/console/display.h +++ b/console/display.h @@ -59,7 +59,7 @@ error_t display_get_owner (display_t display, pid_t *pid); be smaller than DATALEN) or -1 and the error number in errno. If NONBLOCK is not zero, return with -1 and set errno to EWOULDBLOCK if operation would block for a long time. */ -ssize_t display_output (display_t display, int nonblock, char *data, +ssize_t display_output (display_t display, int nonblock, const char *data, size_t datalen); mach_port_t display_get_filemap (display_t display, vm_prot_t prot); diff --git a/console/input.c b/console/input.c index c6f99743..8e561fb9 100644 --- a/console/input.c +++ b/console/input.c @@ -87,7 +87,7 @@ void input_destroy (input_t input) DATALEN) or -1 and the error number in errno. If NONBLOCK is not zero, return with -1 and set errno to EWOULDBLOCK if operation would block for a long time. */ -ssize_t input_enqueue (input_t input, int nonblock, char *data, +ssize_t input_enqueue (input_t input, int nonblock, const char *data, size_t datalen) { error_t err = 0; @@ -154,7 +154,7 @@ ssize_t input_enqueue (input_t input, int nonblock, char *data, } else { - buffer = data; + buffer = (char*) data; buffer_size = datalen; } /* Prepare output buffer for iconv. */ diff --git a/console/input.h b/console/input.h index 3f66e1dd..2f1c37c2 100644 --- a/console/input.h +++ b/console/input.h @@ -40,7 +40,7 @@ void input_destroy (input_t input); DATALEN) or -1 and the error number in errno. If NONBLOCK is not zero, return with -1 and set errno to EWOULDBLOCK if operation would block for a long time. */ -ssize_t input_enqueue (input_t input, int nonblock, char *data, +ssize_t input_enqueue (input_t input, int nonblock, const char *data, size_t datalen); /* Remove DATALEN characters from the input queue and put them in the |