8000 psql: Reduce the amount of const lies a bit · postgrespro/postgres_cluster@4b77bfc · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b77bfc

Browse files
committed
psql: Reduce the amount of const lies a bit
1 parent 88a6ac9 commit 4b77bfc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/bin/psql/tab-complete.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,13 +3364,13 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
33643364
{
33653365
char **matches;
33663366
int overhead = strlen(prefix) + strlen(suffix) + 1;
3367-
const char **varnames;
3367+
char **varnames;
33683368
int nvars = 0;
33693369
int maxvars = 100;
33703370
int i;
33713371
struct _variable *ptr;
33723372

3373-
varnames = (const char **) pg_malloc((maxvars + 1) * sizeof(char *));
3373+
varnames = (char **) pg_malloc((maxvars + 1) * sizeof(char *));
33743374

33753375
for (ptr = pset.vars->next; ptr; ptr = ptr->next)
33763376
{
@@ -3379,8 +3379,8 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
33793379
if (nvars >= maxvars)
33803380
{
33813381
maxvars *= 2;
3382-
varnames = (const char **) realloc(varnames,
3383-
(maxvars + 1) * sizeof(char *));
3382+
varnames = (char **) realloc(varnames,
3383+
(maxvars + 1) * sizeof(char *));
33843384
if (!varnames)
33853385
{
33863386
psql_error("out of memory\n");
@@ -3394,10 +3394,10 @@ complete_from_variables(char *text, const char *prefix, const char *suffix)
33943394
}
33953395

33963396
varnames[nvars] = NULL;
3397-
COMPLETE_WITH_LIST(varnames);
3397+
COMPLETE_WITH_LIST((const char * const *) varnames);
33983398

33993399
for (i = 0; i < nvars; i++)
3400-
free((void *) varnames[i]);
3400+
free(varnames[i]);
34013401
free(varnames);
34023402

34033403
return matches;

0 commit comments

Comments
 (0)
0