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

Commit699782b

Browse files
committed
Adjust Tcl-related code to compile cleanly with Tcl 8.4 (add const modifiers as
needed). Some desultory const-ification of SPI interface to support this.
1 parentd82794e commit699782b

File tree

10 files changed

+187
-165
lines changed

10 files changed

+187
-165
lines changed

‎doc/src/sgml/spi.sgml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/spi.sgml,v 1.23 2002/09/02 06:11:42 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/spi.sgml,v 1.24 2002/12/30 22:10:53 tgl Exp $
33
-->
44

55
<Chapter id="spi">
@@ -348,7 +348,7 @@ SPI_exec(<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>, <REPLACEABLE CLASS=
348348
<VARIABLELIST>
349349
<VARLISTENTRY>
350350
<TERM>
351-
char *<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
351+
constchar *<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
352352
</TERM>
353353
<LISTITEM>
354354
<PARA>
@@ -597,7 +597,7 @@ SPI_prepare(<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>, <REPLACEABLE CLA
597597
<VARIABLELIST>
598598
<VARLISTENTRY>
599599
<TERM>
600-
<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
600+
const char *<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
601601
</TERM>
602602
<LISTITEM>
603603
<PARA>
@@ -607,7 +607,7 @@ Query string
607607
</VARLISTENTRY>
608608
<VARLISTENTRY>
609609
<TERM>
610-
<REPLACEABLE CLASS="PARAMETER">nargs</REPLACEABLE>
610+
int<REPLACEABLE CLASS="PARAMETER">nargs</REPLACEABLE>
611611
</TERM>
612612
<LISTITEM>
613613
<PARA>
@@ -617,7 +617,7 @@ Number of input parameters ($1 ... $nargs - as in SQL-functions)
617617
</VARLISTENTRY>
618618
<VARLISTENTRY>
619619
<TERM>
620-
<REPLACEABLE CLASS="PARAMETER">argtypes</REPLACEABLE>
620+
Oid *<REPLACEABLE CLASS="PARAMETER">argtypes</REPLACEABLE>
621621
</TERM>
622622
<LISTITEM>
623623
<PARA>
@@ -780,7 +780,7 @@ Actual parameter values
780780
</VARLISTENTRY>
781781
<VARLISTENTRY>
782782
<TERM>
783-
char *<REPLACEABLE CLASS="PARAMETER">nulls</REPLACEABLE>
783+
constchar *<REPLACEABLE CLASS="PARAMETER">nulls</REPLACEABLE>
784784
</TERM>
785785
<LISTITEM>
786786
<PARA>
@@ -948,7 +948,7 @@ SPI_cursor_open(<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>,
948948
<VARIABLELIST>
949949
<VARLISTENTRY>
950950
<TERM>
951-
char *<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
951+
constchar *<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
952952
</TERM>
953953
<LISTITEM>
954954
<PARA>
@@ -978,7 +978,7 @@ Actual parameter values
978978
</VARLISTENTRY>
979979
<VARLISTENTRY>
980980
<TERM>
981-
char *<REPLACEABLE CLASS="PARAMETER">nulls</REPLACEABLE>
981+
constchar *<REPLACEABLE CLASS="PARAMETER">nulls</REPLACEABLE>
982982
</TERM>
983983
<LISTITEM>
984984
<PARA>
@@ -1089,7 +1089,7 @@ SPI_cursor_find(<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>)
10891089
<VARIABLELIST>
10901090
<VARLISTENTRY>
10911091
<TERM>
1092-
char *<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
1092+
constchar *<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
10931093
</TERM>
10941094
<LISTITEM>
10951095
<PARA>
@@ -1699,7 +1699,7 @@ Input tuple description
16991699
</VARLISTENTRY>
17001700
<VARLISTENTRY>
17011701
<TERM>
1702-
char * <REPLACEABLE CLASS="PARAMETER">fname</REPLACEABLE>
1702+
constchar * <REPLACEABLE CLASS="PARAMETER">fname</REPLACEABLE>
17031703
</TERM>
17041704
<LISTITEM>
17051705
<PARA>
@@ -3068,7 +3068,7 @@ New values for the attributes specified
30683068
</VARLISTENTRY>
30693069
<VARLISTENTRY>
30703070
<TERM>
3071-
char * <REPLACEABLE CLASS="PARAMETER">Nulls</REPLACEABLE>
3071+
constchar * <REPLACEABLE CLASS="PARAMETER">Nulls</REPLACEABLE>
30723072
</TERM>
30733073
<LISTITEM>
30743074
<PARA>

‎src/backend/executor/spi.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.82 2002/12/17 15:51:59 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.83 2002/12/30 22:10:54 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -32,11 +32,11 @@ static _SPI_connection *_SPI_current = NULL;
3232
staticint_SPI_connected=-1;
3333
staticint_SPI_curid=-1;
3434

35-
staticint_SPI_execute(char*src,inttcount,_SPI_plan*plan);
35+
staticint_SPI_execute(constchar*src,inttcount,_SPI_plan*plan);
3636
staticint_SPI_pquery(QueryDesc*queryDesc,boolrunit,inttcount);
3737

3838
staticint_SPI_execute_plan(_SPI_plan*plan,
39-
Datum*Values,char*Nulls,inttcount);
39+
Datum*Values,constchar*Nulls,inttcount);
4040

4141
staticvoid_SPI_cursor_operation(Portalportal,boolforward,intcount,
4242
CommandDestdest);
@@ -187,7 +187,7 @@ SPI_pop(void)
187187
}
188188

189189
int
190-
SPI_exec(char*src,inttcount)
190+
SPI_exec(constchar*src,inttcount)
191191
{
192192
intres;
193193

@@ -205,7 +205,7 @@ SPI_exec(char *src, int tcount)
205205
}
206206

207207
int
208-
SPI_execp(void*plan,Datum*Values,char*Nulls,inttcount)
208+
SPI_execp(void*plan,Datum*Values,constchar*Nulls,inttcount)
209209
{
210210
intres;
211211

@@ -226,7 +226,7 @@ SPI_execp(void *plan, Datum *Values, char *Nulls, int tcount)
226226
}
227227

228228
void*
229-
SPI_prepare(char*src,intnargs,Oid*argtypes)
229+
SPI_prepare(constchar*src,intnargs,Oid*argtypes)
230230
{
231231
_SPI_plan*plan;
232232

@@ -382,7 +382,7 @@ SPI_copytupleintoslot(HeapTuple tuple, TupleDesc tupdesc)
382382

383383
HeapTuple
384384
SPI_modifytuple(Relationrel,HeapTupletuple,intnatts,int*attnum,
385-
Datum*Values,char*Nulls)
385+
Datum*Values,constchar*Nulls)
386386
{
387387
MemoryContextoldcxt=NULL;
388388
HeapTuplemtuple;
@@ -455,7 +455,7 @@ SPI_modifytuple(Relation rel, HeapTuple tuple, int natts, int *attnum,
455455
}
456456

457457
int
458-
SPI_fnumber(TupleDesctupdesc,char*fname)
458+
SPI_fnumber(TupleDesctupdesc,constchar*fname)
459459
{
460460
intres;
461461
Form_pg_attributesysatt;
@@ -693,7 +693,7 @@ SPI_freetuptable(SPITupleTable *tuptable)
693693
*Open a prepared SPI plan as a portal
694694
*/
695695
Portal
696-
SPI_cursor_open(char*name,void*plan,Datum*Values,char*Nulls)
696+
SPI_cursor_open(constchar*name,void*plan,Datum*Values,constchar*Nulls)
697697
{
698698
staticintunnamed_portal_count=0;
699699

@@ -827,7 +827,7 @@ SPI_cursor_open(char *name, void *plan, Datum *Values, char *Nulls)
827827
*Find the portal of an existing open cursor
828828
*/
829829
Portal
830-
SPI_cursor_find(char*name)
830+
SPI_cursor_find(constchar*name)
831831
{
832832
returnGetPortalByName(name);
833833
}
@@ -944,7 +944,7 @@ spi_printtup(HeapTuple tuple, TupleDesc tupdesc, DestReceiver *self)
944944
* If plan != NULL, just prepare plan tree, else execute immediately.
945945
*/
946946
staticint
947-
_SPI_execute(char*src,inttcount,_SPI_plan*plan)
947+
_SPI_execute(constchar*src,inttcount,_SPI_plan*plan)
948948
{
949949
StringInfoDatastri;
950950
List*raw_parsetree_list;
@@ -1110,7 +1110,8 @@ _SPI_execute(char *src, int tcount, _SPI_plan *plan)
11101110
}
11111111

11121112
staticint
1113-
_SPI_execute_plan(_SPI_plan*plan,Datum*Values,char*Nulls,inttcount)
1113+
_SPI_execute_plan(_SPI_plan*plan,Datum*Values,constchar*Nulls,
1114+
inttcount)
11141115
{
11151116
List*query_list_list=plan->qtlist;
11161117
List*plan_list=plan->ptlist;

‎src/backend/utils/mmgr/portalmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.50 2002/12/05 15:50:35 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.51 2002/12/30 22:10:54 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -134,7 +134,7 @@ EnablePortalManager(void)
134134
*Returns a portal given a portal name, or NULL if name not found.
135135
*/
136136
Portal
137-
GetPortalByName(char*name)
137+
GetPortalByName(constchar*name)
138138
{
139139
Portalportal;
140140

@@ -173,7 +173,7 @@ PortalSetQuery(Portal portal,
173173
*"WARNING" if portal name is in use (existing portal is returned!)
174174
*/
175175
Portal
176-
CreatePortal(char*name)
176+
CreatePortal(constchar*name)
177177
{
178178
Portalportal;
179179

‎src/include/executor/spi.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* spi.h
44
*
5-
* $Id: spi.h,v 1.34 2002/12/13 19:45:56 tgl Exp $
5+
* $Id: spi.h,v 1.35 2002/12/30 22:10:54 tgl Exp $
66
*
77
*-------------------------------------------------------------------------
88
*/
@@ -80,9 +80,10 @@ extern intSPI_connect(void);
8080
externintSPI_finish(void);
8181
externvoidSPI_push(void);
8282
externvoidSPI_pop(void);
83-
externintSPI_exec(char*src,inttcount);
84-
externintSPI_execp(void*plan,Datum*values,char*Nulls,inttcount);
85-
externvoid*SPI_prepare(char*src,intnargs,Oid*argtypes);
83+
externintSPI_exec(constchar*src,inttcount);
84+
externintSPI_execp(void*plan,Datum*values,constchar*Nulls,
85+
inttcount);
86+
externvoid*SPI_prepare(constchar*src,intnargs,Oid*argtypes);
8687
externvoid*SPI_saveplan(void*plan);
8788
externintSPI_freeplan(void*plan);
8889

@@ -91,8 +92,8 @@ extern TupleDesc SPI_copytupledesc(TupleDesc tupdesc);
9192
externTupleTableSlot*SPI_copytupleintoslot(HeapTupletuple,
9293
TupleDesctupdesc);
9394
externHeapTupleSPI_modifytuple(Relationrel,HeapTupletuple,intnatts,
94-
int*attnum,Datum*Values,char*Nulls);
95-
externintSPI_fnumber(TupleDesctupdesc,char*fname);
95+
int*attnum,Datum*Values,constchar*Nulls);
96+
externintSPI_fnumber(TupleDesctupdesc,constchar*fname);
9697
externchar*SPI_fname(TupleDesctupdesc,intfnumber);
9798
externchar*SPI_getvalue(HeapTupletuple,TupleDesctupdesc,intfnumber);
9899
externDatumSPI_getbinval(HeapTupletuple,TupleDesctupdesc,intfnumber,bool*isnull);
@@ -105,9 +106,9 @@ extern void SPI_pfree(void *pointer);
105106
externvoidSPI_freetuple(HeapTuplepointer);
106107
externvoidSPI_freetuptable(SPITupleTable*tuptable);
107108

108-
externPortalSPI_cursor_open(char*name,void*plan,
109-
Datum*Values,char*Nulls);
110-
externPortalSPI_cursor_find(char*name);
109+
externPortalSPI_cursor_open(constchar*name,void*plan,
110+
Datum*Values,constchar*Nulls);
111+
externPortalSPI_cursor_find(constchar*name);
111112
externvoidSPI_cursor_fetch(Portalportal,boolforward,intcount);
112113
externvoidSPI_cursor_move(Portalportal,boolforward,intcount);
113114
externvoidSPI_cursor_close(Portalportal);

‎src/include/utils/portal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $Id: portal.h,v 1.36 2002/12/05 15:50:39 tgl Exp $
12+
* $Id: portal.h,v 1.37 2002/12/30 22:10:54 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -53,9 +53,9 @@ typedef struct PortalData
5353

5454
externvoidEnablePortalManager(void);
5555
externvoidAtEOXact_portals(void);
56-
externPortalCreatePortal(char*name);
56+
externPortalCreatePortal(constchar*name);
5757
externvoidPortalDrop(Portalportal);
58-
externPortalGetPortalByName(char*name);
58+
externPortalGetPortalByName(constchar*name);
5959
externvoidPortalSetQuery(Portalportal,QueryDesc*queryDesc,
6060
void (*cleanup) (Portalportal));
6161

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp