mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
Merge pull request #953 from der-teufel-programming/update_once_more
Update to latest master
This commit is contained in:
@ -19,7 +19,7 @@ const Version = @import("src/build/Version.zig");
|
||||
// but we liberally update it. In the future, we'll be more careful about
|
||||
// using released versions so that package managers can integrate better.
|
||||
comptime {
|
||||
const required_zig = "0.12.0-dev.983+78f2ae7f2";
|
||||
const required_zig = "0.12.0-dev.1754+2a3226453";
|
||||
const current_zig = builtin.zig_version;
|
||||
const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable;
|
||||
if (current_zig.order(min_zig) == .lt) {
|
||||
@ -875,7 +875,7 @@ fn benchSteps(
|
||||
) !void {
|
||||
// Open the directory ./src/bench
|
||||
const c_dir_path = (comptime root()) ++ "/src/bench";
|
||||
var c_dir = try fs.openIterableDirAbsolute(c_dir_path, .{});
|
||||
var c_dir = try fs.openDirAbsolute(c_dir_path, .{ .iterate = true });
|
||||
defer c_dir.close();
|
||||
|
||||
// Go through and add each as a step
|
||||
@ -918,7 +918,7 @@ fn conformanceSteps(
|
||||
|
||||
// Open the directory ./conformance
|
||||
const c_dir_path = (comptime root()) ++ "/conformance";
|
||||
var c_dir = try fs.openIterableDirAbsolute(c_dir_path, .{});
|
||||
var c_dir = try fs.openDirAbsolute(c_dir_path, .{ .iterate = true });
|
||||
defer c_dir.close();
|
||||
|
||||
// Go through and add each as a step
|
||||
|
@ -5,12 +5,12 @@
|
||||
.dependencies = .{
|
||||
// Zig libs
|
||||
.libxev = .{
|
||||
.url = "https://github.com/mitchellh/libxev/archive/a5f8b9851c18d93a79a154004fb0393a1ec55c65.tar.gz",
|
||||
.hash = "1220589dfd60060857bfcee53b0ee0e4175f764ae22d54e46054e2f81b63af1f6636",
|
||||
.url = "https://github.com/mitchellh/libxev/archive/7eada4333c36b3e16f4dc2abad707149ef7b6de5.tar.gz",
|
||||
.hash = "1220be2c7b3f3a07b9150720140c7038f454a9ce0cbc5d303767c1e4a50856ec1b01",
|
||||
},
|
||||
.mach_glfw = .{
|
||||
.url = "https://github.com/hexops/mach-glfw/archive/16dc95cc7f74ebbbdd848d9a2c3cc4afc5717708.tar.gz",
|
||||
.hash = "12202da6b8e9024c653f5d67f55a8065b401c42b3c08b69333d95400fe85d6019a59",
|
||||
.url = "https://github.com/hexops/mach-glfw/archive/577220552e1b31c4496d2e0df2fb5fbc9287b966.tar.gz",
|
||||
.hash = "12204779ba2f14b46f569110f774d5c3f48b7a105b6717e668bc410710bceae62072",
|
||||
},
|
||||
.zig_objc = .{
|
||||
.url = "https://github.com/mitchellh/zig-objc/archive/10e552bd37c2f61b9f570d5ceb145165c6f1854b.tar.gz",
|
||||
|
6
flake.lock
generated
6
flake.lock
generated
@ -257,11 +257,11 @@
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1700439807,
|
||||
"narHash": "sha256-8JOqjnlOsJWryzfZ61Zz0hfCW2m6mu8JnW0Sb/EWB3I=",
|
||||
"lastModified": 1701259715,
|
||||
"narHash": "sha256-k323e7C01XaVyvzprw6Lay51V1quKzkPOsrbEtkV390=",
|
||||
"owner": "mitchellh",
|
||||
"repo": "zig-overlay",
|
||||
"rev": "0a3f3e96cbb0df6c70dd6c957c0fde90d8d57a78",
|
||||
"rev": "3b7938f44a345b12f70f0e34d5492b75e4005767",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1,3 +1,3 @@
|
||||
# This file is auto-generated! check build-support/check-zig-cache-hash.sh for
|
||||
# more details.
|
||||
"sha256-bQ81e0vJBSLkVJ3a3nLraVc/JeG77xGckuARmu81DqI="
|
||||
"sha256-Dn9KRvSteFvHWy6ULEQbRIQZf+bVfpVYWsImGm32qeI="
|
||||
|
@ -89,7 +89,7 @@ pub const Property = enum {
|
||||
|
||||
// Build our string
|
||||
var name: [replaced.len:0]u8 = undefined;
|
||||
std.mem.copy(u8, &name, replaced);
|
||||
@memcpy(&name, replaced);
|
||||
name[replaced.len] = 0;
|
||||
break :name &name;
|
||||
};
|
||||
|
@ -374,9 +374,9 @@ pub fn expandPath(alloc: Allocator, cmd: []const u8) !?[]u8 {
|
||||
if (path_buf.len < path_len) return error.PathTooLong;
|
||||
|
||||
// Copy in the full path
|
||||
mem.copy(u8, &path_buf, search_path);
|
||||
@memcpy(path_buf[0..search_path.len], search_path);
|
||||
path_buf[search_path.len] = std.fs.path.sep;
|
||||
mem.copy(u8, path_buf[search_path.len + 1 ..], cmd);
|
||||
@memcpy(path_buf[search_path.len + 1 ..][0..cmd.len], cmd);
|
||||
path_buf[path_len] = 0;
|
||||
const full_path = path_buf[0..path_len :0];
|
||||
|
||||
@ -440,9 +440,9 @@ fn createNullDelimitedEnvMap(arena: mem.Allocator, env_map: *const EnvMap) ![:nu
|
||||
var i: usize = 0;
|
||||
while (it.next()) |pair| : (i += 1) {
|
||||
const env_buf = try arena.allocSentinel(u8, pair.key_ptr.len + pair.value_ptr.len + 1, 0);
|
||||
mem.copy(u8, env_buf, pair.key_ptr.*);
|
||||
@memcpy(env_buf[0..pair.key_ptr.len], pair.key_ptr.*);
|
||||
env_buf[pair.key_ptr.len] = '=';
|
||||
mem.copy(u8, env_buf[pair.key_ptr.len + 1 ..], pair.value_ptr.*);
|
||||
@memcpy(env_buf[pair.key_ptr.len + 1 ..], pair.value_ptr.*);
|
||||
envp_buf[i] = env_buf.ptr;
|
||||
}
|
||||
std.debug.assert(i == envp_count);
|
||||
|
@ -2501,7 +2501,7 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
||||
.text => |data| {
|
||||
// For text we always allocate just because its easier to
|
||||
// handle all cases that way.
|
||||
var buf = try self.alloc.alloc(u8, data.len);
|
||||
const buf = try self.alloc.alloc(u8, data.len);
|
||||
defer self.alloc.free(buf);
|
||||
const text = configpkg.string.parse(buf, data) catch |err| {
|
||||
log.warn(
|
||||
|
@ -204,14 +204,14 @@ fn parseIntoField(
|
||||
[]const u8 => value: {
|
||||
const slice = value orelse return error.ValueRequired;
|
||||
const buf = try alloc.alloc(u8, slice.len);
|
||||
mem.copy(u8, buf, slice);
|
||||
@memcpy(buf, slice);
|
||||
break :value buf;
|
||||
},
|
||||
|
||||
[:0]const u8 => value: {
|
||||
const slice = value orelse return error.ValueRequired;
|
||||
const buf = try alloc.allocSentinel(u8, slice.len, 0);
|
||||
mem.copy(u8, buf, slice);
|
||||
@memcpy(buf, slice);
|
||||
buf[slice.len] = 0;
|
||||
break :value buf;
|
||||
},
|
||||
@ -709,7 +709,7 @@ pub fn LineIterator(comptime ReaderType: type) type {
|
||||
// Trim any whitespace around it
|
||||
const trim = std.mem.trim(u8, entry, whitespace);
|
||||
if (trim.len != entry.len) {
|
||||
std.mem.copy(u8, entry, trim);
|
||||
std.mem.copyForwards(u8, entry, trim);
|
||||
entry = entry[0..trim.len];
|
||||
}
|
||||
|
||||
@ -737,9 +737,9 @@ pub fn LineIterator(comptime ReaderType: type) type {
|
||||
|
||||
const len = key.len + value.len + 1;
|
||||
if (entry.len != len) {
|
||||
std.mem.copy(u8, entry, key);
|
||||
std.mem.copyForwards(u8, entry, key);
|
||||
entry[key.len] = '=';
|
||||
std.mem.copy(u8, entry[key.len + 1 ..], value);
|
||||
std.mem.copyForwards(u8, entry[key.len + 1 ..], value);
|
||||
entry = entry[0..len];
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ pub fn run(alloc: Allocator) !u8 {
|
||||
const path = try std.fs.path.join(alloc, &.{ resources_dir, "themes" });
|
||||
defer alloc.free(path);
|
||||
|
||||
var dir = try std.fs.cwd().openIterableDir(path, .{});
|
||||
var dir = try std.fs.cwd().openDir(path, .{ .iterate = true });
|
||||
defer dir.close();
|
||||
|
||||
var walker = try dir.walk(alloc);
|
||||
|
@ -2246,7 +2246,7 @@ pub const Keybinds = struct {
|
||||
const buf = try alloc.alloc(u8, value.len);
|
||||
copy = buf;
|
||||
|
||||
std.mem.copy(u8, buf, value);
|
||||
@memcpy(buf, value);
|
||||
break :value buf;
|
||||
};
|
||||
errdefer if (copy) |v| alloc.free(v);
|
||||
|
@ -2,23 +2,23 @@ const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const assert = std.debug.assert;
|
||||
|
||||
/// Same as std.mem.copy but prefers libc memmove if it is available
|
||||
/// Same as std.mem.copyForwards but prefers libc memmove if it is available
|
||||
/// because it is generally much faster.
|
||||
pub inline fn move(comptime T: type, dest: []T, source: []const T) void {
|
||||
if (builtin.link_libc) {
|
||||
_ = memmove(dest.ptr, source.ptr, source.len * @sizeOf(T));
|
||||
} else {
|
||||
std.mem.copy(T, dest, source);
|
||||
std.mem.copyForwards(T, dest, source);
|
||||
}
|
||||
}
|
||||
|
||||
/// Same as std.mem.copy but prefers libc memcpy if it is available
|
||||
/// Same as std.mem.copyForwards but prefers libc memcpy if it is available
|
||||
/// because it is generally much faster.
|
||||
pub inline fn copy(comptime T: type, dest: []T, source: []const T) void {
|
||||
if (builtin.link_libc) {
|
||||
_ = memcpy(dest.ptr, source.ptr, source.len * @sizeOf(T));
|
||||
} else {
|
||||
std.mem.copy(T, dest, source);
|
||||
@memcpy(dest[0..source.len], source);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ const PixmanImpl = struct {
|
||||
var src_ptr = data.ptr;
|
||||
var i: usize = 0;
|
||||
while (i < height) : (i += 1) {
|
||||
std.mem.copy(u8, dst_ptr, src_ptr[0 .. width * depth]);
|
||||
@memcpy(dst_ptr[0 .. width * depth], src_ptr[0 .. width * depth]);
|
||||
dst_ptr = dst_ptr[width * depth ..];
|
||||
src_ptr += @as(usize, @intCast(stride));
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ fn homeUnix(buf: []u8) !?[]u8 {
|
||||
// First: if we have a HOME env var, then we use that.
|
||||
if (std.os.getenv("HOME")) |result| {
|
||||
if (buf.len < result.len) return Error.BufferTooSmall;
|
||||
std.mem.copy(u8, buf, result);
|
||||
@memcpy(buf[0..result.len], result);
|
||||
return buf[0..result.len];
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ fn homeUnix(buf: []u8) !?[]u8 {
|
||||
if (run.term == .Exited and run.term.Exited == 0) {
|
||||
const result = trimSpace(run.stdout);
|
||||
if (buf.len < result.len) return Error.BufferTooSmall;
|
||||
std.mem.copy(u8, buf, result);
|
||||
@memcpy(buf[0..result.len], result);
|
||||
return buf[0..result.len];
|
||||
}
|
||||
}
|
||||
@ -56,7 +56,7 @@ fn homeUnix(buf: []u8) !?[]u8 {
|
||||
const pw = try passwd.get(fba.allocator());
|
||||
if (pw.home) |result| {
|
||||
if (buf.len < result.len) return Error.BufferTooSmall;
|
||||
std.mem.copy(u8, buf, result);
|
||||
@memcpy(buf[0..result.len], result);
|
||||
return buf[0..result.len];
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ fn homeUnix(buf: []u8) !?[]u8 {
|
||||
if (run.term == .Exited and run.term.Exited == 0) {
|
||||
const result = trimSpace(run.stdout);
|
||||
if (buf.len < result.len) return Error.BufferTooSmall;
|
||||
std.mem.copy(u8, buf, result);
|
||||
@memcpy(buf[0..result.len], result);
|
||||
return buf[0..result.len];
|
||||
}
|
||||
|
||||
|
@ -123,14 +123,14 @@ pub fn get(alloc: Allocator) !Entry {
|
||||
if (pw.pw_shell) |ptr| {
|
||||
const source = std.mem.sliceTo(ptr, 0);
|
||||
const sh = try alloc.alloc(u8, source.len);
|
||||
std.mem.copy(u8, sh, source);
|
||||
@memcpy(sh, source);
|
||||
result.shell = sh;
|
||||
}
|
||||
|
||||
if (pw.pw_dir) |ptr| {
|
||||
const source = std.mem.sliceTo(ptr, 0);
|
||||
const dir = try alloc.alloc(u8, source.len);
|
||||
std.mem.copy(u8, dir, source);
|
||||
@memcpy(dir, source);
|
||||
result.home = dir;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ const WindowsPty = struct {
|
||||
pub const Fd = windows.HANDLE;
|
||||
|
||||
// Process-wide counter for pipe names
|
||||
var pipe_name_counter = std.atomic.Atomic(u32).init(1);
|
||||
var pipe_name_counter = std.atomic.Value(u32).init(1);
|
||||
|
||||
out_pipe: windows.HANDLE,
|
||||
in_pipe: windows.HANDLE,
|
||||
|
@ -762,7 +762,7 @@ const Subprocess = struct {
|
||||
// Copy it with a hyphen so its a login shell
|
||||
const argv0_buf = try alloc.alloc(u8, argv0.len + 1);
|
||||
argv0_buf[0] = '-';
|
||||
std.mem.copy(u8, argv0_buf[1..], argv0);
|
||||
@memcpy(argv0_buf[1..], argv0);
|
||||
break :argv0 argv0_buf;
|
||||
} else null;
|
||||
|
||||
@ -2120,7 +2120,7 @@ const StreamHandler = struct {
|
||||
return;
|
||||
}
|
||||
|
||||
std.mem.copy(u8, &buf, title);
|
||||
@memcpy(buf[0..title.len], title);
|
||||
buf[title.len] = 0;
|
||||
|
||||
// Mark that we've seen a title
|
||||
|
@ -130,7 +130,7 @@ pub fn MessageData(comptime Elem: type, comptime small_size: comptime_int) type
|
||||
// If it fits in our small request, do that.
|
||||
if (data.len <= Small.Max) {
|
||||
var buf: Small.Array = undefined;
|
||||
std.mem.copy(Elem, &buf, data);
|
||||
@memcpy(buf[0..data.len], data);
|
||||
return Self{
|
||||
.small = .{
|
||||
.data = buf,
|
||||
|
Reference in New Issue
Block a user