mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-05 20:48:04 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -2047,6 +2047,7 @@ internal_int_inverse_modulo :: proc(dest, a, b: ^Int, allocator := context.alloc
|
||||
|
||||
return _private_inverse_modulo(dest, a, b)
|
||||
}
|
||||
internal_int_invmod :: internal_int_inverse_modulo
|
||||
internal_invmod :: proc{ internal_int_inverse_modulo, }
|
||||
|
||||
/*
|
||||
|
||||
@@ -44,7 +44,7 @@ internal_int_prime_is_divisible :: proc(a: ^Int, allocator := context.allocator)
|
||||
Computes res == G**X mod P.
|
||||
Assumes `res`, `G`, `X` and `P` to not be `nil` and for `G`, `X` and `P` to have been initialized.
|
||||
*/
|
||||
internal_int_exponent_mod :: proc(res, G, X, P: ^Int, allocator := context.allocator) -> (err: Error) {
|
||||
internal_int_power_modulo :: proc(res, G, X, P: ^Int, allocator := context.allocator) -> (err: Error) {
|
||||
context.allocator = allocator
|
||||
|
||||
dr: int
|
||||
@@ -112,6 +112,9 @@ internal_int_exponent_mod :: proc(res, G, X, P: ^Int, allocator := context.alloc
|
||||
*/
|
||||
return _private_int_exponent_mod(res, G, X, P, 0)
|
||||
}
|
||||
internal_int_exponent_mod :: internal_int_power_modulo
|
||||
internal_int_powmod :: internal_int_power_modulo
|
||||
internal_powmod :: proc { internal_int_power_modulo, }
|
||||
|
||||
/*
|
||||
Kronecker/Legendre symbol (a|p)
|
||||
@@ -1411,4 +1414,4 @@ number_of_rabin_miller_trials :: proc(bit_size: int) -> (number_of_trials: int)
|
||||
case:
|
||||
return 2 /* For keysizes bigger than 10_240 use always at least 2 Rounds */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6796,7 +6796,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
|
||||
isize index = lookup_polymorphic_record_parameter(original_type, name);
|
||||
if (index >= 0) {
|
||||
TypeTuple *params = get_record_polymorphic_params(original_type);
|
||||
Entity *e = params->variables[i];
|
||||
Entity *e = params->variables[index];
|
||||
if (e->kind == Entity_Constant) {
|
||||
check_expr_with_type_hint(c, &operands[i], fv->value, e->type);
|
||||
continue;
|
||||
@@ -6847,7 +6847,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
|
||||
|
||||
Array<Operand> ordered_operands = operands;
|
||||
if (!named_fields) {
|
||||
ordered_operands = array_make<Operand>(permanent_allocator(), param_count);
|
||||
ordered_operands = array_make<Operand>(permanent_allocator(), operands.count);
|
||||
array_copy(&ordered_operands, operands, 0);
|
||||
} else {
|
||||
TEMPORARY_ALLOCATOR_GUARD();
|
||||
|
||||
@@ -407,7 +407,7 @@ gb_internal ReadDirectoryError read_directory(String path, Array<FileInfo> *fi)
|
||||
i64 size = dir_stat.st_size;
|
||||
|
||||
FileInfo info = {};
|
||||
info.name = name;
|
||||
info.name = copy_string(a, name);
|
||||
info.fullpath = path_to_full_path(a, filepath);
|
||||
info.size = size;
|
||||
array_add(fi, info);
|
||||
|
||||
Reference in New Issue
Block a user