mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
[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:
@@ -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, }
|
||||
Reference in New Issue
Block a user