summaryrefslogtreecommitdiff
path: root/hook.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-09-09 20:05:27 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-09-09 20:05:27 -0700
commit9f0f4a2c5495eec2d81a4381fb962fad93b2ddde (patch)
tree7608fb1bc62b2df1c8bcb4f549a35607a37e905b /hook.c
parent40615f52b8fe7478599ce4948ccc751aa0a34397 (diff)
Copious const cleanup
Removes 1554 gcc warnings of "discards ‘const’ qualifier" Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'hook.c')
-rw-r--r--hook.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/hook.c b/hook.c
index 7dd6da0..105134c 100644
--- a/hook.c
+++ b/hook.c
@@ -1142,59 +1142,60 @@ print:
fail:
if (etype != T_NONE) {
+ const char *errptr;
switch (etype) {
case T_OPTION:
- ptr = "Option needs a command";
+ errptr = "Option needs a command";
break;
case T_ICASE:
- ptr = "Icase needs an command defined or none for search";
+ errptr = "Icase needs an command defined or none for search";
break;
case T_COMMAND:
- ptr = "Command incorrectly specified";
+ errptr = "Command incorrectly specified";
break;
case T_REPLACE:
- ptr = "Can only search backwards";
+ errptr = "Can only search backwards";
break;
case T_SEARCH:
- ptr = "Badly placed search/replace specifier";
+ errptr = "Badly placed search/replace specifier";
break;
case T_BACKSLASH:
- ptr = "A single backslash cannot be the last command character";
+ errptr = "A single backslash cannot be the last command character";
break;
case T_DIRECTION:
- ptr = "Regular expression must be separeted by / or ? not both";
+ errptr = "Regular expression must be separeted by / or ? not both";
break;
case T_COMMA:
- ptr = "Badly placed comma";
+ errptr = "Badly placed comma";
break;
case T_OFFSET:
- ptr = "Badly placed line offset specifier";
+ errptr = "Badly placed line offset specifier";
break;
case T_INCREMENT:
- ptr = "Badly placed line offset increment specifier";
+ errptr = "Badly placed line offset increment specifier";
break;
case T_NUMBER:
- ptr = "Numeric argument not expected";
+ errptr = "Numeric argument not expected";
break;
case T_UNFINISHED:
- ptr = "Unfinished command";
+ errptr = "Unfinished command";
break;
case T_RANGE:
- ptr = "Bad line range";
+ errptr = "Bad line range";
break;
case T_BACKREF:
/* This may be an internal re error, but most likely the
* user asked for something like "s/re0(re1)re2/\2/" */
- ptr = "Bad backreference";
+ errptr = "Bad backreference";
break;
case T_EDIT:
- ptr = "Failed to replace text";
+ errptr = "Failed to replace text";
break;
default:
- ptr = "Unknown error";
+ errptr = "Unknown error";
break;
}
- XeditPrintf("Error: %s.\n", ptr);
+ XeditPrintf("Error: %s.\n", errptr);
}
if (redisplay)
XawTextEnableRedisplay(w);