don't inline functions that can't be inlined.

This commit is contained in:
Jordan Lee 2012-12-13 02:00:45 +00:00
parent d74c7e93c8
commit 104d4aa772
3 changed files with 22 additions and 20 deletions

View File

@ -130,6 +130,21 @@ tr_bitfieldCountRange (const tr_bitfield * b, size_t begin, size_t end)
return countRange (b, begin, end);
}
bool
tr_bitfieldHas (const tr_bitfield * b, size_t n)
{
if (tr_bitfieldHasAll (b))
return true;
if (tr_bitfieldHasNone (b))
return false;
if (n>>3u >= b->alloc_count)
return false;
return (b->bits[n>>3u] << (n & 7u) & 0x80) != 0;
}
/***
****
***/

View File

@ -98,19 +98,6 @@ tr_bitfieldHasNone (const tr_bitfield * b)
return b->bit_count ? (b->true_count == 0) : b->have_none_hint;
}
static inline bool
tr_bitfieldHas (const tr_bitfield * b, size_t n)
{
if (tr_bitfieldHasAll (b))
return true;
if (tr_bitfieldHasNone (b))
return false;
if (n>>3u >= b->alloc_count)
return false;
return (b->bits[n>>3u] << (n & 7u) & 0x80) != 0;
}
bool tr_bitfieldHas (const tr_bitfield * b, size_t n);
#endif

View File

@ -12,7 +12,7 @@ static int current_test = 0;
#define REPORT_TEST(test, result) \
fprintf (stderr, "%s %s:%d\n", result, __FILE__, __LINE__)
static inline bool
static bool
should_print (bool pass)
{
if (!pass)
@ -25,7 +25,7 @@ should_print (bool pass)
#endif
}
static inline bool
static bool
check_condition_impl (const char * file, int line, bool condition)
{
const bool pass = condition;
@ -36,7 +36,7 @@ check_condition_impl (const char * file, int line, bool condition)
return pass;
}
static inline bool
static bool
check_streq_impl (const char * file, int line, const char * expected, const char * actual)
{
const bool pass = !tr_strcmp0 (expected, actual);
@ -51,7 +51,7 @@ check_streq_impl (const char * file, int line, const char * expected, const char
return pass;
}
static inline bool
static bool
check_int_eq_impl (const char * file, int line, int64_t expected, int64_t actual)
{
const bool pass = expected == actual;
@ -66,7 +66,7 @@ check_int_eq_impl (const char * file, int line, int64_t expected, int64_t actual
return pass;
}
static inline bool
static bool
check_ptr_eq_impl (const char * file, int line, const void * expected, const void * actual)
{
const bool pass = expected == actual;
@ -120,7 +120,7 @@ check_ptr_eq_impl (const char * file, int line, const void * expected, const voi
typedef int (*testFunc)(void);
#define NUM_TESTS(tarray)((int)(sizeof (tarray)/sizeof (tarray[0])))
static inline int
static int
runTests (const testFunc * const tests, int numTests)
{
int ret, i;