remove unused variables and functions

This commit is contained in:
Akos Horvath 2023-09-17 15:36:28 +02:00
parent ee88d8a600
commit 0b878dd9d7
7 changed files with 3 additions and 37 deletions

View File

@ -59,7 +59,6 @@ ret:
Client* wm_client_create(Wm *wm, Window w)
{
DEBUG_PRINT("%s\n", __func__);
Client *t;
XTextProperty xtp;
int strln;
@ -385,8 +384,6 @@ ret:
Client* wm_client_get_focused(Wm *wm)
{
Client *c = NULL;
Workspace *ws = &wm->smon->workspaces[wm->smon->selws];
TreeNode *node = wm_treenode_ptr_find_focused_client_node(ws->tree);

View File

@ -121,7 +121,6 @@ void wm_configfile_init(ConfigFile *config, const char *filename)
assert(filename);
strncpy(config->file_path, filename, PATH_MAX);
const size_t size = CONFIG_ARGC_MAX*CONFIG_ARGLEN_MAX;
ConfigCommand commands[] = {
(ConfigCommand) {.string = "border_color", .arg_count = 1,
@ -176,7 +175,6 @@ void wm_configfile_read(ConfigFile *cfile, Config *config)
const int max_line_len = 8192;
char line[max_line_len];
char argv[CONFIG_ARGC_MAX][CONFIG_ARGLEN_MAX];
size_t line_index = 0;
ConfigCommand command = {0};
wm_configcommand_init(&command);
@ -201,8 +199,6 @@ void wm_configfile_read(ConfigFile *cfile, Config *config)
void wm_config_apply_command(Config *config, ConfigCommand *command)
{
void *arg = NULL;
switch (command->arg_type) {
case TYPE_INTEGER:
for (size_t i = 0; i < command->argc; i++) {

View File

@ -21,28 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "wm.h"
#include "client.h"
static int wm_xerror_handler(Wm *wm, Display *display, XErrorEvent *e)
{
printf("wm: Error occured. id: %d req_code: %d\n",
e->error_code, e->request_code);
char etext[200];
XGetErrorText(wm->display, e->error_code, etext, 200);
printf("%s\n", etext);
if (e->error_code == BadAccess) {
wm->other_wm = true;
}
return 0;
}
static int wm_other_wm_handler(Display *display, XErrorEvent *e)
{
return 0;
}
void wm_create_handler(Wm *wm, XCreateWindowEvent e)
{
DEBUG_PRINT("CreateNotify event\n");
@ -73,7 +51,6 @@ void wm_keyrelease_handler(XKeyReleasedEvent e)
void wm_keypress_handler(Wm *wm, XKeyPressedEvent e)
{
DEBUG_PRINT("KeyPressed event, code: %d\n", e.keycode)
Client *c;
Keybind k;
DEBUG_PRINT("wm->config.kb_count: %d\n", wm->config.kb_count);
@ -144,8 +121,7 @@ void wm_configure_handler(Wm *wm, XConfigureRequestEvent e)
{
DEBUG_PRINT("ConfigureRequest event\n");
Client *c;
XWindowChanges wc;
XWindowChanges wc;
wc.x = e.x;
wc.y = e.y;

View File

@ -30,8 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/Xatom.h>
#include "wm.h"
static int wm_xerror_handler(Wm *wm, Display *display, XErrorEvent *e);
static int wm_other_wm_handler(Display *display, XErrorEvent *e);
void wm_create_handler(Wm *wm, XCreateWindowEvent e);
void wm_destroy_handler(Wm *wm, XDestroyWindowEvent e);
void wm_reparent_handler(XReparentEvent e);

View File

@ -5,6 +5,8 @@
#include <string.h>
#include <assert.h>
static unsigned int node_id = 0;
TreeNode* wm_treenode_new(NodeType type, TreeNode *parent)
{
DEBUG_PRINT("%s\n", __func__);

View File

@ -12,8 +12,6 @@
#define WM_HORIZ_TOP 0
#define WM_HORIZ_BOT 1
static unsigned int node_id = 0;
typedef enum NodeType {
NODE_VERTICAL,
NODE_HORIZONTAL,

View File

@ -629,7 +629,6 @@ void wm_settings_message_parse(Wm *wm, char *c, int len)
int op; /* 0 = set, 1 = get */
size_t i = 0;
char ret[50];
char *token;
char tokens[20][50];
char *settings[] = {"border-width", "border-color", "focused-border-color",