Skip to content

Commit b9f9d4b

Browse files
committed
Further cleanup imports
1 parent a576b8b commit b9f9d4b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main.zig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ pub const Func = opaque {
164164
@compileError("Expected 'args' to be a tuple, but found type '" ++ @typeName(@TypeOf(args)) ++ "'");
165165

166166
const args_len = args.len;
167-
comptime var wasm_args: [args_len]c.Value = undefined;
167+
comptime var wasm_args: [args_len]Value = undefined;
168168
inline for (wasm_args) |*arg, i| {
169169
arg.* = switch (@TypeOf(args[i])) {
170170
i32, u32 => .{ .kind = .i32, .of = .{ .i32 = @intCast(i32, args[i]) } },
171171
i64, u64 => .{ .kind = .i64, .of = .{ .i64 = @intCast(i64, args[i]) } },
172172
f32 => .{ .kind = .f32, .of = .{ .f32 = args[i] } },
173173
f64 => .{ .kind = .f64, .of = .{ .f64 = args[i] } },
174174
*Func => .{ .kind = .funcref, .of = .{ .ref = args[i] } },
175-
*c.Extern => .{ .kind = .anyref, .of = .{ .ref = args[i] } },
175+
*Extern => .{ .kind = .anyref, .of = .{ .ref = args[i] } },
176176
else => |ty| @compileError("Unsupported argument type '" ++ @typeName(ty) + "'"),
177177
};
178178
}
@@ -238,10 +238,10 @@ pub const Instance = opaque {
238238
/// The given slice defined in `import` must match what was initialized
239239
/// using the same `Store` as given.
240240
pub fn init(store: *Store, module: *Module, import: []const *Func) !*Instance {
241-
var trap: ?*c.Trap = null;
241+
var trap: ?*Trap = null;
242242
var instance: ?*Instance = null;
243243

244-
var imports = c.ExternVec.initWithCapacity(import.len);
244+
var imports = ExternVec.initWithCapacity(import.len);
245245
defer imports.deinit();
246246

247247
var ptr = imports.data;
@@ -274,8 +274,8 @@ pub const Instance = opaque {
274274

275275
/// Returns an export by its name and `null` when not found
276276
/// The `Extern` is copied and must be freed manually
277-
pub fn getExport(self: *Instance, name: []const u8) ?*c.Extern {
278-
var externs: c.ExternVec = undefined;
277+
pub fn getExport(self: *Instance, name: []const u8) ?*Extern {
278+
var externs: ExternVec = undefined;
279279
wasm_instance_exports(self, &externs);
280280
defer externs.deinit();
281281

@@ -298,17 +298,17 @@ pub const Instance = opaque {
298298
} else null;
299299
}
300300

301-
/// Returns an exported `c.Memory` when found and `null` when not.
301+
/// Returns an exported `Memory` when found and `null` when not.
302302
/// The result is copied and must be freed manually by calling `deinit()` on the result.
303-
pub fn getExportMem(self: *Instance, name: []const u8) ?*c.Memory {
303+
pub fn getExportMem(self: *Instance, name: []const u8) ?*Memory {
304304
return if (self.getExport(name)) |exp| {
305305
defer exp.deinit(); // free the copy
306306
return exp.asMemory().copy();
307307
} else null;
308308
}
309309

310-
/// Returns the `c.InstanceType` of the `Instance`
311-
pub fn getType(self: *Instance) *c.InstanceType {
310+
/// Returns the `InstanceType` of the `Instance`
311+
pub fn getType(self: *Instance) *InstanceType {
312312
return wasm_instance_type(self).?;
313313
}
314314

0 commit comments

Comments
 (0)