mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-09-25 11:38:56 +02:00
remove calls to deprecated std.mem.copy function
This commit is contained in:
parent
02eef1d116
commit
164841d3aa
4 changed files with 5 additions and 5 deletions
|
@ -126,7 +126,7 @@ pub fn doCompile(path: []const u8, alloc: std.mem.Allocator) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace file extension
|
// 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, .{});
|
var file = try std.fs.cwd().openFile(luafile, .{});
|
||||||
defer file.close();
|
defer file.close();
|
||||||
|
|
|
@ -72,7 +72,7 @@ pub fn init(win: *c.GLFWwindow) !*Self {
|
||||||
.live_status_loading = true,
|
.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});
|
const thread = try std.Thread.spawn(.{}, config.configLoaderThread, .{self});
|
||||||
thread.detach();
|
thread.detach();
|
||||||
|
|
|
@ -83,8 +83,8 @@ pub fn winContent(state: *State) !void {
|
||||||
|
|
||||||
for (preset_qualities) |quality| {
|
for (preset_qualities) |quality| {
|
||||||
if (c.igSelectable_Bool(quality.ptr, false, 0, .{ .x = 0.0, .y = 0.0 })) {
|
if (c.igSelectable_Bool(quality.ptr, false, 0, .{ .x = 0.0, .y = 0.0 })) {
|
||||||
@memset(&state.quality_buf, 0);
|
@memcpy(state.quality_buf[0..quality.len], quality);
|
||||||
std.mem.copy(u8, &state.quality_buf, quality);
|
state.quality_buf[quality.len] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ fn setWallpapersX(alloc: std.mem.Allocator, wps: []const []const u8) !u8 {
|
||||||
feh_baseargs.len + @as(usize, @intCast(screens)),
|
feh_baseargs.len + @as(usize, @intCast(screens)),
|
||||||
);
|
);
|
||||||
defer alloc.free(feh_argv);
|
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));
|
var prng = std.rand.DefaultPrng.init(std.crypto.random.int(u64));
|
||||||
const rand = prng.random();
|
const rand = prng.random();
|
||||||
|
|
Loading…
Reference in a new issue