[math/big] Rename internal_int_shl_digit to _private_int_shl_leg.

Same for the SHR variant. These are pure implementation details to shift by a leg/word at a time.
Prevent accidental usage.
This commit is contained in:
Jeroen van Rijn
2021-12-11 15:22:24 +01:00
parent 84b84d9f7d
commit 938744b276
5 changed files with 116 additions and 149 deletions
+1 -32
View File
@@ -86,21 +86,6 @@ int_shr :: proc(dest, source: ^Int, bits: int, allocator := context.allocator) -
}
shr :: proc { int_shr, }
/*
Shift right by `digits` * _DIGIT_BITS bits.
*/
int_shr_digit :: proc(quotient: ^Int, digits: int, allocator := context.allocator) -> (err: Error) {
/*
Check that `quotient` is usable.
*/
assert_if_nil(quotient)
context.allocator = allocator
internal_clear_if_uninitialized(quotient) or_return
return #force_inline internal_int_shr_digit(quotient, digits)
}
shr_digit :: proc { int_shr_digit, }
/*
Shift right by a certain bit count with sign extension.
*/
@@ -124,20 +109,4 @@ int_shl :: proc(dest, src: ^Int, bits: int, allocator := context.allocator) -> (
internal_clear_if_uninitialized(dest, src) or_return
return #force_inline internal_int_shl(dest, src, bits)
}
shl :: proc { int_shl, }
/*
Shift left by `digits` * _DIGIT_BITS bits.
*/
int_shl_digit :: proc(quotient: ^Int, digits: int, allocator := context.allocator) -> (err: Error) {
/*
Check that `quotient` is usable.
*/
assert_if_nil(quotient)
context.allocator = allocator
internal_clear_if_uninitialized(quotient) or_return
return #force_inline internal_int_shl_digit(quotient, digits)
}
shl_digit :: proc { int_shl_digit, };
shl :: proc { int_shl, }