Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)
Date
Msg-id CAEudQAqyoTZC670xWi6w-Oe2_Bk1bfu2JzXz6xRfiOUzm7xbyQ@mail.gmail.com
Whole thread Raw
Responses Re: Signed vs Unsigned (take 2) (src/backend/storage/ipc/procarray.c)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

With the recent changes at procarray.c, I take a look in.
msvc compiler, has some warnings about signed vs unsigned.

So.

1. Size_t is weird, because all types are int.
2. Wouldn't it be better to initialize static variables?
3. There are some shadowing parameters.
4. Possible loop beyond numProcs?

- for (size_t pgxactoff = 0; pgxactoff < numProcs; pgxactoff++)
+ for (int pgxactoff = 0; pgxactoff < numProcs; pgxactoff++)

I think no functional behavior changed.
Patch attached.

best regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Use pg_nextpower2_* in a few more places
Next
From: Zhihong Yu
Date:
Subject: Re: Use pg_nextpower2_* in a few more places