From 6e5c29e60d0acfeba32829f4aba7d6e7697ca8d1 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Sat, 30 Dec 2023 20:49:48 +0100 Subject: Rename field 'class' to 'xclass' in TWMWinConfigEntry 'class' is a keyword in c++. Its usage confuses some tools that work with c and c++ source code. Signed-off-by: Tim Wiederhake --- src/session.c | 20 ++++++++++---------- src/twm.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/session.c b/src/session.c index f2b2a6b..1787d62 100644 --- a/src/session.c +++ b/src/session.c @@ -375,8 +375,8 @@ ReadWinConfigEntry(FILE *configFile, unsigned short version, entry->tag = 0; entry->client_id = NULL; entry->window_role = NULL; - entry->class.res_name = NULL; - entry->class.res_class = NULL; + entry->xclass.res_name = NULL; + entry->xclass.res_class = NULL; entry->wm_name = NULL; entry->wm_command = NULL; entry->wm_command_count = 0; @@ -388,9 +388,9 @@ ReadWinConfigEntry(FILE *configFile, unsigned short version, goto give_up; if (!entry->window_role) { - if (!read_counted_string(configFile, &entry->class.res_name)) + if (!read_counted_string(configFile, &entry->xclass.res_name)) goto give_up; - if (!read_counted_string(configFile, &entry->class.res_class)) + if (!read_counted_string(configFile, &entry->xclass.res_class)) goto give_up; if (!read_counted_string(configFile, &entry->wm_name)) goto give_up; @@ -460,10 +460,10 @@ ReadWinConfigEntry(FILE *configFile, unsigned short version, free(entry->client_id); if (entry->window_role) free(entry->window_role); - if (entry->class.res_name) - free(entry->class.res_name); - if (entry->class.res_class) - free(entry->class.res_class); + if (entry->xclass.res_name) + free(entry->xclass.res_name); + if (entry->xclass.res_class) + free(entry->xclass.res_class); if (entry->wm_name) free(entry->wm_name); if (entry->wm_command_count && entry->wm_command) { @@ -558,9 +558,9 @@ GetWindowConfig(TwmWindow *theWindow, */ if (strcmp(theWindow->class.res_name, - ptr->class.res_name) == 0 && + ptr->xclass.res_name) == 0 && strcmp(theWindow->class.res_class, - ptr->class.res_class) == 0 && + ptr->xclass.res_class) == 0 && (ptr->wm_name == NULL || strcmp(theWindow->name, ptr->wm_name) == 0)) { if (clientId) { diff --git a/src/twm.h b/src/twm.h index ed179aa..b360d35 100644 --- a/src/twm.h +++ b/src/twm.h @@ -303,7 +303,7 @@ typedef struct TWMWinConfigEntry { int tag; char *client_id; char *window_role; - XClassHint class; + XClassHint xclass; char *wm_name; int wm_command_count; char **wm_command; -- cgit v1.2.3