mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
Kernel: Resolve clang-tidy readability-implicit-bool-conversion warnings
... In files included from Kernel/Process.cpp and Kernel/Thread.cpp
This commit is contained in:
committed by
Andreas Kling
parent
6f580f2047
commit
a92132e44a
Notes:
sideshowbarker
2024-07-18 01:07:25 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/a92132e44a6 Pull-request: https://github.com/SerenityOS/serenity/pull/10737 Reviewed-by: https://github.com/BenWiederhake Reviewed-by: https://github.com/PeterBindels-TomTom Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/dascandy Reviewed-by: https://github.com/trflynn89
@@ -30,9 +30,9 @@ inline bool is_regular_file(mode_t mode) { return (mode & S_IFMT) == S_IFREG; }
|
||||
inline bool is_fifo(mode_t mode) { return (mode & S_IFMT) == S_IFIFO; }
|
||||
inline bool is_symlink(mode_t mode) { return (mode & S_IFMT) == S_IFLNK; }
|
||||
inline bool is_socket(mode_t mode) { return (mode & S_IFMT) == S_IFSOCK; }
|
||||
inline bool is_sticky(mode_t mode) { return mode & S_ISVTX; }
|
||||
inline bool is_setuid(mode_t mode) { return mode & S_ISUID; }
|
||||
inline bool is_setgid(mode_t mode) { return mode & S_ISGID; }
|
||||
inline bool is_sticky(mode_t mode) { return (mode & S_ISVTX) == S_ISVTX; }
|
||||
inline bool is_setuid(mode_t mode) { return (mode & S_ISUID) == S_ISUID; }
|
||||
inline bool is_setgid(mode_t mode) { return (mode & S_ISGID) == S_ISGID; }
|
||||
|
||||
struct InodeMetadata {
|
||||
bool is_valid() const { return inode.is_valid(); }
|
||||
@@ -46,10 +46,10 @@ struct InodeMetadata {
|
||||
if (u == 0)
|
||||
return true;
|
||||
if (uid == u)
|
||||
return mode & S_IRUSR;
|
||||
return (mode & S_IRUSR) == S_IRUSR;
|
||||
if (gid == g || eg.contains_slow(gid))
|
||||
return mode & S_IRGRP;
|
||||
return mode & S_IROTH;
|
||||
return (mode & S_IRGRP) == S_IRGRP;
|
||||
return (mode & S_IROTH) == S_IROTH;
|
||||
}
|
||||
|
||||
bool may_write(UserID u, GroupID g, Span<GroupID const> eg) const
|
||||
@@ -57,10 +57,10 @@ struct InodeMetadata {
|
||||
if (u == 0)
|
||||
return true;
|
||||
if (uid == u)
|
||||
return mode & S_IWUSR;
|
||||
return (mode & S_IWUSR) == S_IWUSR;
|
||||
if (gid == g || eg.contains_slow(gid))
|
||||
return mode & S_IWGRP;
|
||||
return mode & S_IWOTH;
|
||||
return (mode & S_IWGRP) == S_IWGRP;
|
||||
return (mode & S_IWOTH) == S_IWOTH;
|
||||
}
|
||||
|
||||
bool may_execute(UserID u, GroupID g, Span<GroupID const> eg) const
|
||||
@@ -68,10 +68,10 @@ struct InodeMetadata {
|
||||
if (u == 0)
|
||||
return true;
|
||||
if (uid == u)
|
||||
return mode & S_IXUSR;
|
||||
return (mode & S_IXUSR) == S_IXUSR;
|
||||
if (gid == g || eg.contains_slow(gid))
|
||||
return mode & S_IXGRP;
|
||||
return mode & S_IXOTH;
|
||||
return (mode & S_IXGRP) == S_IXGRP;
|
||||
return (mode & S_IXOTH) == S_IXOTH;
|
||||
}
|
||||
|
||||
bool is_directory() const { return Kernel::is_directory(mode); }
|
||||
|
||||
Reference in New Issue
Block a user