Skip to content

Commit

Permalink
Merge pull request #3 from Aandreba/upgrade-0.11
Browse files Browse the repository at this point in the history
update to 0.11
  • Loading branch information
Aandreba authored Sep 22, 2023
2 parents d5fc419 + 63d10f8 commit 4b669a0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/tests-dev.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
- uses: actions/checkout@v3
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.10.1
- run: zig build test
version: 0.11.0
- run: zig test src/tests.zig
14 changes: 10 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,22 @@ fn build_v11(b: *std.Build) void {
// Docs
const docs = b.addStaticLibrary(.{
.name = "zig-rc",
.root_source_file = .{ .path = "src/main.zig" },
.root_source_file = std.build.LazyPath.relative("src/main.zig"),
.target = target,
.optimize = optimize,
});
docs.emit_docs = .emit;

_ = b.addInstallDirectory(.{
.source_dir = docs.getEmittedDocs(),
.install_dir = .prefix,
.install_subdir = "docs",
});

b.installArtifact(docs);

// Tests
const main_tests = b.addTest(.{
.root_source_file = .{ .path = "src/tests.zig" },
.root_source_file = std.build.LazyPath.relative("src/tests.zig"),
});
const run_main_tests = b.addRunArtifact(main_tests);

Expand All @@ -97,7 +103,7 @@ fn build_v11(b: *std.Build) void {

// Examples
const example = b.addTest(.{
.root_source_file = .{ .path = "src/example.zig" },
.root_source_file = std.build.LazyPath.relative("src/example.zig"),
});
const run_example = b.addRunArtifact(example);
const example_step = b.step("example", "Run library example");
Expand Down
2 changes: 1 addition & 1 deletion src/example.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test "example" {
fn thread_exec(data: Arc) !void {
defer data.releaseWithFn(Data.deinit);

var rng = std.rand.DefaultPrng.init(@bitCast(u64, @truncate(i64, std.time.nanoTimestamp())));
var rng = std.rand.DefaultPrng.init(@as(u64, @bitCast(@as(i64, @truncate(std.time.nanoTimestamp())))));

data.value.mutex.lock();
defer data.value.mutex.unlock();
Expand Down
4 changes: 2 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pub fn Rc(comptime T: type) type {
}

inline fn innerPtr(self: *const Weak) ?*Inner {
return @ptrCast(?*Inner, self.inner);
return @as(?*Inner, @ptrCast(self.inner));
}
};
};
Expand Down Expand Up @@ -480,7 +480,7 @@ pub fn Arc(comptime T: type) type {
}

inline fn innerPtr(self: *const Weak) ?*Inner {
return @ptrCast(?*Inner, self.inner);
return @as(?*Inner, @ptrCast(self.inner));
}
};
};
Expand Down

0 comments on commit 4b669a0

Please sign in to comment.