From ebf86cd134cabaec536802c59202933d2a3a0938 Mon Sep 17 00:00:00 2001 From: David Mak Date: Thu, 7 Mar 2024 12:59:48 +0800 Subject: [PATCH] core: Use size_t for accessing array elements --- nac3core/src/toplevel/numpy.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nac3core/src/toplevel/numpy.rs b/nac3core/src/toplevel/numpy.rs index 9b93ce3b6..38fd387a0 100644 --- a/nac3core/src/toplevel/numpy.rs +++ b/nac3core/src/toplevel/numpy.rs @@ -592,7 +592,6 @@ fn call_ndarray_eye_impl<'ctx>( ncols: IntValue<'ctx>, offset: IntValue<'ctx>, ) -> Result, String> { - let llvm_i32 = ctx.ctx.i32_type(); let llvm_usize = generator.get_size_type(ctx.ctx); let llvm_usize_2 = llvm_usize.array_type(2); @@ -623,12 +622,12 @@ fn call_ndarray_eye_impl<'ctx>( |generator, ctx, indices| { let row = ctx.build_gep_and_load( indices, - &[llvm_i32.const_zero()], + &[llvm_usize.const_int(0, false)], None, ).into_int_value(); let col = ctx.build_gep_and_load( indices, - &[llvm_i32.const_int(1, true)], + &[llvm_usize.const_int(1, false)], None, ).into_int_value();