diff options
author | Ryan Moeller <[email protected]> | 2020-06-06 15:54:04 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-06 12:54:04 -0700 |
commit | 60265072e02049be708f74cf0865eba2434a2d85 (patch) | |
tree | 6cd0cabba28e51cfe2b25712d1b6a2fac8fb7857 /lib | |
parent | c1f3de18a4347c3aceee114e6681c2055e8863f8 (diff) |
Improve compatibility with C++ consumers
C++ is a little picky about not using keywords for names, or string
constness.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Jorgen Lundman <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10409
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libspl/include/assert.h | 3 | ||||
-rw-r--r-- | lib/libspl/include/umem.h | 2 | ||||
-rw-r--r-- | lib/libzfs/os/freebsd/libzfs_compat.c | 2 | ||||
-rw-r--r-- | lib/libzfs/os/linux/libzfs_pool_os.c | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h index 1b8f6befb..6f80f1334 100644 --- a/lib/libspl/include/assert.h +++ b/lib/libspl/include/assert.h @@ -50,7 +50,8 @@ libspl_assert(const char *buf, const char *file, const char *func, int line) /* printf version of libspl_assert */ static inline void -libspl_assertf(const char *file, const char *func, int line, char *format, ...) +libspl_assertf(const char *file, const char *func, int line, + const char *format, ...) { va_list args; diff --git a/lib/libspl/include/umem.h b/lib/libspl/include/umem.h index 59dc93144..a92dce9b2 100644 --- a/lib/libspl/include/umem.h +++ b/lib/libspl/include/umem.h @@ -145,7 +145,7 @@ umem_cache_create( { umem_cache_t *cp; - cp = umem_alloc(sizeof (umem_cache_t), UMEM_DEFAULT); + cp = (umem_cache_t *)umem_alloc(sizeof (umem_cache_t), UMEM_DEFAULT); if (cp) { strlcpy(cp->cache_name, name, UMEM_CACHE_NAMELEN); cp->cache_bufsize = bufsize; diff --git a/lib/libzfs/os/freebsd/libzfs_compat.c b/lib/libzfs/os/freebsd/libzfs_compat.c index e1c6ef93d..3cb844ddb 100644 --- a/lib/libzfs/os/freebsd/libzfs_compat.c +++ b/lib/libzfs/os/freebsd/libzfs_compat.c @@ -247,7 +247,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *path, const char *msg) } int -zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name) +zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) { return (0); } diff --git a/lib/libzfs/os/linux/libzfs_pool_os.c b/lib/libzfs/os/linux/libzfs_pool_os.c index e1250f121..5c6da5338 100644 --- a/lib/libzfs/os/linux/libzfs_pool_os.c +++ b/lib/libzfs/os/linux/libzfs_pool_os.c @@ -212,7 +212,7 @@ zpool_label_name(char *label_name, int label_size) * stripped of any leading /dev path. */ int -zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name) +zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) { char path[MAXPATHLEN]; struct dk_gpt *vtoc; |