From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kotontrion Date: Tue, 17 Jun 2025 11:49:48 +0200 Subject: [PATCH] valadoc: Fix gvRenderData to match graphviz 13.0.0 The gvRenderData changed the length type for the array to size_t. Change the length type in the vapi and in the chart's write_buffer function. There are more similar breaking changes which would need changes in the vapi but are not included in this patch. This is the minimal change to make valadoc work with graphviz 13.0.0. Source: https://gitlab.gnome.org/GNOME/vala/-/issues/1621#note_2473334 --- libvaladoc/charts/chart.vala | 5 +++-- vapi/libgvc.vapi | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libvaladoc/charts/chart.vala b/libvaladoc/charts/chart.vala index 4e642d1ce96e..5ef49527b2f0 100644 --- a/libvaladoc/charts/chart.vala +++ b/libvaladoc/charts/chart.vala @@ -52,15 +52,16 @@ public class Valadoc.Charts.Chart : Api.Visitor { context.render (graph, file_type, file); } - public uint8[]? write_buffer (string file_type) { + public uint8[:size_t]? write_buffer (string file_type) { if (context == null) { context = factory.create_context (graph); } - uint8[]? data; + uint8[:size_t]? data; /* This will return null in data if it fails. */ context.render_data (graph, file_type, out data); + return data; } diff --git a/vapi/libgvc.vapi b/vapi/libgvc.vapi index b128a02adcb7..8a2211ce20b6 100644 --- a/vapi/libgvc.vapi +++ b/vapi/libgvc.vapi @@ -91,7 +91,7 @@ namespace Gvc { public int render_jobs (Graph graph); [CCode (cname = "gvRenderData")] - public int render_data (Graph graph, [CCode (type = "char*")] string file_type, [CCode (array_length_type = "unsigned int", type = "char**")] out uint8[] output_data); + public int render_data (Graph graph, [CCode (type = "char*")] string file_type, [CCode (array_length_type = "size_t", type = "char**")] out uint8[] output_data); } [Compact]