diff options
author | Matthieu Herrb <matthieu@herrb.eu> | 2024-05-05 10:59:11 +0200 |
---|---|---|
committer | Matthieu Herrb <matthieu@herrb.eu> | 2024-05-05 10:59:11 +0200 |
commit | ed85f3d22352c8e469ed1e386af3926b4d63efcd (patch) | |
tree | 2162ff552f17fdd9f6c6eba479fa1f2498f99d19 /src/list.c | |
parent | 1e866201f1ccf8fa3bb22c6f5fa723b26c86dbe1 (diff) | |
parent | 79b0987e63daff97ce9ee1dce883df13668a80c6 (diff) |
Merge remote-tracking branch 'origin/master' into obsd
Diffstat (limited to 'src/list.c')
-rw-r--r-- | src/list.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -61,7 +61,7 @@ in this Software without prior written authorization from The Open Group. #include <stdio.h> #include "twm.h" #include "screen.h" -#include "gram.h" +#include "parse.h" #include "util.h" struct name_list_struct { @@ -90,7 +90,7 @@ AddToList(name_list ** list_head, char *name, char *ptr) if (!list_head) return; /* ignore empty inserts */ - nptr = malloc(sizeof(name_list)); + nptr = (name_list *) malloc(sizeof(name_list)); if (nptr == NULL) { parseWarning("unable to allocate %lu bytes for name_list", (unsigned long) sizeof(name_list)); @@ -111,10 +111,10 @@ AddToList(name_list ** list_head, char *name, char *ptr) * * \param list a pointer to the head of a list * \param name a pointer to the name to look for - * \param class a pointer to the class to look for + * \param xclass a pointer to the class to look for */ char * -LookInList(name_list * list_head, const char *name, XClassHint *class) +LookInList(name_list * list_head, const char *name, XClassHint *xclass) { name_list *nptr; @@ -123,15 +123,15 @@ LookInList(name_list * list_head, const char *name, XClassHint *class) if (strcmp(name, nptr->name) == 0) return (nptr->ptr); - if (class) { + if (xclass) { /* look for the res_name next */ for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_name, nptr->name) == 0) + if (strcmp(xclass->res_name, nptr->name) == 0) return (nptr->ptr); /* finally look for the res_class */ for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_class, nptr->name) == 0) + if (strcmp(xclass->res_class, nptr->name) == 0) return (nptr->ptr); } return (NULL); @@ -151,11 +151,11 @@ LookInNameList(name_list * list_head, const char *name) * * \param list a pointer to the head of a list * \param name a pointer to the name to look for - * \param class a pointer to the class to look for + * \param xclass a pointer to the class to look for * \param[out] ptr fill in the list value if the name was found */ int -GetColorFromList(name_list * list_head, const char *name, XClassHint *class, +GetColorFromList(name_list * list_head, const char *name, XClassHint *xclass, Pixel *ptr) { int save; @@ -170,9 +170,9 @@ GetColorFromList(name_list * list_head, const char *name, XClassHint *class, return (TRUE); } - if (class) { + if (xclass) { for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_name, nptr->name) == 0) { + if (strcmp(xclass->res_name, nptr->name) == 0) { save = Scr->FirstTime; Scr->FirstTime = TRUE; GetColor(Scr->Monochrome, ptr, nptr->ptr); @@ -181,7 +181,7 @@ GetColorFromList(name_list * list_head, const char *name, XClassHint *class, } for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_class, nptr->name) == 0) { + if (strcmp(xclass->res_class, nptr->name) == 0) { save = Scr->FirstTime; Scr->FirstTime = TRUE; GetColor(Scr->Monochrome, ptr, nptr->ptr); |