From 5a43e931f994cd31310e15d4c7d061648cf1669f Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 24 Nov 2018 15:20:44 +1100 Subject: [PATCH] Have cgen convert "ok" to "NULL" --- cmd/wuffs-c/internal/cgen/expr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/wuffs-c/internal/cgen/expr.go b/cmd/wuffs-c/internal/cgen/expr.go index 9855e11a..238d01d6 100644 --- a/cmd/wuffs-c/internal/cgen/expr.go +++ b/cmd/wuffs-c/internal/cgen/expr.go @@ -44,7 +44,7 @@ func (g *gen) writeExpr(b *buffer, n *a.Expr, rp replacementPolicy, depth uint32 if cv := n.ConstValue(); cv != nil { if typ := n.MType(); typ.IsNumTypeOrIdeal() { b.writes(cv.String()) - } else if typ.IsNullptr() { + } else if typ.IsNullptr() || typ.IsStatus() { b.writes("NULL") } else if cv.Cmp(zero) == 0 { b.writes("false")