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

Author: Matt Turner <matts...@gmail.com>
Date:   Tue May 24 15:10:25 2016 -0700

i965: Add missing types to type_sz().

Coverity warns in multiple places about the potential for division by
zero, caused by this function's default case.

Reviewed-by: Francisco Jerez <curroje...@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

---

 src/mesa/drivers/dri/i965/brw_reg.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_reg.h 
b/src/mesa/drivers/dri/i965/brw_reg.h
index bd7ea1b..38cf8e3 100644
--- a/src/mesa/drivers/dri/i965/brw_reg.h
+++ b/src/mesa/drivers/dri/i965/brw_reg.h
@@ -292,15 +292,19 @@ type_sz(unsigned type)
    case BRW_REGISTER_TYPE_UD:
    case BRW_REGISTER_TYPE_D:
    case BRW_REGISTER_TYPE_F:
+   case BRW_REGISTER_TYPE_VF:
       return 4;
    case BRW_REGISTER_TYPE_UW:
    case BRW_REGISTER_TYPE_W:
+   case BRW_REGISTER_TYPE_UV:
+   case BRW_REGISTER_TYPE_V:
+   case BRW_REGISTER_TYPE_HF:
       return 2;
    case BRW_REGISTER_TYPE_UB:
    case BRW_REGISTER_TYPE_B:
       return 1;
    default:
-      return 0;
+      unreachable("not reached");
    }
 }
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to