]> git.kaiwu.me - klib.git/commitdiff
Update ksort.h
authorzhanxw <zhanxw@users.noreply.github.com>
Sat, 30 Nov 2013 04:37:10 +0000 (23:37 -0500)
committerzhanxw <zhanxw@users.noreply.github.com>
Sat, 30 Nov 2013 04:37:10 +0000 (23:37 -0500)
From my personal communication, I got this suggestion:

 using inline incorrectly: see the C99 standard ยง6.7.4.  Please change to static inline (and report upstream). This also caused some clang compilation problem.

ksort.h

diff --git a/ksort.h b/ksort.h
index 0b15efe9209a7f7c510bb0d096593b301a5bfaed..4da7a13ef043db7d85a39f5623e131f639de3008 100644 (file)
--- a/ksort.h
+++ b/ksort.h
@@ -147,7 +147,7 @@ typedef struct {
                        tmp = *l; *l = l[i]; l[i] = tmp; ks_heapadjust_##name(0, i, l); \
                }                                                                                                                               \
        }                                                                                                                                       \
-       inline void __ks_insertsort_##name(type_t *s, type_t *t)                        \
+       static inline void __ks_insertsort_##name(type_t *s, type_t *t)                 \
        {                                                                                                                                       \
                type_t *i, *j, swap_tmp;                                                                                \
                for (i = s + 1; i < t; ++i)                                                                             \