<html><head><base href="x-msg://60/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Checking < 0 is much cheaper than checking = -1.<div>C idioms typically check < 0.<br><div>-1 is simply a convenient negative value to return.<br><div>Leave it as is.</div><div><br></div><div><br>
<br><div><div>On 18 Apr 2010, at 09:57, Jay K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">Posix often says:<br> function foo() returns 0 for success, -1 for error<br> <br> m3core/libm3/etc, often say if foo() < 0 or if foo() # 0 "instead".<br> Generally ok to tighten these up to "= -1", perhaps upon checking manpages,<br> or a known rat's nest of inconsistencies?<br><br> - Jay<br><br></div></span></blockquote></div><br></div></div></div></body></html>