<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/fbe02a0a5594126d98f30441147e7d4d3153e02c">https://github.com/macports/macports-base/commit/fbe02a0a5594126d98f30441147e7d4d3153e02c</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new fbe02a0 tracelib.c: Removed unnecessary condition in if
</span>fbe02a0 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit fbe02a0a5594126d98f30441147e7d4d3153e02c
</span>Author: Mihir Luthra <42952059+MihirLuthra@users.noreply.github.com>
AuthorDate: Tue Apr 9 21:58:23 2019 +0530
<span style='display:block; white-space:pre;color:#404040;'> tracelib.c: Removed unnecessary condition in if
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> if ((kev.flags & EV_ERROR) == 0 || ((kev.flags & EV_ERROR) > 0 && kev.data != 0))
</span><span style='display:block; white-space:pre;color:#404040;'> If compilers find first operand true while evaluating || , the second operand isn’t checked.
</span><span style='display:block; white-space:pre;color:#404040;'> So the second operand is only checked if (kev.flags & EV_ERROR) != 0.
</span><span style='display:block; white-space:pre;color:#404040;'> So (kev.flags & EV_ERROR) > 0 it doesn’t need to be checked in conjunction with kev.data != 0.
</span><span style='display:block; white-space:pre;color:#404040;'> It doesn’t return negative as its of type uint16_t.
</span>---
src/pextlib1.0/tracelib.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/pextlib1.0/tracelib.c b/src/pextlib1.0/tracelib.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 931fcc3..9ca810a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/pextlib1.0/tracelib.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/pextlib1.0/tracelib.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -771,7 +771,7 @@ static int TracelibRunCmd(Tcl_Interp *in) {
</span> /* kevent(2) on EV_RECEIPT: When passed as input, it forces EV_ERROR to
* always be returned. When a filter is successfully added, the data field
* will be zero. */
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if ((kev.flags & EV_ERROR) == 0 || ((kev.flags & EV_ERROR) > 0 && kev.data != 0)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((kev.flags & EV_ERROR) == 0 || (kev.data != 0)) {
</span> error2tcl("kevent (listen socket receipt): ", kev.data, in);
goto error_locked;
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -801,7 +801,7 @@ static int TracelibRunCmd(Tcl_Interp *in) {
</span> /* kevent(2) on EV_RECEIPT: When passed as input, it forces EV_ERROR to
* always be returned. When a filter is successfully added, the data field
* will be zero. */
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if ((kev.flags & EV_ERROR) == 0 || ((kev.flags & EV_ERROR) > 0 && kev.data != 0)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((kev.flags & EV_ERROR) == 0 || (kev.data != 0)) {
</span> error2tcl("kevent (selfpipe receipt): ", kev.data, in);
goto error_locked;
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -892,7 +892,7 @@ static int TracelibRunCmd(Tcl_Interp *in) {
</span> /* kevent(2) on EV_RECEIPT: When passed as input, it forces EV_ERROR to
* always be returned. When a filter is successfully added, the data field
* will be zero. */
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if ((kev.flags & EV_ERROR) == 0 || ((kev.flags & EV_ERROR) > 0 && kev.data != 0)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((kev.flags & EV_ERROR) == 0 || (kev.data != 0)) {
</span> ui_warn(interp, "tracelib: error adding socket to kqueue (receipt)");
close(s);
continue;
</pre><pre style='margin:0'>
</pre>