From 9113093f9f2fc7f51f91f66cb28832669d0e92ac Mon Sep 17 00:00:00 2001 From: lyken Date: Wed, 28 Aug 2024 12:18:47 +0800 Subject: [PATCH] sizeof -> size_of --- nac3core/src/codegen/model/core.rs | 2 +- nac3core/src/codegen/model/ptr.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nac3core/src/codegen/model/core.rs b/nac3core/src/codegen/model/core.rs index 7c334616..3d03840c 100644 --- a/nac3core/src/codegen/model/core.rs +++ b/nac3core/src/codegen/model/core.rs @@ -100,7 +100,7 @@ pub trait Model<'ctx>: fmt::Debug + Clone + Copy + ModelBase<'ctx> { } /// Get the number of bytes of the [`BasicType`] of this model. - fn sizeof( + fn size_of( &self, generator: &mut G, ctx: &'ctx Context, diff --git a/nac3core/src/codegen/model/ptr.rs b/nac3core/src/codegen/model/ptr.rs index 80e699a1..a15531f4 100644 --- a/nac3core/src/codegen/model/ptr.rs +++ b/nac3core/src/codegen/model/ptr.rs @@ -202,7 +202,7 @@ impl<'ctx, Item: Model<'ctx>> Instance<'ctx, Ptr> { num_items: IntValue<'ctx>, ) { // Force extend `num_items` and `itemsize` to `i64` so their types would match. - let itemsize = self.model.sizeof(generator, ctx.ctx); + let itemsize = self.model.size_of(generator, ctx.ctx); let itemsize = Int(Int64).z_extend_or_truncate(generator, ctx, itemsize); let num_items = Int(Int64).z_extend_or_truncate(generator, ctx, num_items); let totalsize = itemsize.mul(ctx, num_items);