Bug 106475 - xorg-server-1.20.0/miext/rootless/rootlessGC.c:1238: confused chain of if statements
Summary: xorg-server-1.20.0/miext/rootless/rootlessGC.c:1238: confused chain of if sta...
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-11 09:08 UTC by dcb314
Modified: 2018-12-13 22:39 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description dcb314 2018-05-11 09:08:30 UTC
xorg-server-1.20.0/miext/rootless/rootlessGC.c:1238] -> [xorg-server-1.20.0/miext/rootless/rootlessGC.c:1246]: (warning) Identical inner 'if' condition is always true.

Source code is

    if (width > 0) {
        BoxRec box;

        /* ugh */
        box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
        box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);

        if (count > 1) {
            if (width > 0)
                box.x2 += width;
            else
                box.x1 += width;

box.x1 can never be incremented.
Comment 1 dcb314 2018-05-11 09:10:27 UTC
Same thing in function polytext16 in same file:

xorg-server-1.20.0/miext/rootless/rootlessGC.c:1329] -> [xorg-server-1.20.0/miext/rootless/rootlessGC.c:1337]: (warning) Identical inner 'if' condition is always true.
Comment 2 GitLab Migration User 2018-12-13 22:39:33 UTC
-- 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/xorg/xserver/issues/537.


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.