summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_state_gs.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <[email protected]>2015-12-04 22:08:22 +1100
committerMarek Olšák <[email protected]>2015-12-06 17:10:23 +0100
commit13eb5f596bc8ece3d1805b388aa53917e6158d7b (patch)
treeda4ab5c8fd897b317d7f66004fdd22cd02ebe84c /src/gallium/drivers/svga/svga_state_gs.c
parent150c289f6067cb1ba4572f9124948a94ef94c839 (diff)
gallium/drivers: Sanitize NULL checks into canonical form
Use NULL tests of the form `if (ptr)' or `if (!ptr)'. They do not depend on the definition of the symbol NULL. Further, they provide the opportunity for the accidental assignment, are clear and succinct. Signed-off-by: Edward O'Callaghan <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_state_gs.c')
-rw-r--r--src/gallium/drivers/svga/svga_state_gs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_state_gs.c b/src/gallium/drivers/svga/svga_state_gs.c
index 0b336baee86..618bec248dd 100644
--- a/src/gallium/drivers/svga/svga_state_gs.c
+++ b/src/gallium/drivers/svga/svga_state_gs.c
@@ -72,7 +72,7 @@ compile_gs(struct svga_context *svga,
enum pipe_error ret = PIPE_ERROR;
variant = translate_geometry_program(svga, gs, key);
- if (variant == NULL) {
+ if (!variant) {
/* some problem during translation, try the dummy shader */
const struct tgsi_token *dummy = get_dummy_geometry_shader();
if (!dummy) {
@@ -82,7 +82,7 @@ compile_gs(struct svga_context *svga,
FREE((void *) gs->base.tokens);
gs->base.tokens = dummy;
variant = translate_geometry_program(svga, gs, key);
- if (variant == NULL) {
+ if (!variant) {
return PIPE_ERROR;
}
}
@@ -181,7 +181,7 @@ emit_hw_gs(struct svga_context *svga, unsigned dirty)
if (svga->curr.user_gs)
assert(svga->curr.gs);
- if (gs == NULL) {
+ if (!gs) {
if (svga->state.hw_draw.gs != NULL) {
/** The previous geometry shader is made inactive.