Skip to content

Commit 3a79400

Browse files
committed
Fix c_long bitcast for Windows where c_long is 32 bits
1 parent 3a20e00 commit 3a79400

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/tracer_nif.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub fn nif_trace(env: ?*ErlNifEnv, argc: c_int, argv: [*]const ERL_NIF_TERM) cal
184184
var arity_val: c_long = 0;
185185
if (enif_get_long(env, tuple_elements[2], &arity_val) != 0) {
186186
arity = if (arity_val >= 0 and arity_val <= 255)
187-
@intCast(@as(u64, @bitCast(arity_val)))
187+
@intCast(arity_val)
188188
else
189189
0;
190190
}
@@ -227,7 +227,7 @@ pub fn nif_create_trace_buffer(env: ?*ErlNifEnv, argc: c_int, argv: [*]const ERL
227227
return make_error(env, "badarg");
228228
}
229229

230-
const capacity: usize = @intCast(@as(u64, @bitCast(size)));
230+
const capacity: usize = @intCast(size);
231231
const buf = RingBuffer.create(capacity) orelse {
232232
return make_error(env, "alloc_failed");
233233
};
@@ -276,7 +276,7 @@ pub fn nif_drain_trace_buffer(env: ?*ErlNifEnv, argc: c_int, argv: [*]const ERL_
276276
return make_error(env, "badarg");
277277
}
278278

279-
const count: usize = @intCast(@as(u64, @bitCast(max_count)));
279+
const count: usize = @intCast(max_count);
280280

281281
// Allocate temporary buffer for reading entries
282282
const read_buf = std.heap.page_allocator.alloc(TraceEntry, count) catch {

0 commit comments

Comments
 (0)