[Mesa-dev] void operation in glsl

Liu Xin liuxin at icubecorp.com
Sun Aug 25 23:56:23 PDT 2013


On 08/26/2013 02:42 PM, Matt Turner wrote:
> On Sun, Aug 25, 2013 at 10:07 PM, Liu Xin <liuxin at icubecorp.com> wrote:
>> HI, list,
>>
>> i don't understand why glsl source  have  so many 'cast to void' operations,
>> like this.
>>
>> ir_rvalue *
>> ast_node::hir(exec_list *instructions,
>>            struct _mesa_glsl_parse_state *state)
>> {
>>     (void) instructions;
>>     (void) state;
>>
>>     return NULL;
>> }
>>
>> i think it's totally void operation, do you guy just make gcc compiler
>> happy?
> Yes, the purpose is only to avoid unused variable warnings emitted by
> the compiler.
yes it is. now i understood. clean code!
--lx



More information about the mesa-dev mailing list