aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-08-30 17:34:13 -0700
committerTomeu Vizoso <[email protected]>2019-09-03 13:55:29 +0200
commit6bd18bb264d02c00505c332d595625daa0a397cb (patch)
tree053e33aaa68d2db6dc3ee8a3987d215de26f545f /src
parenta058e90138f39c8bcaf0a302ea8870ba7ddc684d (diff)
panfrost: Mark (1 << 31) as unsigned
I was not aware this incurred undefined behaviour; thank you cppcheck. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_instancing.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/panfrost/pan_instancing.c b/src/gallium/drivers/panfrost/pan_instancing.c
index e5a1e7cfae3..fc63cdbb25d 100644
--- a/src/gallium/drivers/panfrost/pan_instancing.c
+++ b/src/gallium/drivers/panfrost/pan_instancing.c
@@ -221,7 +221,7 @@ panfrost_vertex_instanced(
unsigned m = m_f;
/* Default case */
- unsigned magic_divisor = m, extra_flags = 0;
+ uint32_t magic_divisor = m, extra_flags = 0;
/* e = 2^(shift + 32) % d */
uint64_t e = t % hw_divisor;
@@ -234,8 +234,8 @@ panfrost_vertex_instanced(
}
/* Top flag implicitly set */
- assert(magic_divisor & (1 << 31));
- magic_divisor &= ~(1 << 31);
+ assert(magic_divisor & (1u << 31));
+ magic_divisor &= ~(1u << 31);
/* Upload to two different slots */