Обсуждение: AW: AW: PostgreSQL pre-7.1 Linux/Alpha Status...

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

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

От
Zeugswetter Andreas SB
Дата:
> > 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
Дата:
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> 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