Summary: | difference of non negative enums is never negative | ||
---|---|---|---|
Product: | cairo | Reporter: | Massimo <sixtysix> |
Component: | general | Assignee: | Chris Wilson <chris> |
Status: | RESOLVED MOVED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Massimo
2014-08-31 13:53:41 UTC
But that is not equivalent. The equivalent assert would be assert((int)(a->type - b->type) >= 0); (In reply to comment #1) > But that is not equivalent. The equivalent assert would be > assert((int)(a->type - b->type) >= 0); but that means that you are assigning/converting UINT_MAX - 1 or 2 to an int and gcc knows it cannot happen and I think after inlining and only checking the sign of the int gcc translates it to a->type != b->type -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/98. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.