Description: Fix link errors of coverage_idx and round_buffer_lidx2ridx caused by C99 inline semantics
 misc/bamcheck.c defines coverage_idx() and round_buffer_lidx2ridx() as
 non-static inline functions with no other file scope declaration. Under the
 default C99+/gnu17 inline semantics every file scope declaration of these
 functions includes the inline specifier without extern, so the definitions are
 inline definitions that emit no external symbol, and the linker fails with
 "undefined reference to round_buffer_lidx2ridx" / "undefined reference to
 coverage_idx" when linking the bamcheck program in misc/.
 Both functions are only used inside misc/bamcheck.c, so make them static
 inline (same fix as fix-ftbfs-inline-symbol for padding.c).
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: not-needed
Last-Update: 2026-09-14

--- samtools-legacy-0.1.19+dfsg.orig/misc/bamcheck.c
+++ samtools-legacy-0.1.19+dfsg/misc/bamcheck.c
@@ -174,7 +174,7 @@ int is_in_regions(bam1_t *bam_line, stat
 
 
 // Coverage distribution methods
-inline int coverage_idx(int min, int max, int n, int step, int depth)
+static inline int coverage_idx(int min, int max, int n, int step, int depth)
 {
     if ( depth < min )
         return 0;
@@ -185,7 +185,7 @@ inline int coverage_idx(int min, int max
     return 1 + (depth - min) / step;
 }
 
-inline int round_buffer_lidx2ridx(int offset, int size, int64_t refpos, int64_t pos)
+static inline int round_buffer_lidx2ridx(int offset, int size, int64_t refpos, int64_t pos)
 {
     return (offset + (pos-refpos) % size) % size;
 }
