Fix src/Surface.zig

Change fastmem.copy to use memcpy builtin
This commit is contained in:
Krzysztof Wolicki
2023-11-30 21:58:14 +01:00
parent bfc688e96e
commit 9238bdb4da
3 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@
.hash = "1220be2c7b3f3a07b9150720140c7038f454a9ce0cbc5d303767c1e4a50856ec1b01",
},
.mach_glfw = .{
.url = "git+https://github.com/der-teufel-programming/mach-glfw#577220552e1b31c4496d2e0df2fb5fbc9287b966",
.url = "https://github.com/der-teufel-programming/mach-glfw/archive/577220552e1b31c4496d2e0df2fb5fbc9287b966.tar.gz",
.hash = "12204779ba2f14b46f569110f774d5c3f48b7a105b6717e668bc410710bceae62072",
},
.zig_objc = .{

View File

@ -2483,7 +2483,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(

View File

@ -18,7 +18,7 @@ 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.copyForwards(T, dest, source);
@memcpy(dest[0..source.len], source);
}
}