Skip to content

Commit

Permalink
update percpu and allocator, revert changes in strftime
Browse files Browse the repository at this point in the history
  • Loading branch information
aarkegz committed Dec 23, 2024
1 parent 1238464 commit a5b1849
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/axalloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ cfg-if = "1.0"
kspin = "0.1"
memory_addr = "0.3"
axerrno = "0.1"
allocator = { git = "https://github.com/arceos-org/allocator.git", tag ="v0.1.0", features = ["bitmap"] }
allocator = { git = "https://github.com/arceos-org/allocator.git", tag ="v0.1.1", features = ["bitmap"] }
2 changes: 1 addition & 1 deletion modules/axdma/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ log = "=0.4.21"
kspin = "0.1"
memory_addr = "0.3"
axerrno = "0.1"
allocator = { git = "https://github.com/arceos-org/allocator.git", tag = "v0.1.0" }
allocator = { git = "https://github.com/arceos-org/allocator.git", tag = "v0.1.1" }
axalloc = { workspace = true }
axmm = { workspace = true }
axconfig = { workspace = true }
Expand Down
17 changes: 5 additions & 12 deletions ulib/axlibc/src/strftime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,12 @@ impl<T: Write> Write for CountingWriter<T> {
}
}

#[inline]
fn c_char_as_u8(c: c_char) -> u8 {
#[allow(clippy::unnecessary_cast)]
{
c as u8
}
}

unsafe fn strftime_inner<W: WriteByte>(
w: W,
format: *const c_char,
t: *const ctypes::tm,
) -> ctypes::size_t {
#[allow(clippy::unnecessary_cast)]
pub unsafe fn inner_strftime<W: WriteByte>(
w: &mut W,
mut format: *const c_char,
Expand Down Expand Up @@ -172,20 +165,20 @@ unsafe fn strftime_inner<W: WriteByte>(
];

while *format != 0 {
if c_char_as_u8(*format) != b'%' {
w!(byte c_char_as_u8(*format));
if *format as u8 != b'%' {
w!(byte *format as u8);
format = format.offset(1);
continue;
}

format = format.offset(1);

if c_char_as_u8(*format) == b'E' || c_char_as_u8(*format) == b'O' {
if *format as u8 == b'E' || *format as u8 == b'O' {
// Ignore because these do nothing without locale
format = format.offset(1);
}

match c_char_as_u8(*format) {
match *format as u8 {
b'%' => w!(byte b'%'),
b'n' => w!(byte b'\n'),
b't' => w!(byte b'\t'),
Expand Down

0 comments on commit a5b1849

Please sign in to comment.