i965: Add missing types to type_sz().
authorMatt Turner <mattst88@gmail.com>
Tue, 24 May 2016 22:10:25 +0000 (15:10 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 2 Jun 2016 18:34:09 +0000 (11:34 -0700)
Coverity warns in multiple places about the potential for division by
zero, caused by this function's default case.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_reg.h

index bd7ea1ba7bcb6ddb31c6c20363d4f024a8b6568a..38cf8e313714d77b3380ad9d4b4fa3bc4f05dff9 100644 (file)
@@ -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");
    }
 }