[cairo-bugs] [Bug 91635] New: test/subsurface.c: cairo_select_font_face invoked with 2 arguments swapped

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Aug 14 04:10:07 PDT 2015


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

            Bug ID: 91635
           Summary: test/subsurface.c: cairo_select_font_face invoked with
                    2 arguments swapped
           Product: cairo
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: trivial
          Priority: medium
         Component: general
          Assignee: chris at chris-wilson.co.uk
          Reporter: sixtysix at inwind.it
        QA Contact: cairo-bugs at cairographics.org

When building cairo with 'clang' there is an interesting warning

>subsurface.c:51:5: warning: implicit conversion from enumeration type 'enum _cairo_font_weight' to different enumeration type 'cairo_font_slant_t' (aka 'enum _cairo_font
>    CAIRO_FONT_WEIGHT_NORMAL,
>    ^~~~~~~~~~~~~~~~~~~~~~~~
>subsurface.c:52:5: warning: implicit conversion from enumeration type 'enum _cairo_font_slant' to different enumeration type 'cairo_font_weight_t' (aka 'enum _cairo_font
>    CAIRO_FONT_SLANT_NORMAL);
>    ^~~~~~~~~~~~~~~~~~~~~~~

In fact cairo_select_font_face is declared as:

http://cgit.freedesktop.org/cairo/tree/src/cairo.h#n1416

and accepts a cairo_font_slant_t followed by a cairo_font_weight_t,
but in test/subsurface.c (and test/subsurface-scale.c):

http://cgit.freedesktop.org/cairo/tree/test/subsurface.c#n49

CAIRO_FONT_SLANT_NORMAL follows CAIRO_FONT_WEIGHT_NORMAL. Given that
these tests are often used as examples or to generate more elaborate
tests I suggest to swap the arguments even if the two values are the
same (in both test files).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20150814/0475739f/attachment.html>


More information about the cairo-bugs mailing list