Skip to content

Commit

Permalink
Fix GCC unused function warning
Browse files Browse the repository at this point in the history
<source>:565:30: error: unused function 'libdivide_u128_shift' [-Werror,-Wunused-function]
static LIBDIVIDE_INLINE void libdivide_u128_shift(
  • Loading branch information
kimwalisch authored Oct 17, 2022
1 parent c6ff27a commit 3bd3438
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libdivide.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// libdivide.h - Optimized integer division
// https://libdivide.com
//
// Copyright (C) 2010 - 2021 ridiculous_fish, <libdivide@ridiculousfish.com>
// Copyright (C) 2016 - 2021 Kim Walisch, <kim.walisch@gmail.com>
// Copyright (C) 2010 - 2022 ridiculous_fish, <libdivide@ridiculousfish.com>
// Copyright (C) 2016 - 2022 Kim Walisch, <kim.walisch@gmail.com>
//
// libdivide is dual-licensed under the Boost or zlib licenses.
// You may use libdivide under the terms of either of these.
Expand Down Expand Up @@ -561,6 +561,9 @@ static LIBDIVIDE_INLINE uint64_t libdivide_128_div_64_to_64(
#endif
}

#if !(defined(HAS_INT128_T) && \
defined(HAS_INT128_DIV))

// Bitshift a u128 in place, left (signed_shift > 0) or right (signed_shift < 0)
static LIBDIVIDE_INLINE void libdivide_u128_shift(
uint64_t *u1, uint64_t *u0, int32_t signed_shift) {
Expand All @@ -577,6 +580,8 @@ static LIBDIVIDE_INLINE void libdivide_u128_shift(
}
}

#endif

// Computes a 128 / 128 -> 64 bit division, with a 128 bit remainder.
static LIBDIVIDE_INLINE uint64_t libdivide_128_div_128_to_64(
uint64_t u_hi, uint64_t u_lo, uint64_t v_hi, uint64_t v_lo, uint64_t *r_hi, uint64_t *r_lo) {
Expand Down

0 comments on commit 3bd3438

Please sign in to comment.