Bug 2300

Summary: Accept NULL for out parameters
Product: cairo Reporter: Owen Taylor <otaylor>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high CC: jwatt
Version: 0.9.3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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.