[Mesa-dev] [PATCH] mesa/st: Standardize some asserts to use !"foo"
Edward O'Callaghan
funfunctor at folklore1984.net
Wed Aug 31 07:20:03 UTC 2016
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
On 08/30/2016 08:09 PM, Michael Schellenberger Costa wrote:
> These are the final asserts in the tree that do not follow the pattern assert(!"foo"). To simplify spotting of (mostly) incorrect asserts via git grep "assert(\"" rewrite them into the standard form.
>
> Signed-off-by: Michael Schellenberger Costa <mschellenbergercosta at gmail.com>
> ---
> src/mesa/state_tracker/st_atom_blend.c | 4 ++--
> src/mesa/state_tracker/st_atom_depth.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c
> index 65de67b..cdcba77 100644
> --- a/src/mesa/state_tracker/st_atom_blend.c
> +++ b/src/mesa/state_tracker/st_atom_blend.c
> @@ -101,7 +101,7 @@ translate_blend(GLenum blend)
> case GL_ONE_MINUS_SRC1_ALPHA:
> return PIPE_BLENDFACTOR_INV_SRC1_ALPHA;
> default:
> - assert("invalid GL token in translate_blend()" == NULL);
> + assert(!"invalid GL token in translate_blend()");
> return 0;
> }
> }
> @@ -147,7 +147,7 @@ translate_logicop(GLenum logicop)
> case GL_SET:
> return PIPE_LOGICOP_SET;
> default:
> - assert("invalid GL token in translate_logicop()" == NULL);
> + assert(!"invalid GL token in translate_logicop()");
> return 0;
> }
> }
> diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c
> index 267b42c..e6f6f2f 100644
> --- a/src/mesa/state_tracker/st_atom_depth.c
> +++ b/src/mesa/state_tracker/st_atom_depth.c
> @@ -90,7 +90,7 @@ gl_stencil_op_to_pipe(GLenum func)
> case GL_INVERT:
> return PIPE_STENCIL_OP_INVERT;
> default:
> - assert("invalid GL token in gl_stencil_op_to_pipe()" == NULL);
> + assert(!"invalid GL token in gl_stencil_op_to_pipe()");
> return 0;
> }
> }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160831/c3aaf690/attachment.sig>
More information about the mesa-dev
mailing list