Re: [HACKERS] oid8types() borken?

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: t-ishii(at)sra(dot)co(dot)jp
Cc: oliver(at)fritz(dot)traverse(dot)net, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] oid8types() borken?
Date: 1998-09-22 19:49:17
Message-ID: 199809221950.PAA28781@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> At 0:47 AM 98.9.18 -0400, Bruce Momjian wrote:
> >Fixed. The actual fix is to change:
> >
> > oid8types(Oid **oidArray)
> >
> >to:
> >
> > oid8types(Oid (*oidArray)[])
> >
> >Can someone explain what this is? This is the old 6.3 code, and forgot
> >to reverse back this part when I realized my change to **oidArray did
> >not work.
>
> Oid **oidArray and (Oid (*oidArray)[] are quite different.
> The latter is a pointer to Oid array. Sample code for a caller might
> be:
>
> Oid oids[8];
> :
> :
> oid8types(&oids);
>
> &oids is actually same as oids or &oids[0]. Interesting but just
> waste of time IMHO.

Yes, I have seen people do this, and it is a waste.

> You will see oidArray and *oidArray shows same value in oid8types().
>
> Seems just
>
> oid8types(Oid *oidArray)
> or
> oid8types(Oid oidArray[])
>
> are simpler and more effective.

Ah, I see now, just a confusion of adding meaningless []. I am applying
the cleanup now. Thanks.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
http://www.op.net/~candle | (610) 353-9879(w)
+ If your life is a hard drive, | (610) 853-3000(h)
+ Christ can be your backup. |

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-09-22 20:45:25 funny comment
Previous Message Bruce Momjian 1998-09-22 19:43:05 Re: Problem dropping databases