Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several compiler warnings #62

Merged
merged 29 commits into from
Oct 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
547ad2c
tokenparts: Rename attribute that is never read
chrysn Oct 13, 2023
78dc334
Fix unused variable warning in cfg dependent section
chrysn Oct 13, 2023
f3a34e8
tests: Fix unused import warning
chrysn Oct 13, 2023
da5b6d6
gnrc: Fix unused use warning
chrysn Oct 15, 2023
93a4c98
gcoap: Fix unused mut
chrysn Oct 15, 2023
80f4443
embedded-nal: Rename unused arguments to _ versions
chrysn Oct 15, 2023
b65a0d6
gcoap: Remove unused internal function
chrysn Oct 15, 2023
280bf42
tests/led: Simplify to fix warnings
chrysn Oct 13, 2023
a72a4ab
Fix unused imports
chrysn Oct 15, 2023
28758b1
Silence deprecation warning from pub-use
chrysn Oct 13, 2023
09520f0
Fix deprecated direct access
chrysn Oct 15, 2023
1bfe708
saul: Enum variants that were legacy shifted towards constants need n…
chrysn Oct 15, 2023
614ad9d
Fix several unused item / import / mut warnings
chrysn Oct 20, 2023
88ce347
Fix several warnings, largely around deprecations
chrysn Oct 20, 2023
d99c90b
treewide/doc: Various fixes
chrysn Oct 15, 2023
5bb8849
thread/doc: Add comment on ValueInThread not being Send any more
chrysn Oct 13, 2023
15e0b09
thread: Remove intermediate module layer from constants, fixing warnings
chrysn Oct 13, 2023
d6de3cb
gnrc_pktbuf: Improve debugging experience by showing the writability …
chrysn Oct 15, 2023
afe025c
panic: Refactor
chrysn Oct 13, 2023
6430de2
pktbuf: Fix double free
chrysn Oct 14, 2023
bb73bf8
saul: Don't abuse negative errors with positive values
chrysn Oct 15, 2023
f230e66
shell: Refactor to avoid lint complaining about dropping reference
chrysn Oct 15, 2023
8f42354
tests: Add gnrc-pktbuf
chrysn Oct 15, 2023
7ae33f1
Move gnrc::pktbuf to gnrc_pktbuf
chrysn Oct 15, 2023
13cb379
Documentation improvements
chrysn Oct 20, 2023
e818bc8
Refactorings, partially to address warnings
chrysn Oct 20, 2023
d7d024c
gnrc_pktbuf: Fix double free and add test to catch it
chrysn Oct 20, 2023
dfd7a89
tests/gnrc_pktbuf: Try switching between shared and writable
chrysn Oct 15, 2023
dfb034f
Cleanup and quality-of-life improvements
chrysn Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix unused variable warning in cfg dependent section
  • Loading branch information
chrysn committed Oct 20, 2023
commit 78dc3346046a8433ae016756a63120e1eecb14bc
21 changes: 12 additions & 9 deletions src/thread/riot_c.rs
Original file line number Diff line number Diff line change
@@ -172,16 +172,19 @@ impl KernelPID {
/// This is not backed by C functions (as most of the rest of this crate is), but rather a
/// practical way to access struct members that may or may not be present in a build.
pub fn stack_stats(&self) -> Result<StackStats, StackStatsError> {
let thread = self.thread()?;
#[cfg(riot_develhelp)]
return Ok(StackStats {
// This cast is relevant because different platforms (eg. native and arm) disagree on
// whether that's an i8 or u8 pointer. Could have made it c_char, but a) don't want to
// alter the signatures and b) it's easier to use on the Rust side with a clear type.
start: unsafe { (*thread).stack_start as _ },
size: unsafe { (*thread).stack_size as _ },
free: unsafe { riot_sys::thread_measure_stack_free((*thread).stack_start) } as usize,
});
{
let thread = self.thread()?;
return Ok(StackStats {
// This cast is relevant because different platforms (eg. native and arm) disagree on
// whether that's an i8 or u8 pointer. Could have made it c_char, but a) don't want to
// alter the signatures and b) it's easier to use on the Rust side with a clear type.
start: unsafe { (*thread).stack_start as _ },
size: unsafe { (*thread).stack_size as _ },
free: unsafe { riot_sys::thread_measure_stack_free((*thread).stack_start) }
as usize,
});
}
#[cfg(not(riot_develhelp))]
return Err(StackStatsError::InformationUnavailable);
}