Bug 2300 - Accept NULL for out parameters
Summary: Accept NULL for out parameters
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-17 12:30 UTC by Owen Taylor
Modified: 2005-08-22 00:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Owen Taylor 2005-01-17 12:30:24 UTC
It would be good if Cairo consistently allowed passing NULL for any
out parameter to mean "ignore"

writing code like:

   double tx, ty;

   cairo_matrix_get_affine (scale,
                            &sc.matrix[0][0], &sc.matrix[0][1],
                            &sc.matrix[1][0], &sc.matrix[1][1],
                            tx, ty);

   return _ft_font_create (pattern, &sc);

Is painful for no good reason. This is most important for functions
with multiple out values. Though GTK+ applies the rule to *all* out
parameters, there is really no point for something like
cairo_text_extents().

cairo_matrix_get_affine()
cairo_current_rgb_color()
cairo_current_point()

Are the functions I can find that are affected.
Comment 1 Carl Worth 2005-01-19 12:19:12 UTC
Thanks for the report Owen.

I've just committed a fix for the three specified functions.
Comment 2 Carl Worth 2005-08-22 17:15:38 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.


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.