OSDN Git Service

Remove implicit truncation from unsigned int to bit field
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 14 Feb 2018 13:31:00 +0000 (14:31 +0100)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 14 Mar 2018 04:09:44 +0000 (12:09 +0800)
commit555cd80a64ebf72d75c3bc9dbee6e05f2f03cca6
tree37eefd78aeefb65c84624fdd049598c9058ad159
parent5802bd725347f7b6ee012e60f741508257e2ee76
Remove implicit truncation from unsigned int to bit field

All the members of struct i965_sampler_8x8_coefficient are signed
int of 8 bit long (ranging from -128 to 127).

But there is an assignation of 1U<<7 which is implicitly truncated
to -128.

To make explicit the casting, without losing the expresiveness of
the bitwise operation, this patch adds a macro which uses the
anonymous union technique.
src/i965_post_processing.c