[rtems commit] posix: Simplify POSIX_API_Control

Joel Sherrill joel at rtems.org
Tue Oct 10 14:32:50 UTC 2017


On Tue, Oct 10, 2017 at 12:43 AM, Sebastian Huber <sebh at rtems.org> wrote:

> index 6a3b625..26ab28d 100644
> --- a/cpukit/posix/src/pthreadattrcompare.c
> +++ b/cpukit/posix/src/pthreadattrcompare.c
> @@ -32,7 +32,10 @@ int rtems_pthread_attribute_compare(
>    if ( attr1->is_initialized  !=  attr2->is_initialized )
>      return 1;
>
> -  if ( attr1->stackaddr != attr2->stackaddr )
> +  if (
> +    attr1->stackaddr != NULL &&
> +      attr2->stackaddr != NULL &&
> +      attr1->stackaddr != attr2->stackaddr )
>      return 1;
>
>
There are multiple places in this patch where simple single conditionals
could be
used rather than more complicated compound expressions. These are harder
to do coverage testing with.

I don't know whether this is written as part of the coding style but I
thought we
were trying to move to simple expressions as much as possible.

--joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20171010/5d216a3d/attachment.html>


More information about the devel mailing list