Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc19354d

Browse files
committed
const-ify functions used with completion_matches(), to suppress
cast-away-const warnings from compilers pickier than gcc.
1 parent906dce0 commitc19354d

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.75 2003/03/28 16:34:50 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.76 2003/04/03 20:18:16 tgl Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -67,7 +67,7 @@ extern char *filename_completion_function();
6767
#endif
6868

6969
#ifdefHAVE_RL_COMPLETION_MATCHES
70-
#definecompletion_matches(x,y)rl_completion_matches((x), ((rl_compentry_func_t *)(y)))
70+
#definecompletion_matchesrl_completion_matches
7171
#endif
7272

7373
#defineBUF_SIZE 2048
@@ -76,12 +76,13 @@ extern char *filename_completion_function();
7676

7777
/* Forward declaration of functions */
7878
staticchar**psql_completion(char*text,intstart,intend);
79-
staticchar*create_command_generator(char*text,intstate);
80-
staticchar*complete_from_query(char*text,intstate);
81-
staticchar*complete_from_schema_query(char*text,intstate);
82-
staticchar*_complete_from_query(intis_schema_query,char*text,intstate);
83-
staticchar*complete_from_const(char*text,intstate);
84-
staticchar*complete_from_list(char*text,intstate);
79+
staticchar*create_command_generator(constchar*text,intstate);
80+
staticchar*complete_from_query(constchar*text,intstate);
81+
staticchar*complete_from_schema_query(constchar*text,intstate);
82+
staticchar*_complete_from_query(intis_schema_query,
83+
constchar*text,intstate);
84+
staticchar*complete_from_const(constchar*text,intstate);
85+
staticchar*complete_from_list(constchar*text,intstate);
8586

8687
staticPGresult*exec_query(char*query);
8788
char*quote_file_name(char*text,intmatch_type,char*quote_pointer);
@@ -1357,7 +1358,7 @@ psql_completion(char *text, int start, int end)
13571358
as defined above.
13581359
*/
13591360
staticchar*
1360-
create_command_generator(char*text,intstate)
1361+
create_command_generator(constchar*text,intstate)
13611362
{
13621363
staticintlist_index,
13631364
string_length;
@@ -1383,13 +1384,13 @@ create_command_generator(char *text, int state)
13831384
/* The following two functions are wrappers for _complete_from_query */
13841385

13851386
staticchar*
1386-
complete_from_query(char*text,intstate)
1387+
complete_from_query(constchar*text,intstate)
13871388
{
13881389
return_complete_from_query(0,text,state);
13891390
}
13901391

13911392
staticchar*
1392-
complete_from_schema_query(char*text,intstate)
1393+
complete_from_schema_query(constchar*text,intstate)
13931394
{
13941395
return_complete_from_query(1,text,state);
13951396
}
@@ -1412,7 +1413,7 @@ complete_from_schema_query(char *text, int state)
14121413
*/
14131414

14141415
staticchar*
1415-
_complete_from_query(intis_schema_query,char*text,intstate)
1416+
_complete_from_query(intis_schema_query,constchar*text,intstate)
14161417
{
14171418
staticintlist_index,
14181419
string_length;
@@ -1421,7 +1422,7 @@ _complete_from_query(int is_schema_query, char *text, int state)
14211422
constchar*item;
14221423

14231424
/*
1424-
* If thisist the first time for this completion, we fetch a list of
1425+
* If thisis the first time for this completion, we fetch a list of
14251426
* our "things" from the backend.
14261427
*/
14271428
if (state==0)
@@ -1471,7 +1472,7 @@ _complete_from_query(int is_schema_query, char *text, int state)
14711472
SQL words that can appear at certain spot.
14721473
*/
14731474
staticchar*
1474-
complete_from_list(char*text,intstate)
1475+
complete_from_list(constchar*text,intstate)
14751476
{
14761477
staticintstring_length,
14771478
list_index,
@@ -1531,7 +1532,7 @@ complete_from_list(char *text, int state)
15311532
The string to be passed must be in completion_charp.
15321533
*/
15331534
staticchar*
1534-
complete_from_const(char*text,intstate)
1535+
complete_from_const(constchar*text,intstate)
15351536
{
15361537
(void)text;/* We don't care about what was entered
15371538
* already. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp