https://bugs.freedesktop.org/show_bug.cgi?id=47493

             Bug #: 47493
           Summary: protocol-native: XOR asserts are expressed in a
                    roundabout way
    Classification: Unclassified
           Product: PulseAudio
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: love
          Severity: normal
          Priority: medium
         Component: core
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
                CC: [email protected]


protocol-native.c has a bunch of asserts like this ...

CHECK_VALIDITY(c->pstream, idx != PA_INVALID_INDEX || name, tag,
PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, idx == PA_INVALID_INDEX || !name, tag,
PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, !name || idx == PA_INVALID_INDEX, tag,
PA_ERR_INVALID);

... that could be written as a single, more readable, XOR like this ...

CHECK_VALIDITY(c->pstream, (idx != PA_INVALID_INDEX) ^ (name != NULL), tag,
PA_ERR_INVALID);

Ergo, we should do this. :)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.
_______________________________________________
pulseaudio-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-bugs

Reply via email to