diff --git a/sway/commands.c b/sway/commands.c index b09a04c71..985c4577e 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -180,7 +180,7 @@ static void set_config_node(struct sway_node *node, bool node_overridden) { config->handler_context.workspace = NULL; config->handler_context.node_overridden = node_overridden; - if (node == NULL) { + if (!node) { return; } @@ -205,7 +205,7 @@ list_t *execute_command(char *_exec, struct sway_seat *seat, list_t *containers = NULL; bool using_criteria = false; - if (seat == NULL) { + if (!seat) { // passing a NULL seat means we just pick the default seat seat = input_manager_get_default_seat(); if (!sway_assert(seat, "could not find a seat to run the command on")) { diff --git a/sway/commands/move.c b/sway/commands/move.c index f2702fa17..736fd6a20 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -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); } else if (strcasecmp(argv[0], "mark") == 0) { struct sway_container *dest_con = container_find_mark(argv[1]); - if (dest_con == NULL) { + if (!dest_con) { return cmd_results_new(CMD_FAILURE, "Mark '%s' not found", argv[1]); } diff --git a/sway/commands/opacity.c b/sway/commands/opacity.c index 96e6228ed..b560e7e0b 100644 --- a/sway/commands/opacity.c +++ b/sway/commands/opacity.c @@ -13,7 +13,7 @@ struct cmd_results *cmd_opacity(int argc, char **argv) { struct sway_container *con = config->handler_context.container; - if (con == NULL) { + if (!con) { return cmd_results_new(CMD_FAILURE, "No current container"); } diff --git a/sway/commands/output/transform.c b/sway/commands/output/transform.c index f4fcc8c99..1fc311f91 100644 --- a/sway/commands/output/transform.c +++ b/sway/commands/output/transform.c @@ -71,7 +71,7 @@ struct cmd_results *output_cmd_transform(int argc, char **argv) { "Cannot apply relative transform to all outputs."); } 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, "Cannot apply relative transform to unknown output %s", output->name); }