diff options
author | Russ Cox <rsc@swtch.com> | 2012-10-21 11:25:08 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2012-10-21 11:25:08 -0400 |
commit | 0cfb376070a4bef7b4168a9795e025437e1be79f (patch) | |
tree | 9cea2b3befd9183d11ccc0745a81658d5956e4d7 /src/cmd/postscript | |
parent | 34d629c8572518afe0a1d5698d7b184938e35a8f (diff) | |
download | plan9port-0cfb376070a4bef7b4168a9795e025437e1be79f.tar.gz plan9port-0cfb376070a4bef7b4168a9795e025437e1be79f.tar.bz2 plan9port-0cfb376070a4bef7b4168a9795e025437e1be79f.zip |
fix clang warnings reported by Tuncer Ayaz
R=rsc
http://codereview.appspot.com/6744054
Diffstat (limited to 'src/cmd/postscript')
-rw-r--r-- | src/cmd/postscript/tr2post/draw.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/cmd/postscript/tr2post/draw.c b/src/cmd/postscript/tr2post/draw.c index ace749ed..a7f6b223 100644 --- a/src/cmd/postscript/tr2post/draw.c +++ b/src/cmd/postscript/tr2post/draw.c @@ -105,8 +105,10 @@ draw(Biobuf *Bp) { r = Bgetrune(Bp); switch(r) { case 'l': - if (Bgetfield(Bp, 'd', &x1, 0)<=0 || Bgetfield(Bp, 'd', &y1, 0)<=0 || Bgetfield(Bp, 'r', &i, 0)<=0) + if (Bgetfield(Bp, 'd', &x1, 0)<=0 || Bgetfield(Bp, 'd', &y1, 0)<=0 || Bgetfield(Bp, 'r', &i, 0)<=0) { error(FATAL, "draw line function, destination coordinates not found.\n"); + return; + } endstring(); if (pageon()) @@ -115,8 +117,10 @@ draw(Biobuf *Bp) { vpos += y1; break; case 'c': - if (Bgetfield(Bp, 'd', &d1, 0)<=0) + if (Bgetfield(Bp, 'd', &d1, 0)<=0) { error(FATAL, "draw circle function, diameter coordinates not found.\n"); + return; + } endstring(); if (pageon()) @@ -124,8 +128,10 @@ draw(Biobuf *Bp) { hpos += d1; break; case 'e': - if (Bgetfield(Bp, 'd', &d1, 0)<=0 || Bgetfield(Bp, 'd', &d2, 0)<=0) + if (Bgetfield(Bp, 'd', &d1, 0)<=0 || Bgetfield(Bp, 'd', &d2, 0)<=0) { error(FATAL, "draw ellipse function, diameter coordinates not found.\n"); + return; + } endstring(); if (pageon()) @@ -133,8 +139,10 @@ draw(Biobuf *Bp) { hpos += d1; break; case 'a': - if (Bgetfield(Bp, 'd', &x1, 0)<=0 || Bgetfield(Bp, 'd', &y1, 0)<=0 || Bgetfield(Bp, 'd', &x2, 0)<=0 || Bgetfield(Bp, 'd', &y2, 0)<=0) + if (Bgetfield(Bp, 'd', &x1, 0)<=0 || Bgetfield(Bp, 'd', &y1, 0)<=0 || Bgetfield(Bp, 'd', &x2, 0)<=0 || Bgetfield(Bp, 'd', &y2, 0)<=0) { error(FATAL, "draw arc function, coordinates not found.\n"); + return; + } endstring(); if (pageon()) @@ -150,7 +158,7 @@ draw(Biobuf *Bp) { break; default: error(FATAL, "unknown draw function <%c>\n", r); - break; + return; } } |