git: sockbuf: Improve sbcreatecontrol() parameter types to save casts

Aaron LI aly at crater.dragonflybsd.org
Thu Jan 11 23:48:19 PST 2024


commit 0704bacfc82d96146b9f7387d927dc7aabf6735a
Author: Aaron LI <aly at aaronly.me>
Date:   Fri Jan 12 12:08:41 2024 +0800

    sockbuf: Improve sbcreatecontrol() parameter types to save casts
    
    - Change 'caddr_t p' to 'const void *p' to save casts for the callers.
      The 'const' qualifier is also added meanwhile.
    - Change 'int size' to 'size_t size', given that callers generally pass
      this parameter as sizeof().
    - Update all relevant callers.
    
    For the reference, OpenBSD also did this for sbcreatecontrol().

Summary of changes:
 sys/kern/uipc_sockbuf.c                            |  7 +++----
 sys/kern/uipc_usrreq.c                             |  3 +--
 sys/netbt/hci_socket.c                             |  2 +-
 .../bluetooth/socket/ng_btsocket_hci_raw.c         |  4 ++--
 sys/netinet/ip_input.c                             | 24 +++++++++++-----------
 sys/netinet6/ip6_input.c                           | 16 +++++++--------
 sys/sys/sockbuf.h                                  |  2 +-
 7 files changed, 28 insertions(+), 30 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0704bacfc82d96146b9f7387d927dc7aabf6735a


-- 
DragonFly BSD source repository


More information about the Commits mailing list