[Mesa-dev] [PATCH 04/20] intel: Silence several "warning: unused parameter"
Eric Anholt
eric at anholt.net
Thu Sep 8 13:00:53 PDT 2011
On Mon, 29 Aug 2011 14:58:54 -0700, "Ian Romanick" <idr at freedesktop.org> wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> ---
> src/mesa/drivers/dri/intel/intel_buffer_objects.c | 47 ++++++++++++++-------
> 1 files changed, 31 insertions(+), 16 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
> index d908975..0acc3a1 100644
> --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
> +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
> @@ -151,6 +151,12 @@ intel_bufferobj_data(struct gl_context * ctx,
> struct intel_context *intel = intel_context(ctx);
> struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
>
> + /* Part of the ABI, but this function doesn't use it.
> + */
> +#ifndef I915
> + (void) target;
> +#endif
> +
To me, any benefit of parameter cleanups (like below) you might stumble
across from enabling these warnings are outweighed by the ugliness of
adding things like this to mark the warnings as handled.
> intel_obj->Base.Size = size;
> intel_obj->Base.Usage = usage;
>
> @@ -743,9 +749,7 @@ intel_bufferobj_copy_subdata(struct gl_context *ctx,
>
> #if FEATURE_APPLE_object_purgeable
> static GLenum
> -intel_buffer_purgeable(struct gl_context * ctx,
> - drm_intel_bo *buffer,
> - GLenum option)
> +intel_buffer_purgeable(drm_intel_bo *buffer)
> {
> int retained = 0;
>
> @@ -764,7 +768,7 @@ intel_buffer_object_purgeable(struct gl_context * ctx,
>
> intel = intel_buffer_object (obj);
> if (intel->buffer != NULL)
> - return intel_buffer_purgeable (ctx, intel->buffer, option);
> + return intel_buffer_purgeable(intel->buffer);
>
> if (option == GL_RELEASED_APPLE) {
> if (intel->sys_buffer != NULL) {
> @@ -775,10 +779,8 @@ intel_buffer_object_purgeable(struct gl_context * ctx,
> return GL_RELEASED_APPLE;
> } else {
> /* XXX Create the buffer and madvise(MADV_DONTNEED)? */
> - return intel_buffer_purgeable (ctx,
> - intel_bufferobj_buffer(intel_context(ctx),
> - intel, INTEL_READ),
> - option);
> + return intel_buffer_purgeable(intel_bufferobj_buffer(intel_context(ctx),
> + intel, INTEL_READ));
> }
> }
This could stand some of the usual local variable declarations.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110908/95c66ef1/attachment-0001.pgp>
More information about the mesa-dev
mailing list