gallium/auxiliary: Sanitize NULL checks into canonical form
[mesa.git] / src / gallium / auxiliary / postprocess / pp_init.c
index edd54ce2fa9e1c2830cfe846b0e801a35cbd6a56..b9eff78bf4f5ccf839b8960b7fef029d8ae242db 100644 (file)
@@ -28,6 +28,7 @@
 #include "pipe/p_compiler.h"
 
 #include "postprocess/filters.h"
+#include "postprocess/pp_private.h"
 
 #include "pipe/p_screen.h"
 #include "util/u_inlines.h"
@@ -57,7 +58,7 @@ pp_init(struct pipe_context *pipe, const unsigned int *enabled,
 
    ppq = CALLOC(1, sizeof(struct pp_queue_t));
 
-   if (ppq == NULL) {
+   if (!ppq) {
       pp_debug("Unable to allocate memory for ppq.\n");
       goto error;
    }
@@ -323,8 +324,6 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
 
    p->viewport.scale[0] = p->viewport.translate[0] = (float) w / 2.0f;
    p->viewport.scale[1] = p->viewport.translate[1] = (float) h / 2.0f;
-   p->viewport.scale[3] = 1.0f;
-   p->viewport.translate[3] = 0.0f;
 
    ppq->fbos_init = true;