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

Commit7439ba6

Browse files
author
Bryan Henderson
committed
Use "Oid" type where applicable and %ud instead of %d. Thanks Darren King.
1 parent9b41da6 commit7439ba6

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

‎src/backend/commands/view.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.5 1996/11/10 02:59:45 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.6 1996/12/11 03:17:17 bryanh Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -68,7 +68,7 @@ DefineVirtualRelation(char *relname, List *tlist)
6868
entry=lfirst(t);
6969
res=entry->resdom;
7070
resname=res->resname;
71-
restypename=tname(get_id_type((long)res->restype));
71+
restypename=tname(get_id_type(res->restype));
7272

7373
typename=makeNode(TypeName);
7474

‎src/backend/nodes/outfuncs.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.3 1996/11/10 03:00:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.4 1996/12/11 03:17:42 bryanh Exp $
1111
*
1212
* NOTES
1313
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -247,13 +247,13 @@ _outMergeJoin(StringInfo str, MergeJoin *node)
247247
appendStringInfo(str,buf);
248248
_outNode(str,node->mergeclauses);
249249

250-
sprintf(buf," :mergesortop %d",node->mergesortop);
250+
sprintf(buf," :mergesortop %ud",node->mergesortop);
251251
appendStringInfo(str,buf);
252252

253-
sprintf(buf," :mergerightorder %d",node->mergerightorder[0]);
253+
sprintf(buf," :mergerightorder %ud",node->mergerightorder[0]);
254254
appendStringInfo(str,buf);
255255

256-
sprintf(buf," :mergeleftorder %d",node->mergeleftorder[0]);
256+
sprintf(buf," :mergeleftorder %ud",node->mergeleftorder[0]);
257257
appendStringInfo(str,buf);
258258
}
259259

@@ -273,7 +273,7 @@ _outHashJoin(StringInfo str, HashJoin *node)
273273
appendStringInfo(str,buf);
274274
_outNode(str,node->hashclauses);
275275

276-
sprintf(buf," :hashjoinop %d",node->hashjoinop);
276+
sprintf(buf," :hashjoinop %ud",node->hashjoinop);
277277
appendStringInfo(str,buf);
278278
sprintf(buf," :hashjointable 0x%x", (int)node->hashjointable);
279279
appendStringInfo(str,buf);
@@ -357,7 +357,7 @@ _outTemp(StringInfo str, Temp *node)
357357
appendStringInfo(str,buf);
358358
_outPlanInfo(str, (Plan*)node);
359359

360-
sprintf(buf," :tempid %d",node->tempid);
360+
sprintf(buf," :tempid %ud",node->tempid);
361361
appendStringInfo(str,buf);
362362
sprintf(buf," :keycount %d",node->keycount);
363363
appendStringInfo(str,buf);
@@ -376,7 +376,7 @@ _outSort(StringInfo str, Sort *node)
376376
appendStringInfo(str,buf);
377377
_outPlanInfo(str, (Plan*)node);
378378

379-
sprintf(buf," :tempid %d",node->tempid);
379+
sprintf(buf," :tempid %ud",node->tempid);
380380
appendStringInfo(str,buf);
381381
sprintf(buf," :keycount %d",node->keycount);
382382
appendStringInfo(str,buf);
@@ -425,7 +425,7 @@ _outUnique(StringInfo str, Unique *node)
425425
appendStringInfo(str,buf);
426426
_outPlanInfo(str, (Plan*)node);
427427

428-
sprintf(buf," :tempid %d",node->tempid);
428+
sprintf(buf," :tempid %ud",node->tempid);
429429
appendStringInfo(str,buf);
430430
sprintf(buf," :keycount %d",node->keycount);
431431
appendStringInfo(str,buf);
@@ -497,7 +497,7 @@ _outResdom(StringInfo str, Resdom *node)
497497
appendStringInfo(str,buf);
498498
sprintf(buf," :resno %hd",node->resno);
499499
appendStringInfo(str,buf);
500-
sprintf(buf," :restype %d",node->restype);
500+
sprintf(buf," :restype %ud",node->restype);
501501
appendStringInfo(str,buf);
502502
sprintf(buf," :reslen %d",node->reslen);
503503
appendStringInfo(str,buf);
@@ -506,7 +506,7 @@ _outResdom(StringInfo str, Resdom *node)
506506
appendStringInfo(str,buf);
507507
sprintf(buf," :reskey %d",node->reskey);
508508
appendStringInfo(str,buf);
509-
sprintf(buf," :reskeyop %ld", (longint)node->reskeyop);
509+
sprintf(buf," :reskeyop %ud",node->reskeyop);
510510
appendStringInfo(str,buf);
511511
sprintf(buf," :resjunk %d",node->resjunk);
512512
appendStringInfo(str,buf);

‎src/backend/parser/catalog_utils.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.12 1996/11/30 18:06:31 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.13 1996/12/11 03:17:49 bryanh Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -120,7 +120,7 @@ static void make_lowercase(char *string);
120120
* what's going on - jolly
121121
*/
122122
bool
123-
check_typeid(longid)
123+
check_typeid(Oidid)
124124
{
125125
return (SearchSysCacheTuple(TYPOID,
126126
ObjectIdGetDatum(id),
@@ -130,28 +130,28 @@ check_typeid(long id)
130130

131131
/* return a Type structure, given an typid */
132132
Type
133-
get_id_type(longid)
133+
get_id_type(Oidid)
134134
{
135135
HeapTupletup;
136136

137137
if (!(tup=SearchSysCacheTuple(TYPOID,ObjectIdGetDatum(id),
138138
0,0,0))) {
139-
elog (WARN,"type id lookup of %d failed",id);
139+
elog (WARN,"type id lookup of %ud failed",id);
140140
return(NULL);
141141
}
142142
return((Type)tup);
143143
}
144144

145145
/* return a type name, given a typeid */
146146
char*
147-
get_id_typname(longid)
147+
get_id_typname(Oidid)
148148
{
149149
HeapTupletup;
150150
TypeTupleFormtypetuple;
151151

152152
if (!(tup=SearchSysCacheTuple(TYPOID,ObjectIdGetDatum(id),
153153
0,0,0))) {
154-
elog (WARN,"type id lookup of %d failed",id);
154+
elog (WARN,"type id lookup of %ud failed",id);
155155
return(NULL);
156156
}
157157
typetuple= (TypeTupleForm)GETSTRUCT(tup);
@@ -1165,8 +1165,8 @@ func_get_detail(char *funcname,
11651165
}else {
11661166
pform= (Form_pg_proc)GETSTRUCT(ftup);
11671167
*funcid=ftup->t_oid;
1168-
*rettype=(Oid)pform->prorettype;
1169-
*retset=(Oid)pform->proretset;
1168+
*rettype=pform->prorettype;
1169+
*retset=pform->proretset;
11701170

11711171
return (true);
11721172
}

‎src/include/parser/catalog_utils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: catalog_utils.h,v 1.5 1996/11/3018:06:58 momjian Exp $
9+
* $Id: catalog_utils.h,v 1.6 1996/12/11 03:18:12 bryanh Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -19,9 +19,9 @@
1919
typedefHeapTupleType;
2020
typedefHeapTupleOperator;
2121

22-
externboolcheck_typeid(longid);
23-
externTypeget_id_type(longid);
24-
externchar*get_id_typname(longid);
22+
externboolcheck_typeid(Oidid);
23+
externTypeget_id_type(Oidid);
24+
externchar*get_id_typname(Oidid);
2525
externTypetype(char*);
2626
externOidatt_typeid(Relationrd,intattid);
2727
externintatt_attnelems(Relationrd,intattid);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp