Sun Jan 23 21:07:28 2022 UTC ()
librefuse: fix lint warnings about void function returning a value

lib/librefuse/refuse_compat.c(155):
    error: void function fuse_unmount cannot return value [213]
lib/librefuse/refuse/v30.c(57):
    error: void function fuse_destroy_v30 cannot return value [213]


(rillig)
diff -r1.2 -r1.3 src/lib/librefuse/refuse_compat.c
diff -r1.1 -r1.2 src/lib/librefuse/refuse/v30.c

cvs diff -r1.2 -r1.3 src/lib/librefuse/refuse_compat.c (expand / switch to unified diff)

--- src/lib/librefuse/refuse_compat.c 2022/01/22 08:09:39 1.2
+++ src/lib/librefuse/refuse_compat.c 2022/01/23 21:07:28 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: refuse_compat.c,v 1.2 2022/01/22 08:09:39 pho Exp $ */ 1/* $NetBSD: refuse_compat.c,v 1.3 2022/01/23 21:07:28 rillig Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2021 The NetBSD Foundation, Inc. 4 * Copyright (c) 2021 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#if !defined(lint) 33#if !defined(lint)
34__RCSID("$NetBSD: refuse_compat.c,v 1.2 2022/01/22 08:09:39 pho Exp $"); 34__RCSID("$NetBSD: refuse_compat.c,v 1.3 2022/01/23 21:07:28 rillig Exp $");
35#endif /* !lint */ 35#endif /* !lint */
36 36
37#include <fuse_internal.h> 37#include <fuse_internal.h>
38#include <string.h> 38#include <string.h>
39 39
40/* 40/*
41 * Compatibility symbols that had existed in old versions of 41 * Compatibility symbols that had existed in old versions of
42 * librefuse. 42 * librefuse.
43 */ 43 */
44 44
45struct fuse_cmdline_opts_rev0 { 45struct fuse_cmdline_opts_rev0 {
46 int singlethread; 46 int singlethread;
47 int foreground; 47 int foreground;
@@ -142,23 +142,23 @@ fuse_parse_cmdline(struct fuse_args *arg @@ -142,23 +142,23 @@ fuse_parse_cmdline(struct fuse_args *arg
142 142
143 memcpy(opts, &tmp, sizeof(*opts)); 143 memcpy(opts, &tmp, sizeof(*opts));
144 return 0; 144 return 0;
145} 145}
146 146
147/* librefuse once had a function fuse_unmount() for FUSE 3.0 but 147/* librefuse once had a function fuse_unmount() for FUSE 3.0 but
148 * without a version postfix. */ 148 * without a version postfix. */
149__warn_references( 149__warn_references(
150 fuse_unmount, 150 fuse_unmount,
151 "warning: reference to compatibility fuse_unmount();" 151 "warning: reference to compatibility fuse_unmount();"
152 " include <fuse.h> for correct reference") 152 " include <fuse.h> for correct reference")
153void 153void
154fuse_unmount(struct fuse* fuse) { 154fuse_unmount(struct fuse* fuse) {
155 return fuse_unmount_v30(fuse); 155 fuse_unmount_v30(fuse);
156} 156}
157 157
158/* librefuse once had a function fuse_unmount_compat22() which was an 158/* librefuse once had a function fuse_unmount_compat22() which was an
159 * implementation of fuse_unmount() to be used when FUSE_USE_VERSION 159 * implementation of fuse_unmount() to be used when FUSE_USE_VERSION
160 * was set to 22 or below. The function was actually a no-op. */ 160 * was set to 22 or below. The function was actually a no-op. */
161void 161void
162fuse_unmount_compat22(const char *mountpoint) { 162fuse_unmount_compat22(const char *mountpoint) {
163 fuse_unmount_v11(mountpoint); 163 fuse_unmount_v11(mountpoint);
164} 164}

cvs diff -r1.1 -r1.2 src/lib/librefuse/refuse/v30.c (expand / switch to unified diff)

--- src/lib/librefuse/refuse/v30.c 2022/01/22 08:09:40 1.1
+++ src/lib/librefuse/refuse/v30.c 2022/01/23 21:07:28 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: v30.c,v 1.1 2022/01/22 08:09:40 pho Exp $ */ 1/* $NetBSD: v30.c,v 1.2 2022/01/23 21:07:28 rillig Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2021 The NetBSD Foundation, Inc. 4 * Copyright (c) 2021 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -21,50 +21,50 @@ @@ -21,50 +21,50 @@
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#if !defined(lint) 33#if !defined(lint)
34__RCSID("$NetBSD: v30.c,v 1.1 2022/01/22 08:09:40 pho Exp $"); 34__RCSID("$NetBSD: v30.c,v 1.2 2022/01/23 21:07:28 rillig Exp $");
35#endif /* !lint */ 35#endif /* !lint */
36 36
37#include <fuse_internal.h> 37#include <fuse_internal.h>
38 38
39int 39int
40fuse_mount_v30(struct fuse *fuse, const char *mountpoint) { 40fuse_mount_v30(struct fuse *fuse, const char *mountpoint) {
41 return __fuse_mount(fuse, mountpoint); 41 return __fuse_mount(fuse, mountpoint);
42} 42}
43 43
44void 44void
45fuse_unmount_v30(struct fuse *fuse) { 45fuse_unmount_v30(struct fuse *fuse) {
46 __fuse_unmount(fuse); 46 __fuse_unmount(fuse);
47} 47}
48 48
49struct fuse * 49struct fuse *
50fuse_new_v30(struct fuse_args *args, 50fuse_new_v30(struct fuse_args *args,
51 const void *op, int op_version, void *user_data) { 51 const void *op, int op_version, void *user_data) {
52 return __fuse_new(args, op, op_version, user_data); 52 return __fuse_new(args, op, op_version, user_data);
53} 53}
54 54
55void 55void
56fuse_destroy_v30(struct fuse *fuse) { 56fuse_destroy_v30(struct fuse *fuse) {
57 return __fuse_destroy(fuse); 57 __fuse_destroy(fuse);
58} 58}
59 59
60int 60int
61fuse_loop_mt_v30(struct fuse *fuse, int clone_fd) { 61fuse_loop_mt_v30(struct fuse *fuse, int clone_fd) {
62 struct fuse_loop_config config = { 62 struct fuse_loop_config config = {
63 .clone_fd = clone_fd, 63 .clone_fd = clone_fd,
64 .max_idle_threads = 10 /* The default value when "config" is NULL. */ 64 .max_idle_threads = 10 /* The default value when "config" is NULL. */
65 }; 65 };
66 return __fuse_loop_mt(fuse, &config); 66 return __fuse_loop_mt(fuse, &config);
67} 67}
68 68
69int 69int
70fuse_parse_cmdline_v30(struct fuse_args *args, struct fuse_cmdline_opts *opts) { 70fuse_parse_cmdline_v30(struct fuse_args *args, struct fuse_cmdline_opts *opts) {