Skip to content

Commit

Permalink
fix: add copy to SymbolFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
oddlama committed Sep 8, 2024
1 parent df50719 commit 19d25a1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
38 changes: 30 additions & 8 deletions src/bin/autokernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,45 @@ fn info_symbol(args: &Args, bridge: &Bridge, action: &ActionInfo) -> Result<()>

match symbol.visibility_expression() {
Result::Ok(expr) => {
println!(" {}", "// This is technically called the visibility of the related menu entry for menuconfig,".dimmed());
println!(" {}", "// and determines the upper bound for the value that the symbol can have.".dimmed());
println!(" {}", "// It always expresses all dependencies of this symbol.".dimmed());
println!(
" {}",
"// This is technically called the visibility of the related menu entry for menuconfig,".dimmed()
);
println!(
" {}",
"// and determines the upper bound for the value that the symbol can have.".dimmed()
);
println!(
" {}",
"// It always expresses all dependencies of this symbol.".dimmed()
);
println!(" Dependencies: {}", expr.display(bridge));
println!(" => upper bound: {}", expr.eval().map_or("could not evaluate".to_string().red(), |v| v.to_string().color(v.color())));
},
println!(
" => upper bound: {}",
expr.eval().map_or("could not evaluate".to_string().red(), |v| v
.to_string()
.color(v.color()))
);
}
Err(e) => println!(" Dependencies could not be parsed: {}", e),
}

match symbol.reverse_dependencies() {
Result::Ok(expr) => {
println!(" {}", "// The reverse dependencies determine the lower bound for the value a symbol can have.".dimmed());
println!(
" {}",
"// The reverse dependencies determine the lower bound for the value a symbol can have.".dimmed()
);
println!(" {}", "// If another symbol requires this to be at least 'm' (1), then setting it to 'y' (2) is also allowed,".dimmed());
println!(" {}", "// but 'n' (0) is not.".dimmed());
println!(" Reverse dependencies: {}", expr.display(bridge));
println!(" => lower bound: {}", expr.eval().map_or("could not evaluate".to_string().red(), |v| v.to_string().color(v.color())));
},
println!(
" => lower bound: {}",
expr.eval().map_or("could not evaluate".to_string().red(), |v| v
.to_string()
.color(v.color()))
);
}
Err(e) => println!(" Reverse dependencies could not be parsed: {}", e),
}

Expand Down
1 change: 1 addition & 0 deletions src/bridge/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ use bitflags::bitflags;

bitflags! {
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SymbolFlags: u32 {
// WARNING might change in kernel and while unlikely should be checked
const CONST = 0x0001;
Expand Down

0 comments on commit 19d25a1

Please sign in to comment.