replace c_str! macro with c"literals"

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-06-20 11:07:10 +02:00
parent fd3f72820e
commit 6359e6d4d4
6 changed files with 6 additions and 8 deletions

View File

@ -39,7 +39,6 @@ proxmox-compression.workspace = true
proxmox-http = { workspace = true, features = [ "rate-limiter" ] }
proxmox-human-byte.workspace = true
proxmox-io = { workspace = true, features = [ "tokio" ] }
proxmox-lang.workspace = true
proxmox-router = { workspace = true, features = [ "cli", "server" ] }
proxmox-schema.workspace = true
proxmox-sys.workspace = true

View File

@ -27,7 +27,6 @@ use pxar::{EntryKind, Metadata, PxarVariant};
use proxmox_human_byte::HumanByte;
use proxmox_io::vec;
use proxmox_lang::c_str;
use proxmox_sys::fs::{self, acl, xattr};
use pbs_datastore::catalog::BackupCatalogWriter;
@ -496,7 +495,7 @@ impl Archiver {
}
fn read_pxar_excludes(&mut self, parent: RawFd) -> Result<(), Error> {
let fd = match self.open_file(parent, c_str!(".pxarexclude"), OFlag::O_RDONLY, false)? {
let fd = match self.open_file(parent, c".pxarexclude", OFlag::O_RDONLY, false)? {
Some(fd) => fd,
None => return Ok(()),
};

View File

@ -56,13 +56,13 @@ impl DataBlob {
/// accessor to crc32 checksum
pub fn crc(&self) -> u32 {
let crc_o = proxmox_lang::offsetof!(DataBlobHeader, crc);
let crc_o = std::mem::offset_of!(DataBlobHeader, crc);
u32::from_le_bytes(self.raw_data[crc_o..crc_o + 4].try_into().unwrap())
}
// set the CRC checksum field
pub fn set_crc(&mut self, crc: u32) {
let crc_o = proxmox_lang::offsetof!(DataBlobHeader, crc);
let crc_o = std::mem::offset_of!(DataBlobHeader, crc);
self.raw_data[crc_o..crc_o + 4].copy_from_slice(&crc.to_le_bytes());
}

View File

@ -353,7 +353,7 @@ impl DynamicIndexWriter {
self.writer.flush()?;
let csum_offset = proxmox_lang::offsetof!(DynamicIndexHeader, index_csum);
let csum_offset = std::mem::offset_of!(DynamicIndexHeader, index_csum);
self.writer.seek(SeekFrom::Start(csum_offset as u64))?;
let csum = self.csum.take().unwrap();

View File

@ -349,7 +349,7 @@ impl FixedIndexWriter {
self.unmap()?;
let csum_offset = proxmox_lang::offsetof!(FixedIndexHeader, index_csum);
let csum_offset = std::mem::offset_of!(FixedIndexHeader, index_csum);
self.file.seek(SeekFrom::Start(csum_offset as u64))?;
self.file.write_all(&index_csum)?;
self.file.flush()?;

View File

@ -98,7 +98,7 @@ async fn get_status(
uname.machine(),
);
let disk = crate::tools::fs::fs_info_static(proxmox_lang::c_str!("/")).await?;
let disk = crate::tools::fs::fs_info_static(c"/").await?;
let boot_info = boot_mode_to_info(boot_mode::BootMode::query(), boot_mode::SecureBoot::query());