ruby-changes:57167
From: Yusuke <ko1@a...>
Date: Mon, 19 Aug 2019 14:44:09 +0900 (JST)
Subject: [ruby-changes:57167] Yusuke Endoh: d76be10df1 (master): missing/memcmp.c: suppress a `-Wparentheses` warning
https://git.ruby-lang.org/ruby.git/commit/?id=d76be10df1 From d76be10df11cf24d7a5a1f88a4aadc6d817db4a7 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Mon, 19 Aug 2019 14:43:15 +0900 Subject: missing/memcmp.c: suppress a `-Wparentheses` warning diff --git a/missing/memcmp.c b/missing/memcmp.c index a81eec4..9657e6c 100644 --- a/missing/memcmp.c +++ b/missing/memcmp.c @@ -11,7 +11,8 @@ memcmp(const void *s1, const void *s2, size_t len) https://github.com/ruby/ruby/blob/trunk/missing/memcmp.c#L11 register int tmp; for (; len; --len) { - if (tmp = *a++ - *b++) + tmp = *a++ - *b++; + if (tmp) return tmp; } return 0; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/