Source-Changes-HG archive

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

[src/trunk]: src/sys/sys sys/endian.h: fix typo in comment



details:   https://anonhg.NetBSD.org/src/rev/b3fe26bf8517
branches:  trunk
changeset: 368860:b3fe26bf8517
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Aug 08 18:55:18 2022 +0000

description:
sys/endian.h: fix typo in comment

Came here because lint complained about non-constant case expressions in
sys/arch/xen/xen/xennet_checksum.c, line 111 and 122, which read:

        case htons(ETHERTYPE_IP):
        case htons(ETHERTYPE_IPV6):

POSIX says:

        On some implementations, these functions are defined as macros.

NetBSD implements these functions as macros, and on little-endian platforms,
as well as in lint mode, the macros expand to function calls.

diffstat:

 sys/sys/endian.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 51919ccdd136 -r b3fe26bf8517 sys/sys/endian.h
--- a/sys/sys/endian.h  Mon Aug 08 18:23:30 2022 +0000
+++ b/sys/sys/endian.h  Mon Aug 08 18:55:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: endian.h,v 1.30 2016/02/27 21:37:35 christos Exp $     */
+/*     $NetBSD: endian.h,v 1.31 2022/08/08 18:55:18 rillig Exp $       */
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -120,7 +120,7 @@
 #define        HTONL(x)        (void) (x)
 #define        HTONS(x)        (void) (x)
 
-#else  /* LITTLE_ENDIAN || !defined(__lint__) */
+#else  /* LITTLE_ENDIAN || defined(__lint__) */
 
 #define        ntohl(x)        bswap32(__CAST(uint32_t, (x)))
 #define        ntohs(x)        bswap16(__CAST(uint16_t, (x)))
@@ -131,7 +131,7 @@
 #define        NTOHS(x)        (x) = ntohs(__CAST(uint16_t, (x)))
 #define        HTONL(x)        (x) = htonl(__CAST(uint32_t, (x)))
 #define        HTONS(x)        (x) = htons(__CAST(uint16_t, (x)))
-#endif /* LITTLE_ENDIAN || !defined(__lint__) */
+#endif /* LITTLE_ENDIAN || defined(__lint__) */
 
 /*
  * Macros to convert to a specific endianness.



Home | Main Index | Thread Index | Old Index