mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Update to latest master,
update libxev dependency, change mach_glfw to an updated fork until upstream updates
This commit is contained in:
@ -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 = "git+https://github.com/der-teufel-programming/mach-glfw#577220552e1b31c4496d2e0df2fb5fbc9287b966",
|
||||
.hash = "12204779ba2f14b46f569110f774d5c3f48b7a105b6717e668bc410710bceae62072",
|
||||
},
|
||||
.zig_objc = .{
|
||||
.url = "https://github.com/mitchellh/zig-objc/archive/10e552bd37c2f61b9f570d5ceb145165c6f1854b.tar.gz",
|
||||
|
@ -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);
|
||||
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
std.mem.copyForwards(T, dest, 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;
|
||||
}
|
||||
|
||||
|
@ -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