* commands.c: all command functions (see commands_parser.c)
*
*/
+#include <stdint.h>
#include <float.h>
#include <stdarg.h>
} \
} while (0)
-/** If an error occured during parsing of the criteria, we want to exit instead
+/** If an error occurred during parsing of the criteria, we want to exit instead
* of relying on fallback behavior. See #2091. */
#define HANDLE_INVALID_MATCH \
do { \
return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
-/*
- * Returns the output containing the given container.
- */
-static Output *get_output_of_con(Con *con) {
- Con *output_con = con_get_output(con);
- Output *output = get_output_by_name(output_con->name);
- assert(output != NULL);
-
- return output;
-}
-
/*
* Checks whether we switched to a new workspace and returns false in that case,
* signaling that further workspace switching should be done by the calling function
TAILQ_FOREACH(current, &owindows, owindows) {
DLOG("matching: %p / %s\n", current->con, current->con->name);
- Output *current_output = get_output_of_con(current->con);
+ Output *current_output = get_output_for_con(current->con);
assert(current_output != NULL);
Output *output = get_output_from_string(current_output, name);
ystr("success");
y(bool, true);
ystr("id");
- y(integer, (long int)con);
+ y(integer, (uintptr_t)con);
y(map_close);
cmd_output->needs_tree_render = true;
Output *output;
TAILQ_FOREACH(current, &owindows, owindows)
- current_output = get_output_of_con(current->con);
+ current_output = get_output_for_con(current->con);
assert(current_output != NULL);
output = get_output_from_string(current_output, name);
GREP_FIRST(check_dest, output_get_content(output),
!strcasecmp(child->name, new_name));
- if (check_dest != NULL) {
+ /* If check_dest == workspace, the user might be changing the case of the
+ * workspace, or it might just be a no-op. */
+ if (check_dest != NULL && check_dest != workspace) {
yerror("New workspace \"%s\" already exists", new_name);
return;
}