From: Eli Zaretskii <eliz@gnu.org>
To: xenodasein@tutanota.de
Cc: luangruo@yahoo.com, emacs-devel@gnu.org, rms@gnu.org,
pappasbrent@knights.ucf.edu
Subject: Re: Thoughts on replacing macros with static inline functions
Date: Fri, 18 Nov 2022 14:00:30 +0200 [thread overview]
Message-ID: <83leo8bhgh.fsf@gnu.org> (raw)
In-Reply-To: <NH9Vc6y--3-9@tutanota.de> (xenodasein@tutanota.de)
> Date: Fri, 18 Nov 2022 12:31:59 +0100 (CET)
> From: xenodasein@tutanota.de
> Cc: Po Lu <luangruo@yahoo.com>, emacs-devel@gnu.org, rms@gnu.org,
> pappasbrent@knights.ucf.edu
>
> Nov 18, 2022, 08:34 by eliz@gnu.org:
>
> >> #define XM_DRAG_REASON(originator, code) ((code) | ((originator) << 7))
> >> #define XM_DRAG_REASON_ORIGINATOR(reason) (((reason) & 0x80) ? 1 : 0)
> >> #define XM_DRAG_REASON_CODE(reason) ((reason) & 0x7f)
> >>
> >
> > The purpose of macros such as the above is to explain the meaning of
> > the code in human-readable terms. Replacing this by functions makes
> > no more sense than replacing "c = a + b;" with a function.
> >
>
> Right? Who needs a proper API when you can have paranoid parentheses
> macros with bit hackery!
Bitwise operations are first-class citizens in C code, so your sarcasm
is misguided.
next prev parent reply other threads:[~2022-11-18 12:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 18:05 Thoughts on replacing macros with static inline functions Brent Pappas
2022-11-15 12:45 ` Eli Zaretskii
2022-11-18 5:05 ` Richard Stallman
2022-11-18 6:19 ` xenodasein--- via Emacs development discussions.
2022-11-18 6:27 ` Po Lu
2022-11-18 6:32 ` xenodasein--- via Emacs development discussions.
2022-11-18 7:29 ` Po Lu
2022-11-18 8:34 ` Eli Zaretskii
2022-11-18 11:31 ` xenodasein--- via Emacs development discussions.
2022-11-18 11:43 ` Po Lu
2022-11-18 12:00 ` Eli Zaretskii [this message]
2022-11-18 6:59 ` tomas
2022-11-18 7:12 ` xenodasein--- via Emacs development discussions.
2022-11-18 14:53 ` Stefan Monnier
2022-11-18 16:16 ` Dr. Arne Babenhauserheide
2022-11-15 13:49 ` Po Lu
2022-11-15 15:54 ` xenodasein--- via Emacs development discussions.
2022-11-15 14:10 ` Stefan Monnier
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=83leo8bhgh.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
--cc=pappasbrent@knights.ucf.edu \
--cc=rms@gnu.org \
--cc=xenodasein@tutanota.de \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.