This commit is contained in:
gingerBill
2024-03-13 15:12:19 +00:00
4 changed files with 9 additions and 5 deletions
+1
View File
@@ -2047,6 +2047,7 @@ internal_int_inverse_modulo :: proc(dest, a, b: ^Int, allocator := context.alloc
return _private_inverse_modulo(dest, a, b) return _private_inverse_modulo(dest, a, b)
} }
internal_int_invmod :: internal_int_inverse_modulo
internal_invmod :: proc{ internal_int_inverse_modulo, } internal_invmod :: proc{ internal_int_inverse_modulo, }
/* /*
+4 -1
View File
@@ -44,7 +44,7 @@ internal_int_prime_is_divisible :: proc(a: ^Int, allocator := context.allocator)
Computes res == G**X mod P. 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. 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 context.allocator = allocator
dr: int 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) 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) Kronecker/Legendre symbol (a|p)
+2 -2
View File
@@ -6796,7 +6796,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
isize index = lookup_polymorphic_record_parameter(original_type, name); isize index = lookup_polymorphic_record_parameter(original_type, name);
if (index >= 0) { if (index >= 0) {
TypeTuple *params = get_record_polymorphic_params(original_type); TypeTuple *params = get_record_polymorphic_params(original_type);
Entity *e = params->variables[i]; Entity *e = params->variables[index];
if (e->kind == Entity_Constant) { if (e->kind == Entity_Constant) {
check_expr_with_type_hint(c, &operands[i], fv->value, e->type); check_expr_with_type_hint(c, &operands[i], fv->value, e->type);
continue; continue;
@@ -6847,7 +6847,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
Array<Operand> ordered_operands = operands; Array<Operand> ordered_operands = operands;
if (!named_fields) { 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); array_copy(&ordered_operands, operands, 0);
} else { } else {
TEMPORARY_ALLOCATOR_GUARD(); TEMPORARY_ALLOCATOR_GUARD();
+1 -1
View File
@@ -407,7 +407,7 @@ gb_internal ReadDirectoryError read_directory(String path, Array<FileInfo> *fi)
i64 size = dir_stat.st_size; i64 size = dir_stat.st_size;
FileInfo info = {}; FileInfo info = {};
info.name = name; info.name = copy_string(a, name);
info.fullpath = path_to_full_path(a, filepath); info.fullpath = path_to_full_path(a, filepath);
info.size = size; info.size = size;
array_add(fi, info); array_add(fi, info);