nouveau: assert argument cannot have side effects
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 12 Jun 2011 14:40:40 +0000 (16:40 +0200)
committerMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 18 Sep 2011 13:26:16 +0000 (15:26 +0200)
... because argument is evaluated only if NDEBUG is not defined

nouveau/nouveau_pushbuf.c

index 90836bcdd0153291cb831688c7eca8f85e60f68d..59f60d9f0e9390439da7627c3f581bd470876832 100644 (file)
@@ -270,7 +270,8 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
        nvpb->nr_push = 0;
 
        /* Allocate space for next push buffer */
-       assert(!nouveau_pushbuf_space(chan, min));
+       if (nouveau_pushbuf_space(chan, min))
+               assert(0);
 
        if (chan->flush_notify)
                chan->flush_notify(chan);