mirror of
https://github.com/swaywm/sway.git
synced 2026-04-25 06:46:24 -04:00
sway/commands: Use "!ptr" for comparison to NULL
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
This commit is contained in:
parent
c66fb38bf8
commit
dc84d9b8e8
4 changed files with 5 additions and 5 deletions
|
|
@ -180,7 +180,7 @@ static void set_config_node(struct sway_node *node, bool node_overridden) {
|
||||||
config->handler_context.workspace = NULL;
|
config->handler_context.workspace = NULL;
|
||||||
config->handler_context.node_overridden = node_overridden;
|
config->handler_context.node_overridden = node_overridden;
|
||||||
|
|
||||||
if (node == NULL) {
|
if (!node) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,7 +205,7 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
||||||
list_t *containers = NULL;
|
list_t *containers = NULL;
|
||||||
bool using_criteria = false;
|
bool using_criteria = false;
|
||||||
|
|
||||||
if (seat == NULL) {
|
if (!seat) {
|
||||||
// passing a NULL seat means we just pick the default seat
|
// passing a NULL seat means we just pick the default seat
|
||||||
seat = input_manager_get_default_seat();
|
seat = input_manager_get_default_seat();
|
||||||
if (!sway_assert(seat, "could not find a seat to run the command on")) {
|
if (!sway_assert(seat, "could not find a seat to run the command on")) {
|
||||||
|
|
|
||||||
|
|
@ -516,7 +516,7 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth,
|
||||||
destination = seat_get_focus_inactive(seat, &new_output->node);
|
destination = seat_get_focus_inactive(seat, &new_output->node);
|
||||||
} else if (strcasecmp(argv[0], "mark") == 0) {
|
} else if (strcasecmp(argv[0], "mark") == 0) {
|
||||||
struct sway_container *dest_con = container_find_mark(argv[1]);
|
struct sway_container *dest_con = container_find_mark(argv[1]);
|
||||||
if (dest_con == NULL) {
|
if (!dest_con) {
|
||||||
return cmd_results_new(CMD_FAILURE,
|
return cmd_results_new(CMD_FAILURE,
|
||||||
"Mark '%s' not found", argv[1]);
|
"Mark '%s' not found", argv[1]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ struct cmd_results *cmd_opacity(int argc, char **argv) {
|
||||||
|
|
||||||
struct sway_container *con = config->handler_context.container;
|
struct sway_container *con = config->handler_context.container;
|
||||||
|
|
||||||
if (con == NULL) {
|
if (!con) {
|
||||||
return cmd_results_new(CMD_FAILURE, "No current container");
|
return cmd_results_new(CMD_FAILURE, "No current container");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ struct cmd_results *output_cmd_transform(int argc, char **argv) {
|
||||||
"Cannot apply relative transform to all outputs.");
|
"Cannot apply relative transform to all outputs.");
|
||||||
}
|
}
|
||||||
struct sway_output *s_output = output_by_name_or_id(output->name);
|
struct sway_output *s_output = output_by_name_or_id(output->name);
|
||||||
if (s_output == NULL) {
|
if (!s_output) {
|
||||||
return cmd_results_new(CMD_INVALID,
|
return cmd_results_new(CMD_INVALID,
|
||||||
"Cannot apply relative transform to unknown output %s", output->name);
|
"Cannot apply relative transform to unknown output %s", output->name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue