Commit 7439ba64 authored by Bryan Henderson's avatar Bryan Henderson

Use "Oid" type where applicable and %ud instead of %d. Thanks Darren King.

parent 9b41da6c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.5 1996/11/10 02:59:45 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.6 1996/12/11 03:17:17 bryanh Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -68,7 +68,7 @@ DefineVirtualRelation(char *relname, List *tlist) ...@@ -68,7 +68,7 @@ DefineVirtualRelation(char *relname, List *tlist)
entry = lfirst(t); entry = lfirst(t);
res = entry->resdom; res = entry->resdom;
resname = res->resname; resname = res->resname;
restypename = tname(get_id_type((long)res->restype)); restypename = tname(get_id_type(res->restype));
typename = makeNode(TypeName); typename = makeNode(TypeName);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.3 1996/11/10 03:00:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.4 1996/12/11 03:17:42 bryanh Exp $
* *
* NOTES * NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which * Every (plan) node in POSTGRES has an associated "out" routine which
...@@ -247,13 +247,13 @@ _outMergeJoin(StringInfo str, MergeJoin *node) ...@@ -247,13 +247,13 @@ _outMergeJoin(StringInfo str, MergeJoin *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outNode(str, node->mergeclauses); _outNode(str, node->mergeclauses);
sprintf(buf, " :mergesortop %d", node->mergesortop); sprintf(buf, " :mergesortop %ud", node->mergesortop);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :mergerightorder %d", node->mergerightorder[0]); sprintf(buf, " :mergerightorder %ud", node->mergerightorder[0]);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :mergeleftorder %d", node->mergeleftorder[0]); sprintf(buf, " :mergeleftorder %ud", node->mergeleftorder[0]);
appendStringInfo(str, buf); appendStringInfo(str, buf);
} }
...@@ -273,7 +273,7 @@ _outHashJoin(StringInfo str, HashJoin *node) ...@@ -273,7 +273,7 @@ _outHashJoin(StringInfo str, HashJoin *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outNode(str, node->hashclauses); _outNode(str, node->hashclauses);
sprintf(buf, " :hashjoinop %d",node->hashjoinop); sprintf(buf, " :hashjoinop %ud",node->hashjoinop);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :hashjointable 0x%x", (int) node->hashjointable); sprintf(buf, " :hashjointable 0x%x", (int) node->hashjointable);
appendStringInfo(str,buf); appendStringInfo(str,buf);
...@@ -357,7 +357,7 @@ _outTemp(StringInfo str, Temp *node) ...@@ -357,7 +357,7 @@ _outTemp(StringInfo str, Temp *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outPlanInfo(str, (Plan*) node); _outPlanInfo(str, (Plan*) node);
sprintf(buf, " :tempid %d", node->tempid); sprintf(buf, " :tempid %ud", node->tempid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :keycount %d", node->keycount); sprintf(buf, " :keycount %d", node->keycount);
appendStringInfo(str,buf); appendStringInfo(str,buf);
...@@ -376,7 +376,7 @@ _outSort(StringInfo str, Sort *node) ...@@ -376,7 +376,7 @@ _outSort(StringInfo str, Sort *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outPlanInfo(str, (Plan*) node); _outPlanInfo(str, (Plan*) node);
sprintf(buf, " :tempid %d", node->tempid); sprintf(buf, " :tempid %ud", node->tempid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :keycount %d", node->keycount); sprintf(buf, " :keycount %d", node->keycount);
appendStringInfo(str,buf); appendStringInfo(str,buf);
...@@ -425,7 +425,7 @@ _outUnique(StringInfo str, Unique *node) ...@@ -425,7 +425,7 @@ _outUnique(StringInfo str, Unique *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outPlanInfo(str, (Plan*) node); _outPlanInfo(str, (Plan*) node);
sprintf(buf, " :tempid %d", node->tempid); sprintf(buf, " :tempid %ud", node->tempid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :keycount %d", node->keycount); sprintf(buf, " :keycount %d", node->keycount);
appendStringInfo(str,buf); appendStringInfo(str,buf);
...@@ -497,7 +497,7 @@ _outResdom(StringInfo str, Resdom *node) ...@@ -497,7 +497,7 @@ _outResdom(StringInfo str, Resdom *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :resno %hd", node->resno); sprintf(buf, " :resno %hd", node->resno);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :restype %d", node->restype); sprintf(buf, " :restype %ud", node->restype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reslen %d", node->reslen); sprintf(buf, " :reslen %d", node->reslen);
appendStringInfo(str,buf); appendStringInfo(str,buf);
...@@ -506,7 +506,7 @@ _outResdom(StringInfo str, Resdom *node) ...@@ -506,7 +506,7 @@ _outResdom(StringInfo str, Resdom *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reskey %d", node->reskey); sprintf(buf, " :reskey %d", node->reskey);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reskeyop %ld", (long int) node->reskeyop); sprintf(buf, " :reskeyop %ud", node->reskeyop);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :resjunk %d", node->resjunk); sprintf(buf, " :resjunk %d", node->resjunk);
appendStringInfo(str,buf); appendStringInfo(str,buf);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.12 1996/11/30 18:06:31 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.13 1996/12/11 03:17:49 bryanh Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -120,7 +120,7 @@ static void make_lowercase(char *string); ...@@ -120,7 +120,7 @@ static void make_lowercase(char *string);
* what's going on - jolly * what's going on - jolly
*/ */
bool bool
check_typeid(long id) check_typeid(Oid id)
{ {
return (SearchSysCacheTuple(TYPOID, return (SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(id), ObjectIdGetDatum(id),
...@@ -130,13 +130,13 @@ check_typeid(long id) ...@@ -130,13 +130,13 @@ check_typeid(long id)
/* return a Type structure, given an typid */ /* return a Type structure, given an typid */
Type Type
get_id_type(long id) get_id_type(Oid id)
{ {
HeapTuple tup; HeapTuple tup;
if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id), if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id),
0,0,0))) { 0,0,0))) {
elog ( WARN, "type id lookup of %d failed", id); elog ( WARN, "type id lookup of %ud failed", id);
return(NULL); return(NULL);
} }
return((Type) tup); return((Type) tup);
...@@ -144,14 +144,14 @@ get_id_type(long id) ...@@ -144,14 +144,14 @@ get_id_type(long id)
/* return a type name, given a typeid */ /* return a type name, given a typeid */
char* char*
get_id_typname(long id) get_id_typname(Oid id)
{ {
HeapTuple tup; HeapTuple tup;
TypeTupleForm typetuple; TypeTupleForm typetuple;
if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id), if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id),
0,0,0))) { 0,0,0))) {
elog ( WARN, "type id lookup of %d failed", id); elog ( WARN, "type id lookup of %ud failed", id);
return(NULL); return(NULL);
} }
typetuple = (TypeTupleForm)GETSTRUCT(tup); typetuple = (TypeTupleForm)GETSTRUCT(tup);
...@@ -1165,8 +1165,8 @@ func_get_detail(char *funcname, ...@@ -1165,8 +1165,8 @@ func_get_detail(char *funcname,
} else { } else {
pform = (Form_pg_proc) GETSTRUCT(ftup); pform = (Form_pg_proc) GETSTRUCT(ftup);
*funcid = ftup->t_oid; *funcid = ftup->t_oid;
*rettype = (Oid) pform->prorettype; *rettype = pform->prorettype;
*retset = (Oid) pform->proretset; *retset = pform->proretset;
return (true); return (true);
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: catalog_utils.h,v 1.5 1996/11/30 18:06:58 momjian Exp $ * $Id: catalog_utils.h,v 1.6 1996/12/11 03:18:12 bryanh Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
typedef HeapTuple Type; typedef HeapTuple Type;
typedef HeapTuple Operator; typedef HeapTuple Operator;
extern bool check_typeid(long id); extern bool check_typeid(Oid id);
extern Type get_id_type(long id); extern Type get_id_type(Oid id);
extern char *get_id_typname(long id); extern char *get_id_typname(Oid id);
extern Type type(char *); extern Type type(char *);
extern Oid att_typeid(Relation rd, int attid); extern Oid att_typeid(Relation rd, int attid);
extern int att_attnelems(Relation rd, int attid); extern int att_attnelems(Relation rd, int attid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment