[Mesa-dev] [PATCH 1/4] i965: Silence many unused parameter warnings

Ian Romanick idr at freedesktop.org
Sat Jul 19 15:03:32 PDT 2014


On 07/15/2014 11:18 AM, Matt Turner wrote:
> On Tue, Jul 15, 2014 at 10:56 AM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> brw_inst.h: In function 'brw_inst_set_src1_vstride':
>> brw_inst.h:118:76: warning: unused parameter 'brw' [-Wunused-parameter]
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> ---
>>  src/mesa/drivers/dri/i965/brw_inst.h | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h
>> index e880c9f..719ac8e 100644
>> --- a/src/mesa/drivers/dri/i965/brw_inst.h
>> +++ b/src/mesa/drivers/dri/i965/brw_inst.h
>> @@ -56,6 +56,7 @@ brw_inst_set_##name(const struct brw_context *brw,            \
>>                      brw_inst *inst, uint64_t v)               \
>>  {                                                             \
>>     assert(assertions);                                        \
>> +   (void) brw;                                                \
>>     brw_inst_set_bits(inst, high, low, v);                     \
>>  }                                                             \
>>  static inline uint64_t                                        \
>> @@ -63,6 +64,7 @@ brw_inst_##name(const struct brw_context *brw,                \
>>                  brw_inst *inst)                               \
>>  {                                                             \
>>     assert(assertions);                                        \
>> +   (void) brw;                                                \
>>     return brw_inst_bits(inst, high, low);                     \
>>  }
>>
>> @@ -306,12 +308,14 @@ brw_inst_set_##name(const struct brw_context *brw, brw_inst *inst, int16_t v) \
>>     assert(assertions);                                                        \
>>     assert(v <= (1 << 16) - 1);                                                \
>>     assert(v > -(1 << 16));                                                    \
>> +   (void) brw;                                                                \
>>     brw_inst_set_bits(inst, high, low, (uint16_t) v);                          \
>>  }                                                                             \
>>  static inline int16_t                                                         \
>>  brw_inst_##name(const struct brw_context *brw, brw_inst *inst)                \
>>  {                                                                             \
>>     assert(assertions);                                                        \
>> +   (void) brw;                                                                \
>>     return brw_inst_bits(inst, high, low);                                     \
>>  }
>>
>> @@ -544,12 +548,14 @@ F(pi_message_data,   MD(7),   MD(0))
>>  static inline int
>>  brw_inst_imm_d(const struct brw_context *brw, brw_inst *insn)
>>  {
>> +   (void) brw;
>>     return brw_inst_bits(insn, 127, 96);
>>  }
>>
>>  static inline unsigned
>>  brw_inst_imm_ud(const struct brw_context *brw, brw_inst *insn)
>>  {
>> +   (void) brw;
>>     return brw_inst_bits(insn, 127, 96);
>>  }
>>
>> @@ -557,6 +563,7 @@ static inline float
>>  brw_inst_imm_f(const struct brw_context *brw, brw_inst *insn)
>>  {
>>     fi_type ft;
>> +   (void) brw;
>>     ft.u = brw_inst_bits(insn, 127, 96);
>>     return ft.f;
>>  }
>> @@ -565,6 +572,7 @@ static inline void
>>  brw_inst_set_imm_d(const struct brw_context *brw,
>>                     brw_inst *insn, int value)
>>  {
>> +   (void) brw;
>>     return brw_inst_set_bits(insn, 127, 96, value);
>>  }
>>
>> @@ -572,6 +580,7 @@ static inline void
>>  brw_inst_set_imm_ud(const struct brw_context *brw,
>>                      brw_inst *insn, unsigned value)
>>  {
>> +   (void) brw;
>>     return brw_inst_set_bits(insn, 127, 96, value);
>>  }
>>
>> @@ -580,6 +589,7 @@ brw_inst_set_imm_f(const struct brw_context *brw,
>>                     brw_inst *insn, float value)
>>  {
>>     fi_type ft;
>> +   (void) brw;
>>     ft.f = value;
>>     brw_inst_set_bits(insn, 127, 96, ft.u);
>>  }
>> --
> 
> Series is
> 
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
> 
> You could just drop the brw from the function declaration, and avoid
> the (void)brw. That might be nicer.

Unfortunately, that .h file is included from C files, and you can only
do that in C++. :(



More information about the mesa-dev mailing list