From owner-svn-src-head@freebsd.org Mon Jun 18 21:23:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0802C102317F; Mon, 18 Jun 2018 21:23:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B174B74218; Mon, 18 Jun 2018 21:23:41 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9281A1AB1; Mon, 18 Jun 2018 21:23:41 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ILNfmA090051; Mon, 18 Jun 2018 21:23:41 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ILNflk090049; Mon, 18 Jun 2018 21:23:41 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182123.w5ILNflk090049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 21:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335342 - in head: share/man/man9 sys/contrib/libnv sys/sys X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: share/man/man9 sys/contrib/libnv sys/sys X-SVN-Commit-Revision: 335342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2018 21:23:42 -0000 Author: oshogbo Date: Mon Jun 18 21:23:40 2018 New Revision: 335342 URL: https://svnweb.freebsd.org/changeset/base/335342 Log: libnv: add const to cookies arguments Pointed out by: pjd@ Modified: head/share/man/man9/cnv.9 head/sys/contrib/libnv/cnvlist.c head/sys/sys/cnv.h Modified: head/share/man/man9/cnv.9 ============================================================================== --- head/share/man/man9/cnv.9 Mon Jun 18 21:18:20 2018 (r335341) +++ head/share/man/man9/cnv.9 Mon Jun 18 21:23:40 2018 (r335342) @@ -38,32 +38,32 @@ .Sh SYNOPSIS .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" Modified: head/sys/contrib/libnv/cnvlist.c ============================================================================== --- head/sys/contrib/libnv/cnvlist.c Mon Jun 18 21:18:20 2018 (r335341) +++ head/sys/contrib/libnv/cnvlist.c Mon Jun 18 21:23:40 2018 (r335342) @@ -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)); } int -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, DESCR #undef CNVLIST_GET_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) Modified: head/sys/sys/cnv.h ============================================================================== --- head/sys/sys/cnv.h Mon Jun 18 21:18:20 2018 (r335341) +++ head/sys/sys/cnv.h Mon Jun 18 21:23:40 2018 (r335342) @@ -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); #endif