summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Wiederhake <twied@gmx.net>2023-12-30 20:49:48 +0100
committerTim Wiederhake <twied@gmx.net>2024-01-21 13:14:37 +0100
commit6e5c29e60d0acfeba32829f4aba7d6e7697ca8d1 (patch)
tree98add0e6fe503174831f1f9d9f2b0320276f9f5f
parent878117d8c70564983afddfb2bb26daa71f25b8c1 (diff)
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 <twied@gmx.net>
-rw-r--r--src/session.c20
-rw-r--r--src/twm.h2
2 files changed, 11 insertions, 11 deletions
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;