* [PATCH 2/3] ewok_rlw.h: add missing 'inline' to function definition
@ 2018-10-27 1:52 Ramsay Jones
2018-10-27 6:29 ` Jeff King
0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2018-10-27 1:52 UTC (permalink / raw)
To: Junio C Hamano
Cc: Carlo Marcelo Arenas Belón, Derrick Stolee, GIT Mailing-list
The 'ewok_rlw.h' header file contains the rlw_get_run_bit() function
definition, which is marked as 'static' but not 'inline'. At least when
compiled by gcc, with the default -O2 optimization level, the function
is actually inlined and leaves no static version in the ewah_bitmap.o
and ewah_rlw.o object files. Despite this, add the missing 'inline'
keyword to better describe the intended behaviour.
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
ewah/ewok_rlw.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ewah/ewok_rlw.h b/ewah/ewok_rlw.h
index d487966935..bafa24f4c3 100644
--- a/ewah/ewok_rlw.h
+++ b/ewah/ewok_rlw.h
@@ -31,7 +31,7 @@
#define RLW_RUNNING_LEN_PLUS_BIT (((eword_t)1 << (RLW_RUNNING_BITS + 1)) - 1)
-static int rlw_get_run_bit(const eword_t *word)
+static inline int rlw_get_run_bit(const eword_t *word)
{
return *word & (eword_t)1;
}
--
2.19.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/3] ewok_rlw.h: add missing 'inline' to function definition
2018-10-27 1:52 [PATCH 2/3] ewok_rlw.h: add missing 'inline' to function definition Ramsay Jones
@ 2018-10-27 6:29 ` Jeff King
0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2018-10-27 6:29 UTC (permalink / raw)
To: Ramsay Jones
Cc: Junio C Hamano, Carlo Marcelo Arenas Belón, Derrick Stolee,
GIT Mailing-list
On Sat, Oct 27, 2018 at 02:52:05AM +0100, Ramsay Jones wrote:
> The 'ewok_rlw.h' header file contains the rlw_get_run_bit() function
> definition, which is marked as 'static' but not 'inline'. At least when
> compiled by gcc, with the default -O2 optimization level, the function
> is actually inlined and leaves no static version in the ewah_bitmap.o
> and ewah_rlw.o object files. Despite this, add the missing 'inline'
> keyword to better describe the intended behaviour.
Yep, this makes sense. Thanks!
-Peff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-27 6:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-27 1:52 [PATCH 2/3] ewok_rlw.h: add missing 'inline' to function definition Ramsay Jones
2018-10-27 6:29 ` Jeff King
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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).