Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01195.html below:
Re: Thoughts on replacing macros with static inline functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Eli Zaretskii Subject: Re: Thoughts on replacing macros with static inline functions Date: Fri, 18 Nov 2022 10:34:55 +0200
> From: Po Lu <luangruo@yahoo.com>
> Cc: Richard Stallman <rms@gnu.org>, xenodasein@tutanota.de, Eli Zaretskii
> <eliz@gnu.org>, pappasbrent@knights.ucf.edu
> Date: Fri, 18 Nov 2022 14:27:09 +0800
>
> And how is an additional function an improvement over extremely trivial
> macros, like these:
>
> #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.
- Thoughts on replacing macros with static inline functions, Brent Pappas, 2022/11/14
- Re: Thoughts on replacing macros with static inline functions, Eli Zaretskii, 2022/11/15
- Re: Thoughts on replacing macros with static inline functions, Richard Stallman, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, xenodasein, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Po Lu, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, xenodasein, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Po Lu, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Eli Zaretskii <=
- Re: Thoughts on replacing macros with static inline functions, xenodasein, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Po Lu, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Eli Zaretskii, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, tomas, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, xenodasein, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Stefan Monnier, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Dr. Arne Babenhauserheide, 2022/11/18
- Re: Thoughts on replacing macros with static inline functions, Po Lu, 2022/11/15
- Re: Thoughts on replacing macros with static inline functions, Stefan Monnier, 2022/11/15
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4