remove calls to deprecated std.mem.copy function

This commit is contained in:
LordMZTE 2023-12-03 17:16:49 +01:00
parent 02eef1d116
commit 164841d3aa
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
4 changed files with 5 additions and 5 deletions

View file

@ -126,7 +126,7 @@ pub fn doCompile(path: []const u8, alloc: std.mem.Allocator) !void {
}
// replace file extension
std.mem.copy(u8, outname[outname.len - 3 ..], "lua");
@memcpy(outname[outname.len - 3 ..], "lua");
var file = try std.fs.cwd().openFile(luafile, .{});
defer file.close();

View file

@ -72,7 +72,7 @@ pub fn init(win: *c.GLFWwindow) !*Self {
.live_status_loading = true,
};
std.mem.copy(u8, &self.quality_buf, "best");
@memcpy(self.quality_buf[0..4], "best");
const thread = try std.Thread.spawn(.{}, config.configLoaderThread, .{self});
thread.detach();

View file

@ -83,8 +83,8 @@ pub fn winContent(state: *State) !void {
for (preset_qualities) |quality| {
if (c.igSelectable_Bool(quality.ptr, false, 0, .{ .x = 0.0, .y = 0.0 })) {
@memset(&state.quality_buf, 0);
std.mem.copy(u8, &state.quality_buf, quality);
@memcpy(state.quality_buf[0..quality.len], quality);
state.quality_buf[quality.len] = 0;
}
}
}

View file

@ -129,7 +129,7 @@ fn setWallpapersX(alloc: std.mem.Allocator, wps: []const []const u8) !u8 {
feh_baseargs.len + @as(usize, @intCast(screens)),
);
defer alloc.free(feh_argv);
std.mem.copy([]const u8, feh_argv, &feh_baseargs);
@memcpy(feh_argv[0..feh_baseargs.len], &feh_baseargs);
var prng = std.rand.DefaultPrng.init(std.crypto.random.int(u64));
const rand = prng.random();