[Mesa-dev] [PATCH] mesa/st: Standardize some asserts to use !"foo"

Brian Paul brianp at vmware.com
Tue Aug 30 13:33:46 UTC 2016


On 08/30/2016 04:09 AM, 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;
>      }
>   }
>

Reviewed-by: Brian Paul <brianp at vmware.com>

Need me to push this for you?



More information about the mesa-dev mailing list