shell_ops: simplify flag_xxx_get functions

Removed obsolete assignments to bool values.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
This commit is contained in:
Jakub Rzeszutko 2020-08-18 12:21:55 +02:00 committed by Anas Nashif
commit a78ee2194a

View file

@ -68,7 +68,7 @@ static inline void shell_putc(const struct shell *shell, char ch)
static inline bool flag_insert_mode_get(const struct shell *shell)
{
return ((shell->ctx->internal.flags.insert_mode == 1) ? true : false);
return shell->ctx->internal.flags.insert_mode == 1;
}
static inline void flag_insert_mode_set(const struct shell *shell, bool val)
@ -78,7 +78,7 @@ static inline void flag_insert_mode_set(const struct shell *shell, bool val)
static inline bool flag_use_colors_get(const struct shell *shell)
{
return shell->ctx->internal.flags.use_colors == 1 ? true : false;
return shell->ctx->internal.flags.use_colors == 1;
}
static inline void flag_use_colors_set(const struct shell *shell, bool val)
@ -88,7 +88,7 @@ static inline void flag_use_colors_set(const struct shell *shell, bool val)
static inline bool flag_echo_get(const struct shell *shell)
{
return shell->ctx->internal.flags.echo == 1 ? true : false;
return shell->ctx->internal.flags.echo == 1;
}
static inline void flag_echo_set(const struct shell *shell, bool val)
@ -98,12 +98,12 @@ static inline void flag_echo_set(const struct shell *shell, bool val)
static inline bool flag_processing_get(const struct shell *shell)
{
return shell->ctx->internal.flags.processing == 1 ? true : false;
return shell->ctx->internal.flags.processing == 1;
}
static inline bool flag_tx_rdy_get(const struct shell *shell)
{
return shell->ctx->internal.flags.tx_rdy == 1 ? true : false;
return shell->ctx->internal.flags.tx_rdy == 1;
}
static inline void flag_tx_rdy_set(const struct shell *shell, bool val)
@ -113,7 +113,7 @@ static inline void flag_tx_rdy_set(const struct shell *shell, bool val)
static inline bool flag_mode_delete_get(const struct shell *shell)
{
return shell->ctx->internal.flags.mode_delete == 1 ? true : false;
return shell->ctx->internal.flags.mode_delete == 1;
}
static inline void flag_mode_delete_set(const struct shell *shell, bool val)
@ -123,7 +123,7 @@ static inline void flag_mode_delete_set(const struct shell *shell, bool val)
static inline bool flag_history_exit_get(const struct shell *shell)
{
return shell->ctx->internal.flags.history_exit == 1 ? true : false;
return shell->ctx->internal.flags.history_exit == 1;
}
static inline void flag_history_exit_set(const struct shell *shell, bool val)
@ -133,7 +133,7 @@ static inline void flag_history_exit_set(const struct shell *shell, bool val)
static inline bool flag_cmd_ctx_get(const struct shell *shell)
{
return shell->ctx->internal.flags.cmd_ctx == 1 ? true : false;
return shell->ctx->internal.flags.cmd_ctx == 1;
}
static inline void flag_cmd_ctx_set(const struct shell *shell, bool val)
@ -153,7 +153,7 @@ static inline void flag_last_nl_set(const struct shell *shell, uint8_t val)
static inline bool flag_print_noinit_get(const struct shell *shell)
{
return shell->ctx->internal.flags.print_noinit == 1 ? true : false;
return shell->ctx->internal.flags.print_noinit == 1;
}
static inline void flag_print_noinit_set(const struct shell *shell, bool val)