On 18.11.2014 17:43, Iago Toral Quiroga wrote: > From: Jason Ekstrand <jason.ekstr...@intel.com>
The commit short log (first line of the commit log) should at least say 'snorm_to_float' instead of 'one of the format helper functions'. It could probably have a more informative summary of what the change does as well. > --- > src/mesa/main/format_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c > index 93a0cea..b6d0fbc 100644 > --- a/src/mesa/main/format_utils.c > +++ b/src/mesa/main/format_utils.c > @@ -152,7 +152,7 @@ unorm_to_float(unsigned x, unsigned src_bits) > static inline float > snorm_to_float(int x, unsigned src_bits) > { > - if (x == -MAX_INT(src_bits)) > + if (x < -MAX_INT(src_bits)) > return -1.0f; > else > return x * (1.0f / (float)MAX_INT(src_bits)); Should it be if (x <= -MAX_INT(src_bits))? Even if the else case is guaranteed to produce -1.0f for x == -MAX_INT(src_bits), it seems like wasted effort. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev