Mesa (master): gallium/aux: Fix MSVC warning C4334 (32bit shift cast to 64bit)

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 20 00:48:27 UTC 2021


Module: Mesa
Branch: master
Commit: 4a3f0444732fb95883b70bef1b1ffda86af46e4a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a3f0444732fb95883b70bef1b1ffda86af46e4a

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Mon Apr 19 11:53:04 2021 -0700

gallium/aux: Fix MSVC warning C4334 (32bit shift cast to 64bit)

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-By: Bill Kristiansen <billkris at microsoft.com>
Cc: mesa-stable at lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10331>

---

 src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 2 +-
 src/gallium/auxiliary/pipebuffer/pb_cache.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
index ee87663ba25..4595e1a4021 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
@@ -232,7 +232,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
    }
    
    assert(pipe_is_referenced(&buf->buffer->reference));
-   assert(pb_check_alignment(desc->alignment, 1 << buf->buffer->alignment_log2));
+   assert(pb_check_alignment(desc->alignment, 1ull << buf->buffer->alignment_log2));
    assert(buf->buffer->size >= size);
    
    pipe_reference_init(&buf->base.reference, 1);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
index 43007a3b34e..d965182b84f 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
@@ -399,7 +399,7 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr,
    }
    
    assert(pipe_is_referenced(&buf->buffer->reference));
-   assert(pb_check_alignment(real_desc.alignment, 1 << buf->buffer->alignment_log2));
+   assert(pb_check_alignment(real_desc.alignment, 1ull << buf->buffer->alignment_log2));
    assert(pb_check_usage(real_desc.usage, buf->buffer->usage));
    assert(buf->buffer->size >= real_size);
    
diff --git a/src/gallium/auxiliary/pipebuffer/pb_cache.c b/src/gallium/auxiliary/pipebuffer/pb_cache.c
index 515761997d0..a92cd2d5e25 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_cache.c
@@ -133,7 +133,7 @@ pb_cache_is_buffer_compat(struct pb_cache_entry *entry,
    if (usage & mgr->bypass_usage)
       return 0;
 
-   if (!pb_check_alignment(alignment, 1 << buf->alignment_log2))
+   if (!pb_check_alignment(alignment, 1ull << buf->alignment_log2))
       return 0;
 
    return mgr->can_reclaim(mgr->winsys, buf) ? 1 : -1;



More information about the mesa-commit mailing list