public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] bitset: rename confusing macro NAND to ANDNOT
Date: Fri, 24 Jun 2022 05:42:19 +0000 (GMT)	[thread overview]
Message-ID: <20220624054219.5AD29385021A@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=de1380c36b9018f8f2f4f52de47939c75e26818f

commit de1380c36b9018f8f2f4f52de47939c75e26818f
Author: Ryan Libby <rlibby@FreeBSD.org>
Date:   Fri Dec 13 09:32:16 2019 +0000

    bitset: rename confusing macro NAND to ANDNOT
    
    s/BIT_NAND/BIT_ANDNOT/, and for CPU and DOMAINSET too.  The actual
    implementation is "and not" (or "but not"), i.e. A but not B.
    Fortunately this does appear to be what all existing callers want.
    
    Don't supply a NAND (not (A and B)) operation at this time.
    
    Discussed with: jeff
    Reviewed by:    cem
    Sponsored by:   Dell EMC Isilon
    Differential Revision:  https://reviews.freebsd.org/D22791

Diff:
---
 newlib/libc/sys/rtems/include/sys/bitset.h | 4 ++--
 newlib/libc/sys/rtems/include/sys/cpuset.h | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/rtems/include/sys/bitset.h
index 0334939c9..a1fd8b316 100644
--- a/newlib/libc/sys/rtems/include/sys/bitset.h
+++ b/newlib/libc/sys/rtems/include/sys/bitset.h
@@ -152,13 +152,13 @@
 		(d)->__bits[__i] = (s1)->__bits[__i] & (s2)->__bits[__i];\
 } while (0)
 
-#define	BIT_NAND(_s, d, s) do {						\
+#define	BIT_ANDNOT(_s, d, s) do {					\
 	__size_t __i;							\
 	for (__i = 0; __i < __bitset_words((_s)); __i++)		\
 		(d)->__bits[__i] &= ~(s)->__bits[__i];			\
 } while (0)
 
-#define	BIT_NAND2(_s, d, s1, s2) do {					\
+#define	BIT_ANDNOT2(_s, d, s1, s2) do {					\
 	__size_t __i;							\
 	for (__i = 0; __i < __bitset_words((_s)); __i++)		\
 		(d)->__bits[__i] = (s1)->__bits[__i] & ~(s2)->__bits[__i];\
diff --git a/newlib/libc/sys/rtems/include/sys/cpuset.h b/newlib/libc/sys/rtems/include/sys/cpuset.h
index 0d21f77fa..a8af67bac 100644
--- a/newlib/libc/sys/rtems/include/sys/cpuset.h
+++ b/newlib/libc/sys/rtems/include/sys/cpuset.h
@@ -177,16 +177,16 @@ static __inline void CPU_XOR(cpu_set_t *destset, const cpu_set_t *srcset1,
   CPU_XOR_S(sizeof(*destset), destset, srcset1, srcset2);
 }
 
-static __inline void CPU_NAND_S(size_t setsize, cpu_set_t *destset,
+static __inline void CPU_ANDNOT_S(size_t setsize, cpu_set_t *destset,
   const cpu_set_t *srcset1, const cpu_set_t *srcset2)
 {
-  BIT_NAND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
+  BIT_ANDNOT2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
 }
 
-static __inline void CPU_NAND(cpu_set_t *destset, const cpu_set_t *srcset1,
+static __inline void CPU_ANDNOT(cpu_set_t *destset, const cpu_set_t *srcset1,
   const cpu_set_t *srcset2)
 {
-  CPU_NAND_S(sizeof(*destset), destset, srcset1, srcset2);
+  CPU_ANDNOT_S(sizeof(*destset), destset, srcset1, srcset2);
 }
 
 static __inline int CPU_COUNT_S(size_t setsize, const cpu_set_t *set)


                 reply	other threads:[~2022-06-24  5:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220624054219.5AD29385021A@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).