aboutsummaryrefslogtreecommitdiff
path: root/src/install/semver.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-06-21 23:38:18 -0700
committerGravatar GitHub <noreply@github.com> 2023-06-21 23:38:18 -0700
commit5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f (patch)
tree97f669a178e60772038751d690c3e298a63557b2 /src/install/semver.zig
parentbfb322d618a3f0e9618d311ae69016fe7a08e771 (diff)
downloadbun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.tar.gz
bun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.tar.zst
bun-5fa13625a1ca0ea1a3a1c5bb86d0880dcfac349f.zip
upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/install/semver.zig')
-rw-r--r--src/install/semver.zig24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/install/semver.zig b/src/install/semver.zig
index 9fd6b9c8d..c2730e7c7 100644
--- a/src/install/semver.zig
+++ b/src/install/semver.zig
@@ -263,7 +263,7 @@ pub const String = extern struct {
std.debug.assert(bun.isSliceInBuffer(in, buf));
return Pointer{
- .off = @truncate(u32, @ptrToInt(in.ptr) - @ptrToInt(buf.ptr)),
+ .off = @truncate(u32, @intFromPtr(in.ptr) - @intFromPtr(buf.ptr)),
.len = @truncate(u32, in.len),
};
}
@@ -311,7 +311,7 @@ pub const String = extern struct {
pub const StringPool = std.HashMap(u64, String, IdentityContext(u64), 80);
pub inline fn stringHash(buf: []const u8) u64 {
- return std.hash.Wyhash.hash(0, buf);
+ return bun.Wyhash.hash(0, buf);
}
pub inline fn count(this: *Builder, slice_: string) void {
@@ -515,7 +515,7 @@ pub const ExternalString = extern struct {
pub inline fn from(in: string) ExternalString {
return ExternalString{
.value = String.init(in, in),
- .hash = std.hash.Wyhash.hash(0, in),
+ .hash = bun.Wyhash.hash(0, in),
};
}
@@ -552,15 +552,15 @@ pub const BigExternalString = extern struct {
return BigExternalString{
.off = 0,
.len = @truncate(u32, in.len),
- .hash = std.hash.Wyhash.hash(0, in),
+ .hash = bun.Wyhash.hash(0, in),
};
}
pub inline fn init(buf: string, in: string, hash: u64) BigExternalString {
- std.debug.assert(@ptrToInt(buf.ptr) <= @ptrToInt(in.ptr) and ((@ptrToInt(in.ptr) + in.len) <= (@ptrToInt(buf.ptr) + buf.len)));
+ std.debug.assert(@intFromPtr(buf.ptr) <= @intFromPtr(in.ptr) and ((@intFromPtr(in.ptr) + in.len) <= (@intFromPtr(buf.ptr) + buf.len)));
return BigExternalString{
- .off = @truncate(u32, @ptrToInt(in.ptr) - @ptrToInt(buf.ptr)),
+ .off = @truncate(u32, @intFromPtr(in.ptr) - @intFromPtr(buf.ptr)),
.len = @truncate(u32, in.len),
.hash = hash,
};
@@ -580,19 +580,19 @@ pub const SlicedString = struct {
}
pub inline fn external(this: SlicedString) ExternalString {
- if (comptime Environment.allow_assert) std.debug.assert(@ptrToInt(this.buf.ptr) <= @ptrToInt(this.slice.ptr) and ((@ptrToInt(this.slice.ptr) + this.slice.len) <= (@ptrToInt(this.buf.ptr) + this.buf.len)));
+ if (comptime Environment.allow_assert) std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.slice.ptr) and ((@intFromPtr(this.slice.ptr) + this.slice.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
- return ExternalString.init(this.buf, this.slice, std.hash.Wyhash.hash(0, this.slice));
+ return ExternalString.init(this.buf, this.slice, bun.Wyhash.hash(0, this.slice));
}
pub inline fn value(this: SlicedString) String {
- if (comptime Environment.allow_assert) std.debug.assert(@ptrToInt(this.buf.ptr) <= @ptrToInt(this.slice.ptr) and ((@ptrToInt(this.slice.ptr) + this.slice.len) <= (@ptrToInt(this.buf.ptr) + this.buf.len)));
+ if (comptime Environment.allow_assert) std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.slice.ptr) and ((@intFromPtr(this.slice.ptr) + this.slice.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
return String.init(this.buf, this.slice);
}
pub inline fn sub(this: SlicedString, input: string) SlicedString {
- std.debug.assert(@ptrToInt(this.buf.ptr) <= @ptrToInt(this.buf.ptr) and ((@ptrToInt(input.ptr) + input.len) <= (@ptrToInt(this.buf.ptr) + this.buf.len)));
+ std.debug.assert(@intFromPtr(this.buf.ptr) <= @intFromPtr(this.buf.ptr) and ((@intFromPtr(input.ptr) + input.len) <= (@intFromPtr(this.buf.ptr) + this.buf.len)));
return SlicedString{ .buf = this.buf, .slice = input };
}
};
@@ -678,7 +678,7 @@ pub const Version = extern struct {
.build = this.tag.build.hash,
};
const bytes = std.mem.asBytes(&hashable);
- return std.hash.Wyhash.hash(0, bytes);
+ return bun.Wyhash.hash(0, bytes);
}
pub const Formatter = struct {
@@ -1814,7 +1814,7 @@ pub const Query = struct {
};
if (!hyphenate) i = rollback;
- i += @as(usize, @boolToInt(!hyphenate));
+ i += @as(usize, @intFromBool(!hyphenate));
if (hyphenate) {
const second_parsed = Version.parse(sliced.sub(input[i..]), allocator);