summaryrefslogtreecommitdiff
path: root/src
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 05:19:40 -0400
commita4659e5c49119bb3114ad18efffd945ec7bd5ba0 (patch)
tree6c3dc04fcb47a2723aed6e3ac06fb8fbe34417f0 /src
parent99bad1baa20fafb47aa07925b3960b003aa160df (diff)
fix const-warnings in grammar using a non-const initializer
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src')
-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;
}