From 55a26c49c8a976abb0ead8bd58da6260de61b739 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 31 May 2019 12:43:04 -0700 Subject: Make some char pointers const as necessary to clear some gcc warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit twm.c:544:20: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Scr->iconmgr.name = "TWM"; ^ twm.c:545:25: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Scr->iconmgr.icon_name = "Icons"; Signed-off-by: Alan Coopersmith --- src/iconmgr.c | 2 +- src/iconmgr.h | 6 +++--- src/list.c | 6 +++--- src/list.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/iconmgr.c b/src/iconmgr.c index d9c4e76..ca7b307 100644 --- a/src/iconmgr.c +++ b/src/iconmgr.c @@ -61,7 +61,7 @@ CreateIconManagers(void) char str[100]; char str1[100]; Pixel background; - char *icon_name; + const char *icon_name; if (Scr->NoIconManagers) return; diff --git a/src/iconmgr.h b/src/iconmgr.h index 8d7c66f..6157fa3 100644 --- a/src/iconmgr.h +++ b/src/iconmgr.h @@ -62,9 +62,9 @@ typedef struct IconMgr TwmWindow *twm_win; /* back pointer to the new parent */ struct ScreenInfo *scr; /* the screen this thing is on */ Window w; /* this icon manager window */ - char *geometry; /* geometry string */ - char *name; - char *icon_name; + const char *geometry; /* geometry string */ + const char *name; + const char *icon_name; int x, y, width, height; int columns, cur_rows, cur_columns; int count; diff --git a/src/list.c b/src/list.c index b43cd59..3550716 100644 --- a/src/list.c +++ b/src/list.c @@ -117,7 +117,7 @@ AddToList(name_list **list_head, char *name, char *ptr) * \param class a pointer to the class to look for */ char * -LookInList(name_list *list_head, char *name, XClassHint *class) +LookInList(name_list *list_head, const char *name, XClassHint *class) { name_list *nptr; @@ -142,7 +142,7 @@ LookInList(name_list *list_head, char *name, XClassHint *class) } char * -LookInNameList(name_list *list_head, char *name) +LookInNameList(name_list *list_head, const char *name) { return (LookInList(list_head, name, NULL)); } @@ -158,7 +158,7 @@ LookInNameList(name_list *list_head, char *name) * \param class 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, char *name, XClassHint *class, +int GetColorFromList(name_list *list_head, const char *name, XClassHint *class, Pixel *ptr) { int save; diff --git a/src/list.h b/src/list.h index ec77dfe..bb6fbc8 100644 --- a/src/list.h +++ b/src/list.h @@ -70,11 +70,11 @@ typedef struct name_list_struct name_list; extern void AddToList ( name_list **list_head, char *name, char *ptr ); extern void FreeList ( name_list **list ); -extern int GetColorFromList ( name_list *list_head, char *name, +extern int GetColorFromList ( name_list *list_head, const char *name, XClassHint *class, Pixel *ptr ); -extern char * LookInList ( name_list *list_head, char *name, +extern char * LookInList ( name_list *list_head, const char *name, XClassHint *class ); -extern char * LookInNameList ( name_list *list_head, char *name ); +extern char * LookInNameList ( name_list *list_head, const char *name ); #endif /* _LIST_ */ -- cgit v1.2.3