[cairo-bugs] [Bug 38600] New: cairo_svg_surface_create doesn't match API

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jun 23 03:08:49 PDT 2011


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

           Summary: cairo_svg_surface_create doesn't match API
           Product: cairo
           Version: 1.10.2
          Platform: x86 (IA32)
        OS/Version: Linux (All)
            Status: NEW
          Severity: minor
          Priority: medium
         Component: svg backend
        AssignedTo: emmanuel.pacaud at lapp.in2p3.fr
        ReportedBy: childsey01 at gmail.com
         QAContact: cairo-bugs at cairographics.org


When using cairo_svg_surface_create in exactly the same fashion as
cairo_ps_surface_create (which has an identical API in the documentation) I get
a warning from the former but never have for the latter:
assignment makes pointer from integer without a cast

Something seems to be either wrong with the documentation or the code for
cairo_svg_surface_create; however, my program still functions fine anyway. It
would be nice to not have the warning appear when compiling though.

Here is the code that uses it:

gboolean plot_linear_print_eps(GtkWidget *plot, gchar* fout)
{
    cairo_t *cr;
    cairo_surface_t *surface;

    surface=cairo_ps_surface_create(fout, (gdouble) (plot->allocation.width),
(gdouble) (plot->allocation.height));
    cairo_ps_surface_set_eps(surface, TRUE);
    cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_2);
    cr=cairo_create(surface);
    draw(plot, cr);
    cairo_surface_show_page(surface);
    cairo_destroy(cr);
    cairo_surface_finish(surface);
    cairo_surface_destroy(surface);
    return FALSE;
}

gboolean plot_linear_print_svg(GtkWidget *plot, gchar* fout)
{
    cairo_t *cr;
    cairo_surface_t *surface;

    surface=cairo_svg_surface_create(fout, (gdouble) (plot->allocation.width),
(gdouble) (plot->allocation.height));
    cr=cairo_create(surface);
    draw(plot, cr);
    cairo_destroy(cr);
    cairo_surface_destroy(surface);
    return FALSE;
}

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list