Merge "Prevent bit shifting if num bits is negative"

This commit is contained in:
Colin Cross 2012-04-26 13:31:29 -07:00 committed by android code review
commit 5b3eb07ed7

View file

@ -62,7 +62,8 @@ int32_t gglRecipQ(GGLfixed x, int q)
int shift;
x = gglRecipQNormalized(x, &shift);
shift += 16-q;
x += 1L << (shift-1); // rounding
if (shift > 0)
x += 1L << (shift-1); // rounding
x >>= shift;
return x;
}