From 593c6b19349538ec3b89bc48eb3f0bb4c0cebb23 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 2 Oct 2014 15:35:54 +0100 Subject: [PATCH] hw/xwin: Fix const warnings in winprefsyacc.y MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winprefsyacc.y:174:5: warning: passing argument 1 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:174:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:175:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:178:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.c:1737:9: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:82:12: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.c:1854:3: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winprefsyacc.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y index 683fc44ca..92f222d4f 100644 --- a/hw/xwin/winprefsyacc.y +++ b/hw/xwin/winprefsyacc.y @@ -64,7 +64,7 @@ static void SetDefaultSysMenu (char *menu, int pos); static void SetTrayIcon (char *fname); static void OpenMenu(char *menuname); -static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param); +static void AddMenuLine(const char *name, MENUCOMMANDTYPE cmd, const char *param); static void CloseMenu(void); static void OpenIcons(void); @@ -79,7 +79,7 @@ static void OpenSysMenu(void); static void AddSysMenuLine(char *matchstr, char *menuname, int pos); static void CloseSysMenu(void); -static int yyerror (char *s); +static int yyerror (const char *s); extern char *yytext; extern int yylex(void); @@ -252,7 +252,7 @@ debug: DEBUGOUTPUT STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($ * Errors in parsing abort and print log messages */ static int -yyerror (char *s) +yyerror (const char *s) { extern int yylineno; /* Handled by flex internally */ @@ -308,7 +308,7 @@ OpenMenu (char *menuname) } static void -AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param) +AddMenuLine (const char *text, MENUCOMMANDTYPE cmd, const char *param) { if (menu.menuItem==NULL) menu.menuItem = malloc(sizeof(MENUITEM));