From 608a613abd577c52ccf22644f211e7bad78b5061 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 6 Jun 2023 21:49:24 -0700 Subject: [PATCH] maint: avoid new tight-scope syntax-check failure * src/system.h (floor_log2): Declare with "SYSTEM_INLINE int" on the same line as the function name, to accommodate the tight-scope syntax-check rule. * cfg.mk (_gl_TS_extern): Add SYSTEM_INLINE to the regexp. --- cfg.mk | 2 +- src/system.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cfg.mk b/cfg.mk index 8c9bab5..3713860 100644 --- a/cfg.mk +++ b/cfg.mk @@ -74,4 +74,4 @@ exclude_file_name_regexp--sc_space_tab = ^gl/lib/.*\.c\.diff$$ exclude_file_name_regexp--sc_prohibit_doubled_word = ^tests/y2038-vs-32bit$$ # Tell gnulib's tight_scope rule that we mark externs with XTERN -export _gl_TS_extern = extern|XTERN|DIFF_INLINE +export _gl_TS_extern = extern|XTERN|DIFF_INLINE|SYSTEM_INLINE diff --git a/src/system.h b/src/system.h index ce4758d..f82ae61 100644 --- a/src/system.h +++ b/src/system.h @@ -212,8 +212,7 @@ verify (LIN_MAX <= IDX_MAX); #define STREQ(a, b) (strcmp (a, b) == 0) /* Return the floor of the log base 2 of N. Return -1 if N is zero. */ -SYSTEM_INLINE int -floor_log2 (idx_t n) +SYSTEM_INLINE int floor_log2 (idx_t n) { verify (IDX_MAX <= ULLONG_MAX); return ULLONG_WIDTH - 1 - count_leading_zeros_ll (n);