Ralph,
What about creating a lookup table of static const values with
comments for readability, and use Tim's code, except for the last
line, which would lookup the value instead of computing it?
I don't know how often this code path is traversed. Seeing only this
snippet of code, I
On May 2, 2011, at 1:48 AM, Rainer Keller wrote:
> Ralph,
> two issues:
>
> On Friday 29 April 2011 19:56:15 r...@osl.iu.edu wrote:
>> Author: rhc
>> Date: 2011-04-29 13:56:15 EDT (Fri, 29 Apr 2011)
>> New Revision: 24665
>> URL: https://svn.open-mpi.org/trac/ompi/changeset/24665
>>
>> Log:
>>
Ralph,
two issues:
On Friday 29 April 2011 19:56:15 r...@osl.iu.edu wrote:
> Author: rhc
> Date: 2011-04-29 13:56:15 EDT (Fri, 29 Apr 2011)
> New Revision: 24665
> URL: https://svn.open-mpi.org/trac/ompi/changeset/24665
>
> Log:
> Cover all the netmask values
>
> Text files modified:
>
Mostly because I thought it of some value to make the resulting mask readable
and apparent to someone looking at the code.
On Apr 30, 2011, at 8:14 PM, Tim Mattox wrote:
> Why not do this instead of a big switch statement?
>
> pval = strtol(msk, NULL, 10);
> if ((pval > 30) || (pval < 1)) {
>
Why not do this instead of a big switch statement?
pval = strtol(msk, NULL, 10);
if ((pval > 30) || (pval < 1)) {
opal_output(0, "opal_iftupletoaddr: unknown mask");
free(addr);
return OPAL_ERROR;
}
*mask = 0x << (32 - pval);
On Fri, Apr 29, 2011 at 1:56 PM,