You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by fi...@apache.org on 2008/05/10 20:52:28 UTC

svn commit: r655138 - /apr/apr/trunk/poll/unix/select.c

Author: fielding
Date: Sat May 10 11:52:28 2008
New Revision: 655138

URL: http://svn.apache.org/viewvc?rev=655138&view=rev
Log:
silence warning about assignment expression

Modified:
    apr/apr/trunk/poll/unix/select.c

Modified: apr/apr/trunk/poll/unix/select.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/select.c?rev=655138&r1=655137&r2=655138&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/select.c (original)
+++ apr/apr/trunk/poll/unix/select.c Sat May 10 11:52:28 2008
@@ -520,7 +520,7 @@
             j++;
         }
     }
-    if ((*num) = j)
+    if (((*num) = j) != 0)
         rv = APR_SUCCESS;
 
     if (descriptors)



Re: svn commit: r655138 - /apr/apr/trunk/poll/unix/select.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Lucian Adrian Grijincu wrote:
> On Sat, May 10, 2008 at 9:52 PM,  <fi...@apache.org> wrote:
>>     }
>> -    if ((*num) = j)
>> +    if (((*num) = j) != 0)
> wouldn't just another set of parentheses fix it?
> if (((*num) = j))

Actually, ((*num = j)) is legit, or ((*num = j) != 0) for clarity.  The
(*num) parens are redundant in any C code I've ever seen :-)


Re: svn commit: r655138 - /apr/apr/trunk/poll/unix/select.c

Posted by "Roy T. Fielding" <ro...@gmail.com>.
On May 10, 2008, at 12:06 PM, Lucian Adrian Grijincu wrote:

> On Sat, May 10, 2008 at 9:52 PM,  <fi...@apache.org> wrote:
>> Author: fielding
>> Date: Sat May 10 11:52:28 2008
>> New Revision: 655138
>>
>> URL: http://svn.apache.org/viewvc?rev=655138&view=rev
>> Log:
>> silence warning about assignment expression
>>
>> Modified:
>>    apr/apr/trunk/poll/unix/select.c
>>
>> Modified: apr/apr/trunk/poll/unix/select.c
>> URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/select.c? 
>> rev=655138&r1=655137&r2=655138&view=diff
>> ===================================================================== 
>> =========
>> --- apr/apr/trunk/poll/unix/select.c (original)
>> +++ apr/apr/trunk/poll/unix/select.c Sat May 10 11:52:28 2008
>> @@ -520,7 +520,7 @@
>>             j++;
>>         }
>>     }
>> -    if ((*num) = j)
>> +    if (((*num) = j) != 0)
> wouldn't just another set of parentheses fix it?
> if (((*num) = j))

Of course, but that is less recognizable as an intentional assignment.

....Roy


Re: svn commit: r655138 - /apr/apr/trunk/poll/unix/select.c

Posted by Lucian Adrian Grijincu <lu...@gmail.com>.
On Sat, May 10, 2008 at 9:52 PM,  <fi...@apache.org> wrote:
> Author: fielding
> Date: Sat May 10 11:52:28 2008
> New Revision: 655138
>
> URL: http://svn.apache.org/viewvc?rev=655138&view=rev
> Log:
> silence warning about assignment expression
>
> Modified:
>    apr/apr/trunk/poll/unix/select.c
>
> Modified: apr/apr/trunk/poll/unix/select.c
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/select.c?rev=655138&r1=655137&r2=655138&view=diff
> ==============================================================================
> --- apr/apr/trunk/poll/unix/select.c (original)
> +++ apr/apr/trunk/poll/unix/select.c Sat May 10 11:52:28 2008
> @@ -520,7 +520,7 @@
>             j++;
>         }
>     }
> -    if ((*num) = j)
> +    if (((*num) = j) != 0)
wouldn't just another set of parentheses fix it?
if (((*num) = j))

>         rv = APR_SUCCESS;
>
>     if (descriptors)
>
>
>



-- 
Lucian