summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-07-16 04:40:55 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-07-16 04:40:55 -0400
commit87281920e1d15d4dc5c50f79750ab9ff173c0e8d (patch)
tree78b10838ff065c285645b97ba2c9e1a131f4e63f
parent58ec53e44bb2b00bc104324a0f32e19dcab2ad34 (diff)
fix const-warnings in grammar using a non-const initializer
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r--src/gram.y25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gram.y b/src/gram.y
index d9fe680..d55ae91 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -78,8 +78,9 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xos.h>
#include <X11/Xmu/CharSet.h>
-static char *Action = "";
-static char *Name = "";
+static char empty[1];
+static char *Action = empty;
+static char *Name = empty;
static MenuRoot *root, *pull = NULL;
static MenuRoot *GetRoot ( const char *name, const char *fore, const char *back );
@@ -193,7 +194,7 @@ stmt : error
AddToMenu(root,"x",Action,
NULL,$2,NULLSTR,NULLSTR);
}
- Action = "";
+ Action = empty;
pull = NULL;
}
| string fullkey { GotKey($1, $2); }
@@ -259,7 +260,7 @@ stmt : error
AddToMenu(root,"x",Action,
NULL,$2, NULLSTR, NULLSTR);
}
- Action = "";
+ Action = empty;
pull = NULL;
}
| WINDOW_FUNCTION action { Scr->WindowFunction.func = $2;
@@ -267,7 +268,7 @@ stmt : error
Scr->WindowFunction.item =
AddToMenu(root,"x",Action,
NULL,$2, NULLSTR, NULLSTR);
- Action = "";
+ Action = empty;
pull = NULL;
}
| WARP_CURSOR { list = &Scr->WarpCursorL; }
@@ -567,9 +568,9 @@ function_entries: /* Empty */
| function_entries function_entry
;
-function_entry : action { AddToMenu(root, "", Action, NULL, $1,
+function_entry : action { AddToMenu(root, empty, Action, NULL, $1,
NULLSTR, NULLSTR);
- Action = "";
+ Action = empty;
}
;
@@ -582,13 +583,13 @@ menu_entries : /* Empty */
menu_entry : string action { AddToMenu(root, $1, Action, pull, $2,
NULLSTR, NULLSTR);
- Action = "";
+ Action = empty;
pull = NULL;
}
| string LP string COLON string RP action {
AddToMenu(root, $1, Action, pull, $7,
$3, $5);
- Action = "";
+ Action = empty;
pull = NULL;
}
;
@@ -797,7 +798,7 @@ static void GotButton(int butt, int func)
NULL, func, NULLSTR, NULLSTR);
}
}
- Action = "";
+ Action = empty;
pull = NULL;
cont = 0;
mods_used |= (unsigned)mods;
@@ -816,7 +817,7 @@ static void GotKey(char *key, int func)
break;
}
- Action = "";
+ Action = empty;
pull = NULL;
cont = 0;
mods_used |= (unsigned)mods;
@@ -832,7 +833,7 @@ static void GotTitleButton (char *bitmapname, int func, Bool rightside)
"unable to create %s titlebutton \"%s\"\n",
rightside ? "right" : "left", bitmapname);
}
- Action = "";
+ Action = empty;
pull = NULL;
}