Bug 91635 - test/subsurface.c: cairo_select_font_face invoked with 2 arguments swapped
Summary: test/subsurface.c: cairo_select_font_face invoked with 2 arguments swapped
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium trivial
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-14 11:10 UTC by Massimo
Modified: 2018-08-25 13:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Massimo 2015-08-14 11:10:07 UTC
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).
Comment 1 GitLab Migration User 2018-08-25 13:52:15 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/cairo/cairo/issues/239.


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.