Suppress compiler warning.
authorTom Lane
Fri, 22 Jan 2016 02:14:07 +0000 (21:14 -0500)
committerTom Lane
Fri, 22 Jan 2016 02:14:07 +0000 (21:14 -0500)
Given the limited range of i, these shifts should not cause any
problem, but that apparently doesn't stop some compilers from
whining about them.

David Rowley

src/backend/access/gin/ginvalidate.c
src/backend/access/gist/gistvalidate.c
src/backend/access/spgist/spgvalidate.c

index b87833bd5a10b0c4790cabcce17e78dd86a0e06c..87177fc96bc6e8adbcfe4187624dfb1548580bad 100644 (file)
@@ -234,7 +234,8 @@ ginvalidate(Oid opclassoid)
    /* Check that the originally-named opclass is complete */
    for (i = 1; i <= GINNProcs; i++)
    {
-       if (opclassgroup && (opclassgroup->functionset & (1 << i)) != 0)
+       if (opclassgroup &&
+           (opclassgroup->functionset & (((uint64) 1) << i)) != 0)
            continue;           /* got it */
        if (i == GIN_COMPARE_PARTIAL_PROC)
            continue;           /* optional method */
index 190b9787bb7040c39e9f7749f9245381c23a1e53..d3ada703f30d81a4bde1fbb7cf44d7701f6ad19a 100644 (file)
@@ -254,7 +254,8 @@ gistvalidate(Oid opclassoid)
    /* Check that the originally-named opclass is complete */
    for (i = 1; i <= GISTNProcs; i++)
    {
-       if (opclassgroup && (opclassgroup->functionset & (1 << i)) != 0)
+       if (opclassgroup &&
+           (opclassgroup->functionset & (((uint64) 1) << i)) != 0)
            continue;           /* got it */
        if (i == GIST_DISTANCE_PROC || i == GIST_FETCH_PROC)
            continue;           /* optional methods */
index ba7c82845312e1c548b939f4c4d64eb715995db0..29ae3b8be6faa1dd2614d26bfbb4c45de3e8a773 100644 (file)
@@ -213,7 +213,7 @@ spgvalidate(Oid opclassoid)
 
        for (i = 1; i <= SPGISTNProc; i++)
        {
-           if ((thisgroup->functionset & (1 << i)) != 0)
+           if ((thisgroup->functionset & (((uint64) 1) << i)) != 0)
                continue;       /* got it */
            ereport(INFO,
                    (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),