[Mesa-dev] [PATCH 1/2] i965: forward-declare struct brw_context in brw_reg.h

Kenneth Graunke kenneth at whitecape.org
Wed Jul 9 19:30:15 PDT 2014


On Wednesday, July 09, 2014 09:26:49 PM Ilia Mirkin wrote:
> Commit 54e91e7420 introduced a function declaration that uses
> brw_context. While brw_context tends to get included in most files, it
> is not when compiling intel_asm_annotation.c resulting in the following
> warning:
> 
> In file included from brw_shader.h:25:0,
>                  from brw_cfg.h:32,
>                  from intel_asm_annotation.c:24:
> brw_reg.h:122:39: warning: 'struct brw_context' declared inside
> parameter list [enabled by default]
> brw_reg.h:122:39: warning: its scope is only this definition or
> declaration, which is probably not what you want [enabled by default]
> 
> Add a forward-declaration for struct brw_context to avoid the issue.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/mesa/drivers/dri/i965/brw_reg.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_reg.h 
b/src/mesa/drivers/dri/i965/brw_reg.h
> index 494ce8c..28d3d94 100644
> --- a/src/mesa/drivers/dri/i965/brw_reg.h
> +++ b/src/mesa/drivers/dri/i965/brw_reg.h
> @@ -52,6 +52,8 @@
>  extern "C" {
>  #endif
>  
> +struct brw_context;
> +
>  /** Number of general purpose registers (VS, WM, etc) */
>  #define BRW_MAX_GRF 128


Thanks for fixing this.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140709/b263e867/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140709/b263e867/attachment-0001.sig>


More information about the mesa-dev mailing list