git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 88a6ac9)
psql: Reduce the amount of const lies a bit
2012年1月31日 19:23:17 +0000 (21:23 +0200)
2012年1月31日 19:23:17 +0000 (21:23 +0200)

diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 6efc0ce0c0f78558b5ef3a1bd0c821e36399c96d..b0b318f426fb0db576e1264ec5e354522d89a965 100644 (file)
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3364,13 +3364,13 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
{
char **matches;
int overhead = strlen(prefix) + strlen(suffix) + 1;
- const char **varnames;
+ char **varnames;
int nvars = 0;
int maxvars = 100;
int i;
struct _variable *ptr;
- varnames = (const char **) pg_malloc((maxvars + 1) * sizeof(char *));
+ varnames = (char **) pg_malloc((maxvars + 1) * sizeof(char *));
for (ptr = pset.vars->next; ptr; ptr = ptr->next)
{
@@ -3379,8 +3379,8 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
if (nvars >= maxvars)
{
maxvars *= 2;
- varnames = (const char **) realloc(varnames,
- (maxvars + 1) * sizeof(char *));
+ varnames = (char **) realloc(varnames,
+ (maxvars + 1) * sizeof(char *));
if (!varnames)
{
psql_error("out of memory\n");
@@ -3394,10 +3394,10 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
}
varnames[nvars] = NULL;
- COMPLETE_WITH_LIST(varnames);
+ COMPLETE_WITH_LIST((const char * const *) varnames);
for (i = 0; i < nvars; i++)
- free((void *) varnames[i]);
+ free(varnames[i]);
free(varnames);
return matches;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /