AW: AW: PostgreSQL pre-7.1 Linux/Alpha Status...

Поиск
Список
Период
Сортировка
Искать

AW: AW: PostgreSQL pre-7.1 Linux/Alpha Status...

От:
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
Дата:

> > IIRC oid uses int4in/int4out and those should definitely be able to parse
> > -1040 into a 4 byte signed long without platform dependency, no ?
> 
> Tom Lane changed this recently to have OID use its own i/o routines.

Reading the code, I don't understand it. Why would strtoul return an int in the 
first place ? The name seems to imply an unsigned long return type. 
Seems config should check the return type of strtoul.

Andreas

Re: AW: AW: PostgreSQL pre-7.1 Linux/Alpha Status...

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Zeugswetter Andreas SB  writes:
> Reading the code, I don't understand it. Why would strtoul return an
> int in the first place ? The name seems to imply an unsigned long
> return type.

What's your point?
unsigned long cvt;
cvt = strtoul(s, &endptr, 10);

The trick is to get from unsigned long to oid (which is unsigned int)
on machines where those are different sizes.
		regards, tom lane

FAQ