Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node: Fix mask-or operator precedence by replacing
+
with |
A request for using masks and shifts on the known `0-1-2` constants defining the minor type of a DRM node resulted in the expression to maintain the original `+` from first subtracting the current node type followed by adding the requested node type. As the subtract of the current node type was replaced by a mask, the resulting `old_id & ID_MASK + minor_base` expression is interpreted as `old_id & (ID_MASK + minor_base)` because of operator precedence, while it would have been correctly interpreted as `(old_id & ID_MASK) | minor_base` when the correct `|` OR operator is used.
- Loading branch information