Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Constify some arguments of pslist(9) functions



details:   https://anonhg.NetBSD.org/src/rev/d38c521bcbab
branches:  trunk
changeset: 816465:d38c521bcbab
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Jul 07 06:56:24 2016 +0000

description:
Constify some arguments of pslist(9) functions

By doing so, callers don't need to discard const qualifier.

diffstat:

 share/man/man9/pslist.9 |  16 ++++++++--------
 sys/sys/pslist.h        |  22 +++++++++++++---------
 2 files changed, 21 insertions(+), 17 deletions(-)

diffs (125 lines):

diff -r 17d300b515e5 -r d38c521bcbab share/man/man9/pslist.9
--- a/share/man/man9/pslist.9   Thu Jul 07 06:55:38 2016 +0000
+++ b/share/man/man9/pslist.9   Thu Jul 07 06:56:24 2016 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pslist.9,v 1.16 2016/04/27 06:57:24 ozaki-r Exp $
+.\"    $NetBSD: pslist.9,v 1.17 2016/07/07 06:56:24 ozaki-r Exp $
 .\"
 .\" Copyright (c) 2016 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 27, 2016
+.Dd July 7, 2016
 .Dt PSLIST 9
 .Os
 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -58,16 +58,16 @@
 .Ft void
 .Fn PSLIST_WRITER_REMOVE "TYPE *element" "PSLIST_ENTRY NAME"
 .Ft TYPE *
-.Fn PSLIST_WRITER_FIRST "struct pslist *head" "TYPE" "PSLIST_ENTRY NAME"
+.Fn PSLIST_WRITER_FIRST "const struct pslist *head" "TYPE" "PSLIST_ENTRY NAME"
 .Ft TYPE *
-.Fn PSLIST_WRITER_NEXT "TYPE *element" "TYPE" "PSLIST_ENTRY NAME"
-.Fn PSLIST_WRITER_FOREACH "TYPE *element" "struct pslist_head *head" "TYPE" "PSLIST_ENTRY NAME"
+.Fn PSLIST_WRITER_NEXT "const TYPE *element" "TYPE" "PSLIST_ENTRY NAME"
+.Fn PSLIST_WRITER_FOREACH "const TYPE *element" "const struct pslist_head *head" "TYPE" "PSLIST_ENTRY NAME"
 .\" Reader operations
 .Ft TYPE *
-.Fn PSLIST_READER_FIRST "struct pslist *head" "TYPE" "PSLIST_ENTRY NAME"
+.Fn PSLIST_READER_FIRST "const struct pslist *head" "TYPE" "PSLIST_ENTRY NAME"
 .Ft TYPE *
-.Fn PSLIST_READER_NEXT "TYPE *element" "TYPE" "PSLIST_ENTRY NAME"
-.Fn PSLIST_READER_FOREACH "TYPE *element" "struct pslist_head *head" "TYPE" "PSLIST_ENTRY NAME"
+.Fn PSLIST_READER_NEXT "const TYPE *element" "TYPE" "PSLIST_ENTRY NAME"
+.Fn PSLIST_READER_FOREACH "const TYPE *element" "const struct pslist_head *head" "TYPE" "PSLIST_ENTRY NAME"
 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 .Sh DESCRIPTION
 The
diff -r 17d300b515e5 -r d38c521bcbab sys/sys/pslist.h
--- a/sys/sys/pslist.h  Thu Jul 07 06:55:38 2016 +0000
+++ b/sys/sys/pslist.h  Thu Jul 07 06:56:24 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pslist.h,v 1.2 2016/04/11 03:46:37 riastradh Exp $     */
+/*     $NetBSD: pslist.h,v 1.3 2016/07/07 06:56:25 ozaki-r Exp $       */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -178,14 +178,14 @@
 }
 
 static inline struct pslist_entry *
-pslist_writer_first(struct pslist_head *head)
+pslist_writer_first(const struct pslist_head *head)
 {
 
        return head->plh_first;
 }
 
 static inline struct pslist_entry *
-pslist_writer_next(struct pslist_entry *entry)
+pslist_writer_next(const struct pslist_entry *entry)
 {
 
        _PSLIST_ASSERT(entry->ple_next != _PSLIST_POISON);
@@ -193,7 +193,8 @@
 }
 
 static inline void *
-_pslist_writer_first_container(struct pslist_head *head, ptrdiff_t offset)
+_pslist_writer_first_container(const struct pslist_head *head,
+    const ptrdiff_t offset)
 {
        struct pslist_entry *first = head->plh_first;
 
@@ -201,7 +202,8 @@
 }
 
 static inline void *
-_pslist_writer_next_container(struct pslist_entry *entry, ptrdiff_t offset)
+_pslist_writer_next_container(const struct pslist_entry *entry,
+    const ptrdiff_t offset)
 {
        struct pslist_entry *next = entry->ple_next;
 
@@ -217,7 +219,7 @@
  */
 
 static inline struct pslist_entry *
-pslist_reader_first(struct pslist_head *head)
+pslist_reader_first(const struct pslist_head *head)
 {
        struct pslist_entry *first = head->plh_first;
 
@@ -228,7 +230,7 @@
 }
 
 static inline struct pslist_entry *
-pslist_reader_next(struct pslist_entry *entry)
+pslist_reader_next(const struct pslist_entry *entry)
 {
        struct pslist_entry *next = entry->ple_next;
 
@@ -240,7 +242,8 @@
 }
 
 static inline void *
-_pslist_reader_first_container(struct pslist_head *head, ptrdiff_t offset)
+_pslist_reader_first_container(const struct pslist_head *head,
+    const ptrdiff_t offset)
 {
        struct pslist_entry *first = head->plh_first;
 
@@ -252,7 +255,8 @@
 }
 
 static inline void *
-_pslist_reader_next_container(struct pslist_entry *entry, ptrdiff_t offset)
+_pslist_reader_next_container(const struct pslist_entry *entry,
+    const ptrdiff_t offset)
 {
        struct pslist_entry *next = entry->ple_next;
 



Home | Main Index | Thread Index | Old Index