diff options
authorMariusz Zaborski <oshogbo@FreeBSD.org>2018-06-18 21:23:40 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2018-06-18 21:23:40 +0000
commit30665f3c42302105793ba18027ec02fd24801b9e (patch)
parent0db44d5550ebc840bbd7bf4fbf32d0c49e9dfe93 (diff)
libnv: add const to cookies arguments
Pointed out by: pjd@
Notes: svn path=/head/; revision=335342
3 files changed, 31 insertions, 31 deletions
diff --git a/share/man/man9/cnv.9 b/share/man/man9/cnv.9
index da147968e2b2..5d5a57963e32 100644
--- a/share/man/man9/cnv.9
+++ b/share/man/man9/cnv.9
@@ -38,32 +38,32 @@
.In sys/cnv.h
.Ft const char *
-.Fn cnvlist_name "void *cookie"
+.Fn cnvlist_name "const void *cookie"
.Ft int
-.Fn cnvlist_type "void *cookie"
+.Fn cnvlist_type "const void *cookie"
.Ft bool
-.Fn cnvlist_get_bool "void *cookie"
+.Fn cnvlist_get_bool "const void *cookie"
.Ft uint64_t
-.Fn cnvlist_get_number "void *cookie"
+.Fn cnvlist_get_number "const void *cookie"
.Ft "const char *"
-.Fn cnvlist_get_string "void *cookie"
+.Fn cnvlist_get_string "const void *cookie"
.Ft "const nvlist_t *"
-.Fn cnvlist_get_nvlist "void *cookie"
+.Fn cnvlist_get_nvlist "const void *cookie"
.Ft "const void *"
-.Fn cnvlist_get_binary "void *cookie" "size_t *sizep"
+.Fn cnvlist_get_binary "const void *cookie" "size_t *sizep"
.Ft "const bool *"
-.Fn cnvlist_get_bool_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_bool_array "const void *cookie" "size_t *nitemsp"
.Ft "const uint64_t *"
-.Fn cnvlist_get_number_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_number_array "const void *cookie" "size_t *nitemsp"
.Ft "const char * const *"
-.Fn cnvlist_get_string_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_string_array "const void *cookie" "size_t *nitemsp"
.Ft "const nvlist_t * const *"
-.Fn cnvlist_get_nvlist_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_nvlist_array "const void *cookie" "size_t *nitemsp"
.Ft int
-.Fn cnvlist_get_descriptor "void *cookie"
+.Fn cnvlist_get_descriptor "const void *cookie"
.Ft "const int *"
-.Fn cnvlist_get_descriptor_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_descriptor_array "const void *cookie" "size_t *nitemsp"
.Ft bool
.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie"
diff --git a/sys/contrib/libnv/cnvlist.c b/sys/contrib/libnv/cnvlist.c
index 3ea10d0e6c3c..2a1134855df7 100644
--- a/sys/contrib/libnv/cnvlist.c
+++ b/sys/contrib/libnv/cnvlist.c
@@ -56,14 +56,14 @@ __FBSDID("$FreeBSD$");
#include "nvpair_impl.h"
const char *
-cnvlist_name(void *cookie)
+cnvlist_name(const void *cookie)
return (nvpair_name(cookie));
-cnvlist_type(void *cookie)
+cnvlist_type(const void *cookie)
return (nvpair_type(cookie));
@@ -71,7 +71,7 @@ cnvlist_type(void *cookie)
#define CNVLIST_GET(ftype, type, NVTYPE) \
ftype \
-cnvlist_get_##type(void *cookie) \
+cnvlist_get_##type(const void *cookie) \
{ \
if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \
@@ -93,7 +93,7 @@ CNVLIST_GET(int, descriptor, DESCRIPTOR)
#define CNVLIST_GET_ARRAY(ftype, type, NVTYPE) \
ftype \
-cnvlist_get_##type(void *cookie, size_t *nitemsp) \
+cnvlist_get_##type(const void *cookie, size_t *nitemsp) \
{ \
if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \
@@ -114,7 +114,7 @@ CNVLIST_GET_ARRAY(const int *, descriptor_array, DESCRIPTOR_ARRAY)
const void *
-cnvlist_get_binary(void *cookie, size_t *sizep)
+cnvlist_get_binary(const void *cookie, size_t *sizep)
if (nvpair_type(cookie) != NV_TYPE_BINARY)
diff --git a/sys/sys/cnv.h b/sys/sys/cnv.h
index 9726cee19780..9ce8bc4807a6 100644
--- a/sys/sys/cnv.h
+++ b/sys/sys/cnv.h
@@ -52,8 +52,8 @@ __BEGIN_DECLS
* Functions which returns information about the given cookie.
-const char *cnvlist_name(void *cookie);
-int cnvlist_type(void *cookie);
+const char *cnvlist_name(const void *cookie);
+int cnvlist_type(const void *cookie);
* The cnvlist_get functions returns value associated with the given cookie.
@@ -61,18 +61,18 @@ int cnvlist_type(void *cookie);
* not be freed by the caller.
-bool cnvlist_get_bool(void *cookie);
-uint64_t cnvlist_get_number(void *cookie);
-const char *cnvlist_get_string(void *cookie);
-const nvlist_t *cnvlist_get_nvlist(void *cookie);
-const void *cnvlist_get_binary(void *cookie, size_t *sizep);
-const bool *cnvlist_get_bool_array(void *cookie, size_t *nitemsp);
-const uint64_t *cnvlist_get_number_array(void *cookie, size_t *nitemsp);
-const char * const *cnvlist_get_string_array(void *cookie, size_t *nitemsp);
-const nvlist_t * const *cnvlist_get_nvlist_array(void *cookie, size_t *nitemsp);
+bool cnvlist_get_bool(const void *cookie);
+uint64_t cnvlist_get_number(const void *cookie);
+const char *cnvlist_get_string(const void *cookie);
+const nvlist_t *cnvlist_get_nvlist(const void *cookie);
+const void *cnvlist_get_binary(const void *cookie, size_t *sizep);
+const bool *cnvlist_get_bool_array(const void *cookie, size_t *nitemsp);
+const uint64_t *cnvlist_get_number_array(const void *cookie, size_t *nitemsp);
+const char * const *cnvlist_get_string_array(const void *cookie, size_t *nitemsp);
+const nvlist_t * const *cnvlist_get_nvlist_array(const void *cookie, size_t *nitemsp);
#ifndef _KERNEL
-int cnvlist_get_descriptor(void *cookie);
-const int *cnvlist_get_descriptor_array(void *cookie, size_t *nitemsp);
+int cnvlist_get_descriptor(const void *cookie);
+const int *cnvlist_get_descriptor_array(const void *cookie, size_t *nitemsp);