1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-16 16:42:29 +03:00

Suppress compiler warnings in dshash.c.

Some compilers complain, not unreasonably, about left-shifting an
int32 "1" and then assigning the result to an int64.  In practice
I sure hope that this data structure never gets large enough that
an overflow would actually occur; but let's cast the constant to
the right type to avoid the hazard.

In passing, fix a typo in dshash.h.

Amit Kapila, adjusted as per comment from Thomas Munro.

Discussion: https://postgr.es/m/CAA4eK1+5vfVMYtjK_NX8O3-42yM3o80qdqWnQzGquPrbq6mb+A@mail.gmail.com
This commit is contained in:
Tom Lane
2017-09-03 11:12:29 -04:00
parent e451901804
commit 4faa1dc2eb
2 changed files with 5 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ typedef dshash_hash (*dshash_hash_function) (const void *v, size_t size,
* members tranche_id and tranche_name do not need to be initialized when
* attaching to an existing hash table.
*
* Compare and hash functions mus be supplied even when attaching, because we
* Compare and hash functions must be supplied even when attaching, because we
* can't safely share function pointers between backends in general. Either
* the arg variants or the non-arg variants should be supplied; the other
* function pointers should be NULL. If the arg varants are supplied then the